U3 to clifford
SquinU3ToClifford
Bases: RewriteRule
Rewrite squin U3 statements to clifford when possible.
decompose_U3_gates
decompose_U3_gates(
node: U3,
) -> Tuple[List[ir.Statement], ...]
Rewrite U3 statements to clifford gates if possible.
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/rewrite/U3_to_clifford.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
resolve_angle
resolve_angle(angle: float) -> int | None
Normalize the angle to be in the range [0, 2π).
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/rewrite/U3_to_clifford.py
76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
rewrite_ApplyOrBroadcast_onU3
rewrite_ApplyOrBroadcast_onU3(
node: Apply | Broadcast,
) -> RewriteResult
Rewrite Apply and Broadcast nodes to their clifford equivalent statements.
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/rewrite/U3_to_clifford.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
equivalent_u3_para
equivalent_u3_para(
theta_half_pi: int, phi_half_pi: int, lam_half_pi: int
) -> tuple[int, int, int]
- Assume all three angles are in the range [0, 4].
- U3(theta, phi, lam) = -U3(2pi-theta, phi+pi, lam+pi).
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/rewrite/U3_to_clifford.py
48 49 50 51 52 53 54 55 |
|