Skip to content

Commit

Permalink
Update test_Compiler
Browse files Browse the repository at this point in the history
--DR
  • Loading branch information
CoherenceController committed Sep 7, 2016
1 parent 0c368a5 commit 0e811ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/test_Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ def test_pull_uniform_entries(self):
ll = Compiler.compile_sequence(seq)
entryIterators = [iter(ll[q1]), iter(ll[q2])]
entries = [next(e) for e in entryIterators]
blocklen = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(blocklen, 60e-9)
assert all(e.length == blocklen for e in entries)
entries, max_length = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(max_length, 60e-9)
assert all(e.length == max_length for e in entries)
self.assertRaises(StopIteration, next, entryIterators[0])

q2.pulseParams['length'] = 40e-9
seq = [(X90(q1) + Z90(q1) + X90(q1)) * Y(q2)]
ll = Compiler.compile_sequence(seq)
entryIterators = [iter(ll[q1]), iter(ll[q2])]
entries = [next(e) for e in entryIterators]
blocklen = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(blocklen, 40e-9)
assert all(e.length == blocklen for e in entries)
entries, max_length = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(max_length, 40e-9)
assert all(e.length == max_length for e in entries)

def test_pull_uniform_entries2(self):
q1 = self.q1
Expand All @@ -104,9 +104,9 @@ def test_pull_uniform_entries2(self):
ll = Compiler.compile_sequence(seq)
entryIterators = [iter(ll[q1]), iter(ll[q2])]
entries = [next(e) for e in entryIterators]
blocklen = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(blocklen, 120e-9)
self.assertTrue(all(e.length == blocklen for e in entries))
entries, max_length = Compiler.pull_uniform_entries(entries, entryIterators)
self.assertAlmostEqual(max_length, 120e-9)
self.assertTrue(all(e.length == max_length for e in entries))

def test_merge_channels(self):
q1 = self.q1
Expand Down

0 comments on commit 0e811ea

Please sign in to comment.