pprop.gates.rotation module

This submodule defines RotationGate, the base class for single-qubit parametrised Pauli rotation gates, and the concrete gates RX, RY, and RZ.

class pprop.gates.rotation.RX(wires, parameter)[source]

Bases: RotationGate

The single-qubit parametrised X rotation gate.

\[R_x(\phi) = e^{-i\phi\,\sigma_x/2}\]

Heisenberg evolution rules:

\[Y \mapsto -\sin(\phi)\,Z + \cos(\phi)\,Y, \quad Z \mapsto +\sin(\phi)\,Y + \cos(\phi)\,Z, \quad X \mapsto X\]
Parameters:
  • wires (list[int]) – Qubit on which the gate acts.

  • parameter (int) – Index of \(\phi\) in the global parameter vector.

class pprop.gates.rotation.RY(wires, parameter)[source]

Bases: RotationGate

The single-qubit parametrised Y rotation gate.

\[R_y(\phi) = e^{-i\phi\,\sigma_y/2}\]

Heisenberg evolution rules:

\[X \mapsto +\sin(\phi)\,Z + \cos(\phi)\,X, \quad Z \mapsto -\sin(\phi)\,X + \cos(\phi)\,Z, \quad Y \mapsto Y\]
Parameters:
  • wires (list[int]) – Qubit on which the gate acts.

  • parameter (int) – Index of \(\phi\) in the global parameter vector.

class pprop.gates.rotation.RZ(wires, parameter)[source]

Bases: RotationGate

The single-qubit parametrised Z rotation gate.

\[R_z(\phi) = e^{-i\phi\,\sigma_z/2}\]

Heisenberg evolution rules:

\[X \mapsto -\sin(\phi)\,Y + \cos(\phi)\,X, \quad Y \mapsto +\sin(\phi)\,X + \cos(\phi)\,Y, \quad Z \mapsto Z\]
Parameters:
  • wires (list[int]) – Qubit on which the gate acts.

  • parameter (int) – Index of \(\phi\) in the global parameter vector.

class pprop.gates.rotation.RotationGate(wires, qml_gate, parameter, rule)[source]

Bases: Gate

Base class for single-qubit parametrised Pauli rotation gates.

A rotation gate \(R_P(\theta) = e^{-i\theta P/2}\) conjugates a Pauli word \(Q\) according to:

\[\begin{split}R_P^\dagger\, Q\, R_P = \begin{cases} Q & \text{if } [Q, P] = 0 \\ \cos(\theta)\, Q + \sigma \sin(\theta)\, Q' & \text{if } \{Q, P\} = 0 \end{cases}\end{split}\]

where \(Q'\) is the Pauli obtained by applying the gate rule and \(\sigma \in \{+1, -1\}\) is the sign given by the commutation relation. The trigonometric factors are encoded by appending the parameter index to the cos_idx or sin_idx lists of each CoeffTerm.

Parameters:
  • wires (list[int]) – Qubit on which the gate acts.

  • qml_gate (pennylane.operation.Operator) – Corresponding PennyLane gate class, used for circuit drawing.

  • parameter (float, int) – Index of \(\theta\) in the global parameter vector if int. Actual value of the rotation if float.

  • rule (EvolutionRule) – Dict mapping a single-qubit Pauli label ("X", "Y", or "Z") to a (output_label, sign) tuple for Paulis that anti-commute with the rotation axis. Labels absent from the dict commute and pass through unchanged.

rule

The Heisenberg evolution rule for this gate.

Type:

EvolutionRule

evolve(word, k1, k2)[source]

Heisenberg-evolve a Pauli word through this rotation gate.

For a Pauli \(Q\) that anti-commutes with the rotation axis, the evolution produces two branches:

\[Q \;\mapsto\; \cos(\theta)\, Q \;+\; \sigma\sin(\theta)\, Q'\]

Each branch is implemented by appending the gate’s parameter to the cos_idx (cosine branch, same Pauli) or sin_idx (sine branch, new Pauli) of every existing CoeffTerm.

If the frequency cutoff k2 is set and any term already has frequency \(\geq k2\), the word is discarded entirely (returning an empty PauliDict) since appending one more trig factor would exceed the cutoff.

Parameters:
  • word (tuple[PauliOp, CoeffTerms]) – (pauliop, coeff_terms) pair to evolve.

  • k1 (int or None) – Pauli weight cutoff (unused, rotation gates do not change weight).

  • k2 (int or None) – Frequency cutoff. Terms at or above this frequency are discarded.

Returns:

Empty if truncated by k2; one entry if the word commutes with the gate; two entries (cos and sin branches) otherwise.

Return type:

PauliDict