quri_parts.circuit.clifford_gate module#

is_clifford(gate, rtol=1e-05, atol=1e-08)#

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 (QuantumGate) ā€“ A gate to be checked whether Clifford or not.

  • rtol (float) ā€“ The relative tolerance parameter determines how close the angle of rotation is to the angle in the Clifford angle set.

  • atol (float) ā€“ The absolute tolerance parameter determines how close the angle of rotation is to the angle in the Clifford angle set.

Return type:

bool