CQCL / pytket-qiskit

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

feat: Improved handling of controlled gates in converters #391

Closed CalMacCQ closed 2 months ago

CalMacCQ commented 2 months ago

Description

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).

Original PR adding control state handling with X gates -> https://github.com/CQCL/pytket-qiskit/pull/118

Related issues

378

313

closes #178

Checklist