Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
fixing final RuntimeError Travis misses
Browse files Browse the repository at this point in the history
  • Loading branch information
idk3 committed Sep 30, 2017
1 parent 63b8d80 commit 133b5aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions openfermionprojectq/_ffft_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ def setUp(self):
self.eng = MainEngine()
self.reg = self.eng.allocate_qureg(3)

def tearDown(self):
All(Measure) | self.reg

def test_apply_phase_1qubit(self):
eng = MainEngine()
reg = eng.allocate_qubit()
Expand Down Expand Up @@ -503,7 +506,6 @@ def test_4mode_ffft_with_external_swaps_all_logical_states(self):
Ph(3 * numpy.pi / 4) | register[0]
eng.flush()
wvfn = ordered_wavefunction(eng)
All(Measure) | register

fermion_operator = prepare_integer_fermion_operator(i)

Expand All @@ -529,6 +531,8 @@ def test_4mode_ffft_with_external_swaps_all_logical_states(self):
index = sum(2 ** site[0] for site in term)
converted_wvfn[index] = ffft_result.terms[term]

All(Measure) | register

self.assertTrue(numpy.allclose(wvfn, converted_wvfn))

def test_8mode_ffft_with_external_swaps_on_single_logical_state(self):
Expand All @@ -546,7 +550,6 @@ def test_8mode_ffft_with_external_swaps_on_single_logical_state(self):
Ph(3 * numpy.pi / 4) | register[0]
eng.flush()
wvfn = ordered_wavefunction(eng)
All(Measure) | register

fermion_operator = prepare_integer_fermion_operator(state_index)

Expand Down Expand Up @@ -574,6 +577,8 @@ def test_8mode_ffft_with_external_swaps_on_single_logical_state(self):
index = sum(2 ** site[0] for site in term)
converted_wvfn[index] = ffft_result.terms[term]

All(Measure) | register

self.assertTrue(numpy.allclose(wvfn, converted_wvfn))

def test_4mode_ffft_with_external_swaps_equal_expectation_values(self):
Expand Down

0 comments on commit 133b5aa

Please sign in to comment.