diff --git a/circuit_knitting/cutting/wire_cutting_transforms.py b/circuit_knitting/cutting/wire_cutting_transforms.py index 31fb841af..22e094210 100644 --- a/circuit_knitting/cutting/wire_cutting_transforms.py +++ b/circuit_knitting/cutting/wire_cutting_transforms.py @@ -76,7 +76,7 @@ def _transform_cut_wires( mapping[gate_index[0]] += 1 else: new_circuit.compose( - other=instructions[0], + other=instructions.operation, qubits=[mapping[index] for index in gate_index], inplace=True, ) diff --git a/test/utils/test_transforms.py b/test/utils/test_transforms.py index 2ea178a92..181a7b27f 100644 --- a/test/utils/test_transforms.py +++ b/test/utils/test_transforms.py @@ -37,7 +37,7 @@ def prepare_hwea(): # Exchange CNOTs with gates we support for i, gate in enumerate(circuit.data): - if len(gate[1]) == 2: + if len(gate.qubits) == 2: q1 = circuit.find_bit(gate.qubits[0])[0] q2 = circuit.find_bit(gate.qubits[1])[0] circuit.data[i] = CircuitInstruction(RZZGate(np.pi / 4), qubits=[q1, q2])