You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In qBraid/tests/circuits/test_circuit.py run test_qiskit_to_all() on line 392. On line 118 we create a qiskit swap gate, and on line 128 we create a qiskit measurement gate. Transpiling each of these gates to a cirq gates fails with Value Error: wrong number of qubits. The measurement gate transpilation is handled differently than other non-parameterized gates, but the swap implementation should work similarly to CX and other non-parameterized two-qubit gates. Running test_braket_to_all() on line 382 for the case of transpiling a braket swap gate to cirq also produces the same error.
The text was updated successfully, but these errors were encountered:
@erikweis Just fixed the swap bug. Internally, cirq SWAP was actually SwapPowGate, so just needed to account for the exponent in cirq/utils and that fixed the problem. Measurement gate bug still "To Do"
I think I remember what happened here. I realized that the measurement gate for Cirq was going to require a separate measurement gate for each qubit (unlike qiskit, I think). Setting up the transpiler to handle iterables or lists (in addition to the single object), for example an instruction could be a single gate, or a list of gates, opened up a new can of worms, and I wanted to punt it.
What I've done is, rather than return a single instruction, I return a list of measurement instructions. I didn't expect this to work out of the box, but it did. So this issue is closed for now, but we will want to handle this kind of thing (where one gate in one package is several in another) more robustly down the road. @ryanhill1
In
qBraid/tests/circuits/test_circuit.py
runtest_qiskit_to_all()
on line 392. On line 118 we create a qiskit swap gate, and on line 128 we create a qiskit measurement gate. Transpiling each of these gates to a cirq gates fails withValue Error: wrong number of qubits
. The measurement gate transpilation is handled differently than other non-parameterized gates, but the swap implementation should work similarly to CX and other non-parameterized two-qubit gates. Runningtest_braket_to_all()
on line 382 for the case of transpiling a braket swap gate to cirq also produces the same error.The text was updated successfully, but these errors were encountered: