U3 to clifford
SquinU3ToClifford
Bases: RewriteRule
flowchart TD
bloqade.squin.rewrite.U3_to_clifford.SquinU3ToClifford[SquinU3ToClifford]
click bloqade.squin.rewrite.U3_to_clifford.SquinU3ToClifford href "" "bloqade.squin.rewrite.U3_to_clifford.SquinU3ToClifford"
Rewrite squin U3 statements to clifford when possible.
decompose_U3_gates
decompose_U3_gates(
node: U3,
) -> list[type[ir.Statement]] | list[None]
Rewrite U3 statements to clifford gates if possible.
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/rewrite/U3_to_clifford.py
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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
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
85 86 87 88 89 90 91 92 93 94 95 96 97 | |
rewrite_U3
rewrite_U3(node: U3) -> 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
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
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
57 58 59 60 61 62 63 64 | |