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

rethink unitary synthesis plugin #7986

Open
ajavadia opened this issue Apr 26, 2022 · 1 comment
Open

rethink unitary synthesis plugin #7986

ajavadia opened this issue Apr 26, 2022 · 1 comment

Comments

@ajavadia
Copy link
Member

What should we add?

Currently there is a unitary_synthesis_method argument to transpile() which switches the decomposition method when unitaries are encountered in the circuit.

But I think we need to split 1q vs. 2q vs. generic unitary synthesis. This may lead to too many args. So I'm fine dropping the arg and allowing alternative way to specify desired methods, as I explain below.

But basically 1q and 2q and generic unitary synthesis have been studied separately and they have very different methods.
In qiskit currently:

  • SolovayKitaev (sk) and OneQubitEulerDecomposer (euler) are only 1q.
  • TwoQubitWeylDecomposer (weyl) and XXDecomposer (xx) are only 2q.
  • Isometry1 (ccd) and Shannon (qsd) and ApproximateQuantumCompiler (aqc) are generic.

Generally decompositions of higher-order unitaries use smaller-unitary synthesis methods within them, so setting them separately has the advantage of signaling which method should be internally used when recursing on unitaries during synthesis.

In terms of how the user can select between these, I think there are 3 options (not necessarily mutually exclusive).

  • Simplest would be to just have unitary_synthesis_method_1q and unitary_synthesis_method_2q added to the current list of transpile args. For the generic unitary_synthesis_method I think we should have options ccd and qsd and aqc and remove 'default'.
  • When a unitary is added to a circuit the desired method can be tagged onto it like metadata. This allows the user to specify the intent during programming of the circuit itself and e.g. decompose two unitaries using two different methods. This would be consistent with the pragmas being developed as part of OpenQASM 3.
  • Automatically choose. For example we know aqc is slow but gives better results than the other ones, so it can be used in level 3. Or the basis_gates can dictate the method, for example if the basis is 's', 'h', 't' then only sk makes sense. If the basis is 'zx30', 'zx45', only the xx method makes sense. Other methods cannot target these bases.

Footnotes

  1. we currently refer to this as isometry but really the name should be ccd (column-by-colum decomposition). The isometry paper this is based on has two methods (ccd and csd (cosine-sine decomposition)) and only the first one is implemented in qiskit).

@SamD-1998
Copy link
Contributor

Hi, I'm interested in working on this. Can you assign it to me?

@mtreinish mtreinish modified the milestones: 1.2.0, 1.3 beta Jul 24, 2024
@mtreinish mtreinish modified the milestones: 1.3 beta, 1.3.0 Sep 5, 2024
@raynelfss raynelfss modified the milestones: 1.3.0, 2.0.0 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants