|
21 | 21 | from numpy.typing import NDArray
|
22 | 22 |
|
23 | 23 | from qualtran import bloq_example, BloqDocSpec, GateWithRegisters, Signature
|
24 |
| -from qualtran.bloqs.basic_gates import Ry, ZPowGate |
| 24 | +from qualtran.bloqs.basic_gates import GlobalPhase, Ry, ZPowGate |
25 | 25 | from qualtran.cirq_interop.t_complexity_protocol import TComplexity
|
26 | 26 | from qualtran.drawing import TextBox
|
27 | 27 |
|
@@ -123,11 +123,7 @@ def _unitary_(self):
|
123 | 123 | def build_composite_bloq(self, bb: 'BloqBuilder', q: 'SoquetT') -> Dict[str, 'SoquetT']:
|
124 | 124 | pi = sympy.pi if self._is_parameterized_() else np.pi
|
125 | 125 |
|
126 |
| - # global phase of $-e^{i \alpha}$ |
127 |
| - q = bb.add( |
128 |
| - ZPowGate(exponent=2, global_shift=0.5 + self.global_shift / (2 * pi), eps=self.eps / 4), |
129 |
| - q=q, |
130 |
| - ) |
| 126 | + bb.add(GlobalPhase(coefficient=-np.exp(1j * self.global_shift), eps=self.eps / 4)) |
131 | 127 | q = bb.add(ZPowGate(exponent=1 - self.lambd / pi, global_shift=-1, eps=self.eps / 4), q=q)
|
132 | 128 | q = bb.add(Ry(angle=2 * self.theta, eps=self.eps / 4), q=q)
|
133 | 129 | q = bb.add(ZPowGate(exponent=-self.phi / pi, global_shift=-1, eps=self.eps / 4), q=q)
|
|
0 commit comments