Open kdk opened 1 year ago
See more details here: https://github.com/Qiskit/qiskit-terra/pull/9475#issuecomment-1431014041
It would be also good to directly create Cliffords
from LinearFunctions
or from quantum circuits containing LinearFunctions
. We can actually create Cliffords from linear functions already, however this requires first building the the definition
of a linear function and then constructing Clifford out of that, while the much simpler direct method is also possible (if the linear function has matrix A
, then the Clifford's stabilizer tableau will be something like [A^T, 0; 0, A]
).
Additionally, it would be nice to create Cliffords
from new PermutationGates
(and because PermutationGates
do not have definitions, we currently are not able to do it at all).
The main question is whether Clifford.from_operation
is needed or is it enough to use the existing Clifford.from_circuit
, where the circuit could contain any Operations that are Clifford (including: LinearFunction, Permutation, Rz(pi)
etc.)
See the discussion in #9582
From https://github.com/Qiskit/qiskit-terra/pull/9475:
@ShellyGarion 's comment is hinting that another thing that would be nice to have is something like
Clifford.from_operation
or similar, that could rely on methods that might be quicker than generating and checking the unitary matrix representation.For example, checking if the
name
is in the list of hard coded names in_BASIS_1Q
/_BASIS_2Q
to know if anInstruction
is Clifford, or utilizing the equivalence library to see if aGate
has an all Clifford decomposition, or for cases like the parameterized rotations where there may be a simple arithmetic check on theparams
to know if it is Clifford.Additionally, the same methods could be available to know quickly if an unknown operation
is_clifford
.Opening this issue to discuss how and where we can include such checks for
Clifford
, and for the otherOperation
subclasses more generally.