-
Notifications
You must be signed in to change notification settings - Fork 12
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
[DRAFT] feat: handle IfElseOp
in qiskit_to_tk
#437
base: main
Are you sure you want to change the base?
Conversation
new_else_qc = QuantumCircuit(default_qreg_else, default_creg_else) | ||
|
||
if_builder = CircuitBuilder(new_if_qc.qregs, new_if_qc.cregs) | ||
if_builder.add_qiskit_data(if_qc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this call to the add_qiskit_data
method is wrong.
The if_qc
QuantumCircuit
gives an empty list upon if_qc.qregs
. Thats why I'm creating circuits with new register names.
Running into trouble when trying to append the data from the if_qc
to the circuit with the named registers (new_if_qc
).
) -> Circuit: | ||
if_box, else_box = _pytket_boxes_from_IfElseOp(if_else_op, qregs, cregs) | ||
circ_builder = CircuitBuilder(qregs, cregs) | ||
circ = circ_builder.circuit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(circ.qubits, circ.bits)
print(if_box.get_circuit().qubits, if_box.get_circuit().bits)
print(qubits)
print(bits)
prints
[q105[0], q105[1]] [c3[0], c3[1]]
[q105[0], q105[1]] [c3[0], c3[1]]
[q105[1]]
[c3[0]]
So the box has 2 qubits and 2 bits, but in add_circbox
, args=qubits + bits
only provides 1 qubit and 1 bit.
Description
NOT WORKING YET
Handling an
IfElseOp
as two conditionalCircBox
es.Related issues
Please mention any github issues addressed by this PR.
Checklist