CQCL / pytket-qiskit

pytket-qiskit, extensions for pytket quantum SDK
Apache License 2.0
15 stars 13 forks source link

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

Open yoshi-qc opened 2 months ago

yoshi-qc commented 2 months ago

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

https://github.com/CQCL/pytket-qiskit/blob/94174692d5135a3fd9b55b9a3b99ec53ad342942/pytket/extensions/qiskit/qiskit_convert.py#L660

yoshi-qc commented 1 month ago

The conditional phase is supported in qiskit circuit. https://github.com/CQCL/pytket-qiskit/blob/d5b00fc96d2355c433b8885cce04d92310111266/pytket/extensions/qiskit/qiskit_convert.py#L662 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?

cqc-alec commented 1 month ago

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

yoshi-qc commented 1 month ago

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