From 26680dcecf9457210f46aa6b2f62361a5ccd8d84 Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Wed, 26 Jun 2024 14:45:24 +0200 Subject: [PATCH] adapting test/randomized/test_transpiler_equivalence.py to #12640 (#12663) * addapting to #12640 * more instances --- test/randomized/test_transpiler_equivalence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/randomized/test_transpiler_equivalence.py b/test/randomized/test_transpiler_equivalence.py index 04dced90dfaa..3bd09d89348b 100644 --- a/test/randomized/test_transpiler_equivalence.py +++ b/test/randomized/test_transpiler_equivalence.py @@ -258,9 +258,9 @@ def add_c_if_last_gate(self, carg, data): last_gate = self.qc.data[-1] # Conditional instructions are not supported - assume(isinstance(last_gate[0], Gate)) + assume(isinstance(last_gate.operation, Gate)) - last_gate[0].c_if(creg, val) + last_gate.operation.c_if(creg, val) # Properties to check @@ -269,7 +269,7 @@ def qasm(self): """After each circuit operation, it should be possible to build QASM.""" qasm2.dumps(self.qc) - @precondition(lambda self: any(isinstance(d[0], Measure) for d in self.qc.data)) + @precondition(lambda self: any(isinstance(d.operation, Measure) for d in self.qc.data)) @rule(kwargs=transpiler_conf()) def equivalent_transpile(self, kwargs): """Simulate, transpile and simulate the present circuit. Verify that the