Skip to content

Commit

Permalink
Adjust tests around extra layer of gates
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Dec 8, 2021
1 parent 05359d2 commit 523150b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/python/circuit/library/test_evolved_op_ansatz.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_evolved_op_ansatz(self):
for string, time in zip(strings, parameters):
reference.compose(evolve(string, time), inplace=True)

self.assertEqual(evo.decompose(), reference)
self.assertEqual(evo.decompose().decompose(), reference)

def test_custom_evolution(self):
"""Test using another evolution than the default (e.g. matrix evolution)."""
Expand Down
4 changes: 2 additions & 2 deletions test/python/circuit/library/test_qaoa_ansatz.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_default_qaoa(self):
circuit = circuit.decompose()
self.assertEqual(1, len(parameters))
self.assertIsInstance(circuit.data[0][0], HGate)
self.assertIsInstance(circuit.data[1][0], RXGate)
self.assertIsInstance(circuit.decompose().data[1][0], RXGate)

def test_custom_initial_state(self):
"""Test circuit with a custom initial state."""
Expand All @@ -47,7 +47,7 @@ def test_custom_initial_state(self):
circuit = circuit.decompose()
self.assertEqual(1, len(parameters))
self.assertIsInstance(circuit.data[0][0], YGate)
self.assertIsInstance(circuit.data[1][0], RXGate)
self.assertIsInstance(circuit.decompose().data[1][0], RXGate)

def test_invalid_reps(self):
"""Test negative reps."""
Expand Down

0 comments on commit 523150b

Please sign in to comment.