Closed ajavadia closed 5 months ago
I can help with handling this issue - could you please assign me to it?
A few questions:
Where should we put all the synthesis algorithms? Should they all be in qiskit.quantum_info.synthesis
? or in another place?
Should we just move all the functions in qiskit.extensions.quantum_initializer
to the synthesis folder?
Here is a list of the relevant synthesis algorithms - are there some more?
In qiskit.quantum_info.synthesis
:
clifford_decompose.py
ion_decompose.py
local_invariance.py
one_qubit_decompose.py
#5554quaternion.py
two_qubit_decompose.py
weyl.py
cnotdihedral_decompose.py
#5442In qiskit.extensions.quantum_initializer
:
diagonal.py
isometry.py
mcg_up_to_diagonal.py
squ.py
uc.py
uc_pauli_rot.py
ucrx.py
ucry.py
ucrz.py
In qiskit.transpiler.synthesis
:
graysynth.py
(include the functions graysynth
and cnot_synth
)I think if they're general synthesis (where they go from a quantum_info
object or a matrix) to a circuit they should live in qiskit.quantum_info.synthesis
. Ideally I feel like the qiskit.extensions
module really should be deprecated and we move things from there either to circuits or the circuit library (like the gate classes) and/or quantum_info.
What about qiskit.transpiler.synthesis
? currently it has only graysynth.py
. what should be there?
Where should we put all the synthesis algorithms? Should they all be in qiskit.quantum_info.synthesis ? or in another place?
I think we can make a separate qiskit.synthesis
directory that can contain everything currently under qiskit.quantum_info.synthesis
and qiskit.transpiler.synthesis
and qiskit.extensions
. This would contain all synthesis algorithms which the compiler can use. Some will be from quantum_info objects, and some will not.
Should we just move all the functions in qiskit.extensions.quantum_initializer to the synthesis folder?
Yeah. As Matthew says the extensions folder should be deprecated and removed.
Here is a list of the relevant synthesis algorithms - are there some more?
patel-hayes-markov algorithm is missing from your list (for synthesizing CNOT-only circuits from linear functions)
we have 2 state preparation algorithms in Qiskit, one is the one in qiskit.extensions
and the other is a special case of isometry (I believe the latter one is used by default when we do circuit.initialize
). Can we link these to the synthesis of the qiskit Statevector object (with a to_circuit()
method)?
different algorithms for synthesizing multi-controlled gates could go here as well. @Cryoris and I talked about this. In line with the rest of the synthesis methods, I'd like to separate the description of an object from its implementation. A multi-controlled Toffoli is a well-defined object that we should be able to insert into the circuit as is (e.g. using x.control(4)
. How it is implemented in terms of more primitive gates should be the domain of the synthesizer and there are many different methods.
There is a lot here, and there are other open issues on synthesis too (https://github.com/Qiskit/qiskit-terra/issues/4687, https://github.com/Qiskit/qiskit-terra/issues/6038). @ShellyGarion can you please make an Epic from them? The good thing is there are many good synthesis algorithms already implemented in Qiskit, but user interface and compiler interface need work.
TODO: List of items related to synthesis:
qiskit.synthesis
directory that contain everything currently under qiskit.quantum_info.synthesis
and qiskit.transpiler.synthesis
and qiskit.extensions
#4699 Statevector
object.Other relevant issues:
Are we still planning to fix this for 0.20?
We need a general category of synthesis algorithms for things that have exponential descriptions. This basically means things defined by Operator or Statevector. A start of this is under
qiskit.quantum_info.synthesis
, but a bunch of the algorithms are scattered underqiskit.extensions.quantum_initializer
.Then I think instead of defining these operators as circuit libraries (they are really not), we just have a way to insert operators into circuits, and rely on these synthesis algorithms to give us the corresponding decomposition. This would include:
Diagonal
,Statevector
,Unitary
,Clifford
,Isometry
, etc.