quri_parts.circuit.clifford_gate module#
- quri_parts.circuit.clifford_gate.is_clifford(gate: QuantumGate, rtol: float = 1e-05, atol: float = 1e-08) bool #
Returns True if the input gate is Clifford, otherwise False. In the case of a rotation gate, whether it is a Clifford gate or not is determined by whether the rotation angle is in the Clifford angle set \(\{\pi n /2| n\in\mathbb{Z}\}\) or not. This can be applied only to the gates in the set CLIFFORD_GATE_NAMES and currently implemented rotation gates: {RX, RY, RZ, U1, U2, U3, PauliRotation}. Since newly defined gates (e.g. U’(a, b) = RZ(2*a)RY(a+2b)) may return the wrong result, in this case this function currently returns a NotImplementedError.
- Parameters:
gate – A gate to be checked whether Clifford or not.
rtol – The relative tolerance parameter determines how close the angle of rotation is to the angle in the Clifford angle set.
atol – The absolute tolerance parameter determines how close the angle of rotation is to the angle in the Clifford angle set.