Skip to content
New issue

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

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

Already on GitHub? # to your account

Replace bit condition “c_if” in bit-string condition “if_test” of "qiskit_convert.py" #366

Closed
yoshi-qc opened this issue Jul 16, 2024 · 5 comments
Assignees
Labels
circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa enhancement New feature or request

Comments

@yoshi-qc
Copy link
Contributor

yoshi-qc commented Jul 16, 2024

In “tk_to_qiskit”, a conditional gate in TKET circuit transpires a conditional gate of qiskit circuit using bit condition “c_if” on L660-L697 of “qiskit_convert.py”.
https://github.com/CQCL/pytket-qiskit/blob/main/pytket/extensions/qiskit/qiskit_convert.py
https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.InstructionSet#c_if
I found that bit-string condition “if_test” is currently supported and recommended in qiskit. Should we edit the lines L660-L697 of “qiskit_convert.py”?
https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.QuantumCircuit#if_test

if optype == OpType.Conditional:

@yoshi-qc yoshi-qc added the circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa label Jul 16, 2024
@yoshi-qc yoshi-qc self-assigned this Jul 19, 2024
@yoshi-qc
Copy link
Contributor Author

yoshi-qc commented Jul 30, 2024

The conditional phase is supported in qiskit circuit.

# conditional phase not supported

For instance,

with qc.if_test((bits[4], 1)):
    qc.append(GlobalPhaseGate(1),[],[])

https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.GlobalPhaseGate

Should we make another issue?

@yoshi-qc yoshi-qc changed the title Replace bit condition “c_if” into bit-string condition “if_test” of "qiskit_convert.py" Replace bit condition “c_if” in bit-string condition “if_test” of "qiskit_convert.py" Aug 7, 2024
@yoshi-qc yoshi-qc added the enhancement New feature or request label Aug 7, 2024
@yoshi-qc yoshi-qc removed their assignment Aug 8, 2024
@cqc-alec
Copy link
Collaborator

@yoshi-qc what is the priority on this? Does it affect functionality?

@yoshi-qc
Copy link
Contributor Author

I discuss this issue with @sjdilkes . He manages this issue now.

@CalMacCQ
Copy link
Contributor

Related to #415

@cqc-alec
Copy link
Collaborator

Closing as duplicate. I've made some of the changes necessary on a branch (see 1929e60 ) but it can't be merged because it causes test failures due to qiskit not having caught up yet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
circuit_conversion Issues and pull requests related to coverting qiskit circuits to pytket and vice versa enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants