Skip to content
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

support more multi-controlled gates in converters #49

Closed
wants to merge 6 commits into from

Conversation

CalMacCQ
Copy link
Contributor

@CalMacCQ CalMacCQ commented Dec 23, 2022

I'm adding support for general multi-controlled gates in the qiskit converters.

Note that the diff here is a bit inflated by my VScode plugin reordering the imports (forgot to disable this) hopefully it doesn't upset mypy/pylint. Let me know if I should make a fresh PR.

Changes

  1. Fixed handling of CnRy gates. These used to be supported but after Conversion rebase #10 these were decomposed by the rebase prior to conversion. Adding the CnRy gate to the target gateset should take care of this.
  2. Added support for CnY and CnZ gates. I previously thought this would be annoying to add Add CnY and CnZ gates to converters #11 - turns out its easy.
  3. Support other controlled gates using QControlBox Add support for general controlled gates in converters #28

Also...
4. (A suggestion) - We frequently use conditions like if type(i) == ControlledGate rather a lot. Shouldn't we be using if isinstance(i, ControlledGate) ? https://switowski.com/blog/type-vs-isinstance/

@CalMacCQ CalMacCQ marked this pull request as draft December 23, 2022 12:52
@CalMacCQ CalMacCQ closed this Dec 23, 2022
@CalMacCQ CalMacCQ deleted the feature/support_more_controlled_gates branch May 31, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant