Skip to content

Commit

Permalink
Merge branch 'main' into move-equivalence
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss authored Jun 26, 2024
2 parents 6dec921 + 26680dc commit 785564f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,9 @@ def __init__(
def _from_circuit_data(cls, data: CircuitData) -> typing.Self:
"""A private constructor from rust space circuit data."""
out = QuantumCircuit()
out.add_bits(data.qubits)
out.add_bits(data.clbits)
out._data = data
out._qubit_indices = {bit: BitLocations(index, []) for index, bit in enumerate(data.qubits)}
out._clbit_indices = {bit: BitLocations(index, []) for index, bit in enumerate(data.clbits)}
return out

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions test/randomized/test_transpiler_equivalence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 785564f

Please sign in to comment.