Skip to content

Commit

Permalink
Get scheduler to work on 2-qubit gates.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakejohnson committed May 17, 2017
1 parent 045030f commit d07ba24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion QGL/Scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def schedule(seq):
counters = {}
out_seq = []

for instr in flatten(seq):
for instr in seq:
if isinstance(instr, Barrier):
synchronize_counters(counters, instr.chanlist)
continue
Expand Down
13 changes: 2 additions & 11 deletions tests/test_Scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,8 @@ def test_2q_ops(self):
X(q1), Y(q2)]
result = schedule(seq)

# unroll the CNOT_CR sequence
cnotseq = CNOT_CR(q2, q3)

# FIXME currently fails because it schedules the 2nd X(q1) "inside" the
# CNOT(q2, q3)
# assert(result == [X(q1)*cnotseq[0],
# cnotseq[1],
# cnotseq[2],
# cnotseq[3],
# cnotseq[4],
# X(q1)*Y(q2)] )
assert(result == [X(q1)*CNOT_CR(q2, q3),
X(q1)*Y(q2)] )

seq = [CNOT_simple(q1, q2), CNOT_simple(q3, q4), X(q1), X(q2)]
result = schedule(seq)
Expand Down

0 comments on commit d07ba24

Please sign in to comment.