Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qiskit_to_tk incorrectly converts multi-controlled gates #117

Closed
yao-cqc opened this issue Jun 13, 2023 · 2 comments · Fixed by #118
Closed

qiskit_to_tk incorrectly converts multi-controlled gates #117

yao-cqc opened this issue Jun 13, 2023 · 2 comments · Fixed by #118
Labels
bug Something isn't working circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa

Comments

@yao-cqc
Copy link
Contributor

yao-cqc commented Jun 13, 2023

This following "00" controlled X gate is incorrectly translated to CCX.

from pytket import Circuit
from pytket.extensions.qiskit import qiskit_to_tk
from qiskit import QuantumCircuit
c = QuantumCircuit(3)
# last arg: activated by state "0"
c.ccx(0,1,2,0)
tk_circ = qiskit_to_tk(c)
print(tk_circ.__repr__())
# [CCX q[0], q[1], q[2]; ]
@yao-cqc yao-cqc added the bug Something isn't working label Jun 13, 2023
@CalMacCQ
Copy link
Contributor

CalMacCQ commented Jun 13, 2023

Oh dear, this could be due to a change I made in #50

Edit: I don't think this is caused by my PR. None of the changes made concerned passing custom control states to qiskit instructions.

Can we handle gates with custom control states easily?

@yao-cqc
Copy link
Contributor Author

yao-cqc commented Jun 13, 2023

Oh dear, this could be due to a change I made in #50

Can we handle gates with custom control states easily?

I think the easiest way at the moment is to add X gates during the conversion.

@CalMacCQ CalMacCQ added the circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants