mimiqcircuits.decomposition.rules.to_z_rotation¶
Rewrite rule for converting X and Y rotations to Z rotations.
Classes
Rewrite rule that converts RX and RY rotations to RZ + Clifford gates. |
- class mimiqcircuits.decomposition.rules.to_z_rotation.ToZRotationRewrite[source]¶
Bases:
RewriteRuleRewrite rule that converts RX and RY rotations to RZ + Clifford gates.
This is useful for gate sets where only Z-rotations are available as the parametric rotation (e.g., some hardware native gate sets).
- Transformations:
RX(theta)->H * RZ(theta) * HRY(theta)->Sdg * H * RZ(theta) * H * S
Example
>>> from mimiqcircuits import GateRX, GateRY >>> from mimiqcircuits.decomposition import ToZRotationRewrite >>> from symengine import pi >>> rule = ToZRotationRewrite() >>> circ = rule.decompose_step(GateRX(pi/3), [0], [], [])
- decompose_step(op, qubits, bits, zvars)[source]¶
Convert RX or RY to RZ + Clifford gates.
- Parameters:
- Returns:
A Circuit containing the decomposed instructions.
- Raises:
DecompositionError – If the operation is not supported.
- Return type: