mimiqcircuits.decomposition.rules.zyz¶
ZYZ Euler angle decomposition rewrite rule.
Classes
Rewrite rule for ZYZ Euler angle decomposition. |
- class mimiqcircuits.decomposition.rules.zyz.ZYZRewrite[source]¶
Bases:
RewriteRuleRewrite rule for ZYZ Euler angle decomposition.
Decomposes single-qubit unitaries into the ZYZ Euler angle form:
RZ(phi) * RY(theta) * RZ(lambda)This is a standard decomposition for arbitrary single-qubit gates, producing only Z and Y rotations (plus a global phase for GateU).
- Supported operations:
GateU(theta, phi, lambda, gamma)->RZ(lambda) * RY(theta) * RZ(phi) * Phase(gamma)GateRX(theta)->S * RY(theta) * Sdg
Identity rotations (angle = 0) are omitted from the output.
Example
>>> from mimiqcircuits import GateU >>> from mimiqcircuits.decomposition import ZYZRewrite >>> from symengine import pi >>> rule = ZYZRewrite() >>> circ = rule.decompose_step(GateU(pi/2, pi/4, pi/3), [0], [], [])
- matches(op)[source]¶
Check if this rule can decompose the operation.
Matches GateU (unless it’s identity) and GateRX.
- decompose_step(op, qubits, bits, zvars)[source]¶
Apply ZYZ decomposition to the operation.
- Parameters:
- Returns:
A Circuit containing the decomposed instructions.
- Raises:
DecompositionError – If the operation is not supported.
- Return type: