Closed ValentinS4t1qbit closed 1 month ago
Hi, I've submitted a PR to address this, but I'm unsure if I should base on main or develop. What should I do?
Hello @golanor, first of all, thank you! We target the develop
branch for PRs. This should be an easy switch as both main
and develop
are synchronized at the moment.
Thanks! It seems that the branches are not synced right now - develop is 10 commits behind main.
Oh you are right, this happens when a release is made, so there are commits for README
and other files not related to the code. The code itself should be the same, either way I suggest to target develop
.
Closed by @golanor @390
Issue: Feature Request
We recently went to a hackathon, and participants wanted to solve a challenge using a circuit with multi-controlled Ry gates. They wanted to translate the Tangelo circuit to Qiskit to simulate a fake IBM device or transpile to IBM native gate set, but got a
NotImplemented
error from Tangelo.Indeed, we had written that function before Qiskit implemented multi-controlled gates, but Qiskit later supported them: here's the
mcry
gate https://docs.quantum.ibm.com/api/qiskit/0.43/qiskit.circuit.QuantumCircuit#mcry.Can you modify https://github.com/ValentinS4t1qbit/Tangelo/blob/main/tangelo/linq/translator/translate_qiskit.py so that multi-controlled gates (CRX, CRY, CRZ) are supported in the translation from Tangelo to Qiskit and remove the error message ? (e.g, a list on integers can be passed for control qubits).
It may be that the
crx
,cry
andcrz
gates in Qiskit can simply be seen asmcrx
,mcry
andmcrz
with only one control qubit, which may help us resolve things elegantly with very little changes.Test
Making this snippet work for CRY is a good starting point:
You should see that Qiskit parses that gate into this:
To solve this issue:
mcr*
gate.