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

Organize the synthesis library of multi-controlled gates #12863

Open
3 of 5 tasks
ShellyGarion opened this issue Jul 31, 2024 · 3 comments
Open
3 of 5 tasks

Organize the synthesis library of multi-controlled gates #12863

ShellyGarion opened this issue Jul 31, 2024 · 3 comments
Assignees
Labels
mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library synthesis type: feature request New feature or request
Milestone

Comments

@ShellyGarion
Copy link
Member

ShellyGarion commented Jul 31, 2024

What should we add?

Currently the synthesis methods of the multi-controlled gates are part of their definition.
We would like to have a single MCXGate() class, and an HLS plugin that checks the number of clean or dirty ancillas, and chooses the optimal synthesis method (see #12729).

The synthesis library will therefore include a new section Multi-controlled gates synthesis which will include the following functions:

  • synth_mcx_no_ancillas - the current definition of the MCXGate
  • synth_mcx_one_clean_ancilla - the current definition of the MCXRecursiveGate
  • synth_mcx_n_dirty_ancillas - the current definition of the MCVChainGate
  • synth_mcx_graysynth_no_ancillas - the current definition of the MCXGrayCode (and the internal MCU1Gate). Note that the number of CX gates grows exponentially in the number of qubits.
  • synth_mcp_no_ancillas - the current definition if the MCPhaseGate
  • synth_mcp_graysynth_no_ancillas - the current definition of the MCXGrayCode (and the internal MCU1Gate). Only for parametrized gates. Note that the number of CX gates grows exponentially in the number of qubits.
  • synth_mcmt_no_ancillas - the current definition of the MCMTGate
  • synth_mcmt_n_clean_ancillas - the current definition of the MCMTVChainGate
  • synth_mcrx_no_ancillas - the current synthesis of the mcrx method
  • synth_mcry_no_ancillas - the current synthesis of the mcrx method
  • synth_mcrz_no_ancillas - the current synthesis of the mcrz method

The following classes will be deprecated in Qiskit 2.0:

The following classes will remain in the circuit library (including synthesis methods with ancillas when applicable):

Question:
Should we add the gates MCRX, MCRY and MCRZ to the circuit library?
See the discussion in #12048

Tasks

  1. Changelog: New Feature synthesis
  2. Changelog: New Feature mod: transpiler synthesis
  3. Changelog: New Feature Rust mod: circuit
  4. good first issue synthesis
    Cryoris
  5. Changelog: Bugfix mod: circuit synthesis
@ShellyGarion ShellyGarion added type: feature request New feature or request synthesis mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jul 31, 2024
@ShellyGarion ShellyGarion added this to the 1.3.0 milestone Jul 31, 2024
@ShellyGarion ShellyGarion self-assigned this Jul 31, 2024
@Cryoris
Copy link
Contributor

Cryoris commented Jul 31, 2024

Regarding naming: Since there could be multiple methods that use no ancillas, would it make sense to use unique names for the methods, like in e.g. the linear function synthesis?

Regarding MCRX/Y/Z classes: I'd say no, since that opens the door to having a class for each multi-controlled gate. Instead I think we should just have AnnotatedOperations that the high-level synthesis calls the correct synthesis function for.

@ShellyGarion
Copy link
Member Author

Since there could be multiple methods that use no ancillas, would it make sense to use unique names for the methods, like in e.g. the linear function synthesis?

Yes. we could add the initials of the author names to the synthesis methods (also relevant for methods that use ancillas)

@ShellyGarion
Copy link
Member Author

ShellyGarion commented Jul 31, 2024

Regarding the mcrx, mcry and mcrz methods (copying the relevant paragraph of #12048):

  1. The angles should be of type ParameterValueType (not only float).
  2. Add ctrl_state parameter (like in MCXGate or mcx method).
  3. The control method of the rx, ry and rz gates, should call the relevant synthesis methods of mcrx, mcry and mcrz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library synthesis type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants