This PR adds support for handling the control_state of a controlled operation in the qiskit_to_tk and tk_to_qiskit converters. The control state is now handled directly instead of adding X gates on the control qubits.
I've also taken the liberty of refactoring out the "QControlBox building" from the CircuitBuildier.add_qiskit_data method in the same spirit as #382
I've also reworked some internals of how unitary gates are converted to and fro. Handling of controlled unitary boxes was added in #372 . ~I think it'd be fairly easy to add the other direction into this PR too (see #378)~ (I think its best to do this separately).
Description
This PR adds support for handling the
control_state
of a controlled operation in theqiskit_to_tk
andtk_to_qiskit
converters. The control state is now handled directly instead of addingX
gates on the control qubits.I've also taken the liberty of refactoring out the "
QControlBox
building" from theCircuitBuildier.add_qiskit_data
method in the same spirit as #382I've also reworked some internals of how unitary gates are converted to and fro. Handling of controlled unitary boxes was added in #372 . ~I think it'd be fairly easy to add the other direction into this PR too (see #378)~ (I think its best to do this separately).
Original PR adding control state handling with X gates -> https://github.com/CQCL/pytket-qiskit/pull/118
Related issues
378
313
closes #178
Checklist