pprop.gates.simpleclifford module¶
This submodule defines SimpleClifford, the base class for single-qubit
Clifford gates, and the concrete gates H and S.
- class pprop.gates.simpleclifford.H(wires, parameter=None)[source]¶
Bases:
SimpleCliffordThe single-qubit Hadamard gate.
\[\begin{split}H = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1\\ 1 & -1\end{bmatrix}\end{split}\]Heisenberg evolution rules:
\[X \mapsto Z, \quad Y \mapsto -Y, \quad Z \mapsto X\]- Parameters:
wires (list[int]) – Qubit on which the gate acts.
parameter (float, int, optional) – Unused. Defaults to
None.
- class pprop.gates.simpleclifford.S(wires, parameter=None)[source]¶
Bases:
SimpleCliffordThe single-qubit phase gate.
\[\begin{split}S = \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix}\end{split}\]Heisenberg evolution rules:
\[X \mapsto -Y, \quad Y \mapsto X, \quad Z \mapsto Z\]- Parameters:
wires (list[int]) – Qubit on which the gate acts.
parameter (float, int, optional) – Unused. Defaults to
None.
- class pprop.gates.simpleclifford.SimpleClifford(wires, qml_gate, parameter, rule)[source]¶
Bases:
GateBase class for single-qubit non-parametrised Clifford gates.
Clifford gates map every Pauli word to exactly one Pauli word, possibly with a sign flip. This is captured by a
ruledict that maps each single-qubit Pauli label to an(output_label, sign)pair. Labels absent from the dict commute with the gate and pass through unchanged.- Parameters:
wires (list[int]) – Qubit on which the gate acts.
qml_gate (pennylane.operation.Operator) – Corresponding PennyLane gate class, used for circuit drawing.
parameter (int or None) – Clifford gates are non-parametrised, so this is always
None.rule (EvolutionRule) – Dict mapping a single-qubit Pauli label (
"X","Y", or"Z") to a(output_label, sign)tuple wheresignis+1or-1.
- rule¶
The Heisenberg evolution rule for this gate.
- Type:
EvolutionRule
- evolve(word, k1, k2)[source]¶
Heisenberg-evolve a Pauli word through this Clifford gate.
Looks up the single-qubit Pauli at the gate’s wire in
self.rule. If no rule exists the word commutes with the gate and is returned unchanged. Otherwise the qubit at that wire is replaced with the output label and all scalar coefficients are multiplied by the sign.- Parameters:
word (tuple[PauliOp, CoeffTerms]) –
(pauliop, coeff_terms)pair to evolve.k1 (int or None) – Pauli weight cutoff (unused, Clifford gates do not change weight).
k2 (int or None) – Frequency cutoff (unused, Clifford gates do not change frequency).
- Returns:
A
PauliDictwith exactly one entry.- Return type: