Skip to content

Commit 735e3e3

Browse files
make submodules in rotation_synthesis/ private to improve doc view (#1776)
For now this is just a minimial change that renames of the files while exporting essential methods/variables at __init__.py files with minimal changes to the the import statements. overtime import statments such as `import xx._yy` should be `import xx` unless it is happening within the `xx` directory
1 parent 8a0138f commit 735e3e3

41 files changed

Lines changed: 326 additions & 313 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

qualtran/rotation_synthesis/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@ The examples assume the following lines have been executed.
1111
```py3
1212
>>> import mpmath
1313
>>> import qualtran.rotation_synthesis as rs
14-
>>> from qualtran.rotation_synthesis import math_config as mc
15-
>>> from qualtran.rotation_synthesis.protocols import clifford_t_synthesis as cts
1614
>>> # 300 digits of precision is enough for eps as low as 10^-30.
1715
>>> # for big enough eps (>= 10^-10) prefer dps ~100 to reduce the runtime
1816
>>> # A high dps increases the runtime but a low dps risks missing solutions.
19-
>>> config = mc.with_dps(300)
17+
>>> config = rs.with_dps(300)
2018
>>> theta = 0.1 # theta = 0.1 rad
2119
>>> eps = mpmath.mpf(1e-8) # epsilon = 1e-8
2220
```
2321

2422
### Diagonal Protocol
2523

2624
```py3
27-
>>> diagonal = cts.diagonal_unitary_approx(theta=theta, eps=eps, max_n=400, config=config)
25+
>>> diagonal = rs.diagonal_unitary_approx(theta=theta, eps=eps, max_n=400, config=config)
2826
>>> diagonal
2927
Unitary(p=ZW(coords=(1509861905169903736208, 1174754259083368969221, 151491500481353346337, -960512924518388809952)), q=ZW(coords=(-4263827284335, -6564144819191, -5019275344346, -534182446068)), n=80, twirl=False)
3028

@@ -55,7 +53,7 @@ https://algassert.com/quirk#circuit={"cols":[["Z^½"],["X^¼"],["Z^-¼"],["X^¼"
5553
### Fallback (a.k.a Repeat-Until-Success (RUS)) Protocol
5654

5755
```py3
58-
>>> fallback = cts.fallback_protocol(theta, eps, success_probability=0.99, max_n=200, config=config)
56+
>>> fallback = rs.fallback_protocol(theta, eps, success_probability=0.99, max_n=200, config=config)
5957
>>> fallback
6058
ProjectiveChannel(rotation=Unitary(p=ZW(coords=(239242444, 186143567, 24004313, -152196342)), q=ZW(coords=(11711997, 17295059, 12746910, 731794)), n=32, twirl=False), correction=Unitary(p=ZW(coords=(113393374677276065, 8759190556798315, -101006008596441546, -151603257795059376)), q=ZW(coords=(-13979001969, 2234592382, 17139192822, 22003886555)), n=65, twirl=False))
6159

@@ -90,7 +88,7 @@ m: ═════════════════════════
9088
### Mixed Diagonal Protocol
9189

9290
```py3
93-
>>> mixed_diagonal = cts.mixed_diagonal_protocol(theta, eps, max_n=300, config=config)
91+
>>> mixed_diagonal = rs.mixed_diagonal_protocol(theta, eps, max_n=300, config=config)
9492
>>> mixed_diagonal
9593
ProbabilisticChannel(c1=Unitary(p=ZW(coords=(111279824866, 86577736003, 11159583589, -70795701541)), q=ZW(coords=(2905774, -827421, -4075924, -4936806)), n=42, twirl=True), c2=Unitary(p=ZW(coords=(32592863748, 25359568315, 3270981699, -20733701634)), q=ZW(coords=(-261947, -1668702, -2097954, -1298253)), n=40, twirl=True), probability=mpf('0.322751359448635267114326370859256829689458745026081702686971426030895682599474514910816660886778364762073662905955339813205441513151138367919667045726178096784779764992341606213189667302147688085007915854895131323239141860542004025041462985374870176351764143883625569021092174011359447964257700140487645'))
9694

@@ -106,7 +104,7 @@ expected number of T gates is 40.646
106104

107105

108106
```py3
109-
>>> mixed_fallback = cts.mixed_fallback_protocol(theta, eps, success_probability=0.99, max_n=300, config=config)
107+
>>> mixed_fallback = rs.mixed_fallback_protocol(theta, eps, success_probability=0.99, max_n=300, config=config)
110108
>>> mixed_fallback
111109
ProbabilisticChannel(c1=ProjectiveChannel(rotation=Unitary(p=ZW(coords=(81907, 63728, 8218, -52106)), q=ZW(coords=(-1154, 985, 2547, 2617)), n=19, twirl=False), correction=ProbabilisticChannel(c1=Unitary(p=ZW(coords=(-263391098, -737624638, -779767669, -365133375)), q=ZW(coords=(-33461, 136222, 226108, 183543)), n=34, twirl=True), c2=Unitary(p=ZW(coords=(-77065381, -216007734, -228415686, -107020827)), q=ZW(coords=(-69300, -100383, -72663, -2378)), n=32, twirl=True), probability=mpf('0.045325686665484547940062502757622971144169613023747430900082177527088724087189898382813946924494697326621166855704833076057576200695347588135413318392991377437019817846667142336189311546588693427566709307270541970137781795585088761789630584519324449933375058208979540812676838676732065743027397323424595'))), c2=ProjectiveChannel(rotation=Unitary(p=ZW(coords=(23978, 18657, 2407, -15253)), q=ZW(coords=(-956, -1084, -577, 268)), n=17, twirl=False), correction=ProbabilisticChannel(c1=Unitary(p=ZW(coords=(-1373879826, -510348019, 652138736, 1432611464)), q=ZW(coords=(-189284, 278185, 582697, 545873)), n=35, twirl=True), c2=Unitary(p=ZW(coords=(-402460569, -149610333, 190879607, 419554862)), q=ZW(coords=(-69300, -31083, 25342, 66922)), n=33, twirl=True), probability=mpf('0.525040802635724724816097410427482676809933478764171151369355514657076375140052487037506999832799609679457396659076441254494844846449599140703045579066152308112059014940560931326583883941250186082725677082913867579961221230890451563733787938393583123811396292716244823945079739397111073899481930671270029'))), probability=mpf('0.972077582319464271880109129184631244429176680508313282994368258672700642062726782223015417086951750128434612291521852730028085519115453255242801194500490513953599832009476998145136699780645059022125864590137472901641917927185402638252104301881958927225784570356720997394377273869421589887668348541958305'))
112110

qualtran/rotation_synthesis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from qualtran.rotation_synthesis.math_config import NumpyConfig, with_dps
15+
from qualtran.rotation_synthesis._math_config import NumpyConfig, with_dps
1616
from qualtran.rotation_synthesis.matrix import to_cirq, to_quirk, to_sequence
1717
from qualtran.rotation_synthesis.protocols import (
1818
diagonal_unitary_approx,
File renamed without changes.

qualtran/rotation_synthesis/channels/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from qualtran.rotation_synthesis.channels.channel import (
15+
from qualtran.rotation_synthesis.channels._channel import (
1616
Channel,
1717
ProbabilisticChannel,
1818
ProjectiveChannel,

qualtran/rotation_synthesis/channels/channel.py renamed to qualtran/rotation_synthesis/channels/_channel.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
import cirq
2222
import numpy as np
2323

24+
import qualtran.rotation_synthesis._math_config as mc
2425
import qualtran.rotation_synthesis._typing as rst
25-
import qualtran.rotation_synthesis.math_config as mc
26-
import qualtran.rotation_synthesis.matrix.clifford_t_repr as ctr
26+
import qualtran.rotation_synthesis.matrix._clifford_t_repr as ctr
2727
import qualtran.rotation_synthesis.rings as rings
28-
from qualtran.rotation_synthesis.matrix import su2_ct
29-
from qualtran.rotation_synthesis.rings import zsqrt2
28+
from qualtran.rotation_synthesis.matrix import _su2_ct
29+
from qualtran.rotation_synthesis.rings import _zsqrt2
3030

3131

3232
class Channel(abc.ABC):
@@ -74,8 +74,8 @@ class UnitaryChannel(Channel):
7474
n: int = attrs.field(validator=attrs.validators.instance_of(int))
7575
twirl: bool = False
7676

77-
def to_matrix(self) -> su2_ct.SU2CliffordT:
78-
return su2_ct.SU2CliffordT.from_pair(self.p, self.q, pick_phase=True)
77+
def to_matrix(self) -> _su2_ct.SU2CliffordT:
78+
return _su2_ct.SU2CliffordT.from_pair(self.p, self.q, pick_phase=True)
7979

8080
def expected_num_ts(self, config: Optional[mc.MathConfig] = None) -> rst.Real:
8181
return self.n
@@ -90,7 +90,7 @@ def failure_angle(self, config: mc.MathConfig) -> rst.Real:
9090

9191
def diamond_norm_distance_to_rz(self, theta: rst.Real, config: mc.MathConfig) -> rst.Real:
9292
u = self.p.value(config.sqrt2)
93-
u = u / zsqrt2.radius_at_n(zsqrt2.LAMBDA_KLIUCHNIKOV, self.n, config)
93+
u = u / _zsqrt2.radius_at_n(_zsqrt2.LAMBDA_KLIUCHNIKOV, self.n, config)
9494
neg_rot = config.cos(theta) - config.sin(theta) * 1j
9595
real_squared = (u * neg_rot).real ** 2
9696
if self.twirl:
@@ -109,7 +109,7 @@ def from_sequence(cls, seq: Sequence[str], twirl: bool = False) -> UnitaryChanne
109109
Returns:
110110
A UnitaryChannel.
111111
"""
112-
u = su2_ct.SU2CliffordT.from_sequence(seq)
112+
u = _su2_ct.SU2CliffordT.from_sequence(seq)
113113
n = sum(g.startswith("T") for g in seq)
114114
return UnitaryChannel(u.matrix[0, 0], u.matrix[1, 0], n, twirl)
115115

@@ -181,12 +181,12 @@ def diamond_norm_distance_to_unitary(
181181

182182
@classmethod
183183
def from_unitaries(
184-
cls, *unitaries: Union[UnitaryChannel, su2_ct.SU2CliffordT]
184+
cls, *unitaries: Union[UnitaryChannel, _su2_ct.SU2CliffordT]
185185
) -> UnitaryChannel:
186186
if not unitaries:
187187
raise ValueError('at least one unitary should be provided')
188188

189-
unitary = su2_ct.ISqrt2
189+
unitary = _su2_ct.ISqrt2
190190
for u in unitaries:
191191
if isinstance(u, UnitaryChannel):
192192
unitary = unitary @ u.to_matrix()
@@ -219,8 +219,8 @@ class ProjectiveChannel(Channel):
219219

220220
def success_probability(self, config: mc.MathConfig) -> rst.Real:
221221
"""Constructs a probablity of a zero measurement."""
222-
v = self.rotation.q.polar(config)[0] / zsqrt2.radius_at_n(
223-
zsqrt2.LAMBDA_KLIUCHNIKOV, self.rotation.n, config
222+
v = self.rotation.q.polar(config)[0] / _zsqrt2.radius_at_n(
223+
_zsqrt2.LAMBDA_KLIUCHNIKOV, self.rotation.n, config
224224
)
225225
return 1 - v * v
226226

@@ -234,8 +234,8 @@ def failure_angle(self, config: mc.MathConfig) -> rst.Real:
234234

235235
def expected_num_ts(self, config: mc.MathConfig) -> rst.Real:
236236
v = self.rotation.q.value(config.sqrt2)
237-
fail_prob = (v * v.conjugate()).real / zsqrt2.radius2_at_n(
238-
zsqrt2.LAMBDA_KLIUCHNIKOV, self.rotation.n, config
237+
fail_prob = (v * v.conjugate()).real / _zsqrt2.radius2_at_n(
238+
_zsqrt2.LAMBDA_KLIUCHNIKOV, self.rotation.n, config
239239
)
240240
return self.rotation.expected_num_ts(config) + fail_prob * self.correction.expected_num_ts(
241241
config
@@ -387,8 +387,8 @@ def from_unitary_channels(
387387
r2, phi2 = u2.p.polar(config)
388388
delta1 = phi1 - target_theta
389389
delta2 = phi2 - target_theta
390-
r1 /= zsqrt2.radius_at_n(zsqrt2.LAMBDA_KLIUCHNIKOV, u1.n, config)
391-
r2 /= zsqrt2.radius_at_n(zsqrt2.LAMBDA_KLIUCHNIKOV, u2.n, config)
390+
r1 /= _zsqrt2.radius_at_n(_zsqrt2.LAMBDA_KLIUCHNIKOV, u1.n, config)
391+
r2 /= _zsqrt2.radius_at_n(_zsqrt2.LAMBDA_KLIUCHNIKOV, u2.n, config)
392392
prob = (
393393
r2**2
394394
* config.sin(2 * delta2)

qualtran/rotation_synthesis/channels/channel_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
import numpy as np
1717
import pytest
1818

19+
import qualtran.rotation_synthesis._math_config as mc
1920
import qualtran.rotation_synthesis.channels as ch
20-
import qualtran.rotation_synthesis.math_config as mc
21-
import qualtran.rotation_synthesis.matrix.clifford_t_repr as ctr
22-
import qualtran.rotation_synthesis.matrix.su2_ct as su2_ct
21+
import qualtran.rotation_synthesis.matrix._clifford_t_repr as ctr
22+
import qualtran.rotation_synthesis.matrix._su2_ct as _su2_ct
2323

2424

2525
def _make_gates(n_seqs: int, n_gates: int, seed: int):
26-
gates = tuple(su2_ct.GATE_MAP.keys())
26+
gates = tuple(_su2_ct.GATE_MAP.keys())
2727
rng = np.random.default_rng(seed)
2828
for _ in range(n_seqs):
2929
yield [gates[i] for i in rng.choice(len(gates), n_gates)]
@@ -32,7 +32,7 @@ def _make_gates(n_seqs: int, n_gates: int, seed: int):
3232
@pytest.mark.parametrize("gates", _make_gates(10, 4, 0))
3333
def test_unitary_from_sequence(gates):
3434
u = ch.UnitaryChannel.from_sequence(gates)
35-
assert u.to_matrix() == su2_ct.SU2CliffordT.from_sequence(gates)
35+
assert u.to_matrix() == _su2_ct.SU2CliffordT.from_sequence(gates)
3636

3737

3838
@pytest.mark.parametrize(

qualtran/rotation_synthesis/lattice/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
"""A package that provides methods for integer point enumeration."""
1616

17-
from qualtran.rotation_synthesis.lattice.geometry import Ellipse, Range, Rectangle
18-
from qualtran.rotation_synthesis.lattice.grid_operators import GridOperator
19-
from qualtran.rotation_synthesis.lattice.ipe import (
17+
from qualtran.rotation_synthesis.lattice._geometry import Ellipse, Range, Rectangle
18+
from qualtran.rotation_synthesis.lattice._grid_operators import GridOperator
19+
from qualtran.rotation_synthesis.lattice._ipe import (
2020
enumerate_1d,
2121
enumerate_upright,
2222
get_overall_action,
2323
get_points_from_state,
2424
)
25-
from qualtran.rotation_synthesis.lattice.state import GridOperatorAction, SelingerState
25+
from qualtran.rotation_synthesis.lattice._state import GridOperatorAction, SelingerState

qualtran/rotation_synthesis/lattice/geometry.py renamed to qualtran/rotation_synthesis/lattice/_geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import mpmath
2626
import numpy as np
2727

28+
import qualtran.rotation_synthesis._math_config as mc
2829
import qualtran.rotation_synthesis._typing as rst
29-
import qualtran.rotation_synthesis.math_config as mc
3030

3131

3232
@attrs.frozen

qualtran/rotation_synthesis/lattice/grid_operators.py renamed to qualtran/rotation_synthesis/lattice/_grid_operators.py

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import numpy as np
1919

2020
import qualtran.rotation_synthesis._typing as rst
21-
import qualtran.rotation_synthesis.rings.zsqrt2 as zsqrt2
22-
import qualtran.rotation_synthesis.rings.zw as zw
21+
import qualtran.rotation_synthesis.rings._zsqrt2 as _zsqrt2
22+
import qualtran.rotation_synthesis.rings._zw as _zw
2323

2424

2525
@attrs.frozen
@@ -48,7 +48,7 @@ def __attrs_post_init__(self):
4848
m = self.matrix
4949
assert isinstance(m.dtype, object)
5050
assert m.shape == (2, 2)
51-
assert all(isinstance(x, zsqrt2.ZSqrt2) for x in m.reshape(-1))
51+
assert all(isinstance(x, _zsqrt2.ZSqrt2) for x in m.reshape(-1))
5252
assert sum(x.a for x in self.matrix.reshape(-1)) % 2 == 0
5353
assert sum(x.b for x in self.matrix.reshape(-1)) % 2 == 0
5454

@@ -75,18 +75,19 @@ def shift(self, k: rst.Integral) -> "GridOperator":
7575
"""
7676
k = int(k)
7777
if k >= 0:
78-
lambda_value = zsqrt2.LAMBDA
79-
l_inv = zsqrt2.LAMBDA_INV
78+
lambda_value = _zsqrt2.LAMBDA
79+
l_inv = _zsqrt2.LAMBDA_INV
8080
else:
81-
l_inv = zsqrt2.LAMBDA
82-
lambda_value = zsqrt2.LAMBDA_INV
81+
l_inv = _zsqrt2.LAMBDA
82+
lambda_value = _zsqrt2.LAMBDA_INV
8383

8484
k = abs(k)
8585
left = GridOperator(
86-
np.array([[zsqrt2.One, zsqrt2.Zero], [zsqrt2.Zero, l_inv**k]]) * zsqrt2.SQRT_2
86+
np.array([[_zsqrt2.One, _zsqrt2.Zero], [_zsqrt2.Zero, l_inv**k]]) * _zsqrt2.SQRT_2
8787
)
8888
right = GridOperator(
89-
np.array([[lambda_value**k, zsqrt2.Zero], [zsqrt2.Zero, zsqrt2.One]]) * zsqrt2.SQRT_2
89+
np.array([[lambda_value**k, _zsqrt2.Zero], [_zsqrt2.Zero, _zsqrt2.One]])
90+
* _zsqrt2.SQRT_2
9091
)
9192
return left @ self @ right
9293

@@ -135,12 +136,12 @@ def actual_value(self, sqrt2: rst.Real) -> np.ndarray:
135136
def scaled_inverse(self) -> "GridOperator":
136137
"""Returns the inverse of the operator multiplied by sqrt(2)."""
137138
a, b, c, d = self.matrix.reshape(-1)
138-
det: zsqrt2.ZSqrt2 = a * d - b * c
139+
det: _zsqrt2.ZSqrt2 = a * d - b * c
139140
assert det.b == 0 and det.a in (-2, 2)
140141
sgn = -1 if det.a == -2 else 1
141142
return GridOperator(np.array([[d, -b], [-c, a]]) * sgn)
142143

143-
def apply(self, z: zw.ZW) -> zw.ZW:
144+
def apply(self, z: _zw.ZW) -> _zw.ZW:
144145
r"""Applies the operator on the given point in $\mathbb{\omega}$."""
145146

146147
# The operator is a 2x2 matrix that acts on the real and imaginary parts of a point.
@@ -150,56 +151,58 @@ def apply(self, z: zw.ZW) -> zw.ZW:
150151
a, b, c, d = self.matrix.reshape(-1)
151152

152153
if include_w:
153-
x = x * zsqrt2.SQRT_2 + zsqrt2.One
154-
y = y * zsqrt2.SQRT_2 + zsqrt2.One
154+
x = x * _zsqrt2.SQRT_2 + _zsqrt2.One
155+
y = y * _zsqrt2.SQRT_2 + _zsqrt2.One
155156
xp = a * x + b * y
156157
yp = c * x + d * y
157158
assert xp.a % 2 == yp.a % 2 == 0
158159
assert xp.b % 2 == yp.b % 2
159160
if xp.b % 2 == 0:
160-
xp = zsqrt2.ZSqrt2(xp.a // 2, xp.b // 2)
161-
yp = zsqrt2.ZSqrt2(yp.a // 2, yp.b // 2)
162-
return zw.ZW.from_pair(xp, yp, False)
161+
xp = _zsqrt2.ZSqrt2(xp.a // 2, xp.b // 2)
162+
yp = _zsqrt2.ZSqrt2(yp.a // 2, yp.b // 2)
163+
return _zw.ZW.from_pair(xp, yp, False)
163164
else:
164-
xp = zsqrt2.ZSqrt2(xp.a // 2, (xp.b - 1) // 2)
165-
yp = zsqrt2.ZSqrt2(yp.a // 2, (yp.b - 1) // 2)
166-
return zw.ZW.from_pair(xp, yp, True)
165+
xp = _zsqrt2.ZSqrt2(xp.a // 2, (xp.b - 1) // 2)
166+
yp = _zsqrt2.ZSqrt2(yp.a // 2, (yp.b - 1) // 2)
167+
return _zw.ZW.from_pair(xp, yp, True)
167168
else:
168169
xp = a * x + b * y
169170
yp = c * x + d * y
170171
assert (xp.a + yp.a) % 2 == 0
171172
if xp.a % 2 == 0:
172-
return zw.ZW.from_pair(xp.divide_by_sqrt2(), yp.divide_by_sqrt2(), False)
173+
return _zw.ZW.from_pair(xp.divide_by_sqrt2(), yp.divide_by_sqrt2(), False)
173174
else:
174-
xp = xp - zsqrt2.One
175-
yp = yp - zsqrt2.One
176-
return zw.ZW.from_pair(xp.divide_by_sqrt2(), yp.divide_by_sqrt2(), True)
175+
xp = xp - _zsqrt2.One
176+
yp = yp - _zsqrt2.One
177+
return _zw.ZW.from_pair(xp.divide_by_sqrt2(), yp.divide_by_sqrt2(), True)
177178

178179

179180
####### The operators {R, K, K^\bullet, A, B, X, Z, I, Sigma} * sqrt(2) ############
180181

181182

182-
RSqrt2 = GridOperator([[zsqrt2.One, -zsqrt2.One], [zsqrt2.One, zsqrt2.One]])
183+
RSqrt2 = GridOperator([[_zsqrt2.One, -_zsqrt2.One], [_zsqrt2.One, _zsqrt2.One]])
183184

184-
KSqrt2 = GridOperator([[-zsqrt2.LAMBDA_INV, -zsqrt2.One], [zsqrt2.LAMBDA, zsqrt2.One]])
185+
KSqrt2 = GridOperator([[-_zsqrt2.LAMBDA_INV, -_zsqrt2.One], [_zsqrt2.LAMBDA, _zsqrt2.One]])
185186

186187
KConjSqrt2 = GridOperator(
187-
[[-zsqrt2.LAMBDA_INV.conj(), -zsqrt2.One], [zsqrt2.LAMBDA.conj(), zsqrt2.One]]
188+
[[-_zsqrt2.LAMBDA_INV.conj(), -_zsqrt2.One], [_zsqrt2.LAMBDA.conj(), _zsqrt2.One]]
188189
)
189190

190-
ASqrt2 = GridOperator(np.array([[zsqrt2.SQRT_2, -2 * zsqrt2.SQRT_2], [zsqrt2.Zero, zsqrt2.SQRT_2]]))
191+
ASqrt2 = GridOperator(
192+
np.array([[_zsqrt2.SQRT_2, -2 * _zsqrt2.SQRT_2], [_zsqrt2.Zero, _zsqrt2.SQRT_2]])
193+
)
191194

192-
BSqrt2 = GridOperator(np.array([[zsqrt2.SQRT_2, 2 * zsqrt2.One], [zsqrt2.Zero, zsqrt2.SQRT_2]]))
195+
BSqrt2 = GridOperator(np.array([[_zsqrt2.SQRT_2, 2 * _zsqrt2.One], [_zsqrt2.Zero, _zsqrt2.SQRT_2]]))
193196

194-
XSqrt2 = GridOperator(np.array([[zsqrt2.Zero, zsqrt2.SQRT_2], [zsqrt2.SQRT_2, zsqrt2.Zero]]))
195-
ZSqrt2 = GridOperator(np.array([[zsqrt2.SQRT_2, zsqrt2.Zero], [zsqrt2.Zero, -zsqrt2.SQRT_2]]))
197+
XSqrt2 = GridOperator(np.array([[_zsqrt2.Zero, _zsqrt2.SQRT_2], [_zsqrt2.SQRT_2, _zsqrt2.Zero]]))
198+
ZSqrt2 = GridOperator(np.array([[_zsqrt2.SQRT_2, _zsqrt2.Zero], [_zsqrt2.Zero, -_zsqrt2.SQRT_2]]))
196199

197-
ISqrt2 = GridOperator(np.array([[zsqrt2.SQRT_2, zsqrt2.Zero], [zsqrt2.Zero, zsqrt2.SQRT_2]]))
200+
ISqrt2 = GridOperator(np.array([[_zsqrt2.SQRT_2, _zsqrt2.Zero], [_zsqrt2.Zero, _zsqrt2.SQRT_2]]))
198201

199202
HALF_SIGMA_Sqrt2 = GridOperator(
200-
zsqrt2.SQRT_2 * np.array([[zsqrt2.LAMBDA, zsqrt2.Zero], [zsqrt2.Zero, zsqrt2.One]])
203+
_zsqrt2.SQRT_2 * np.array([[_zsqrt2.LAMBDA, _zsqrt2.Zero], [_zsqrt2.Zero, _zsqrt2.One]])
201204
)
202205

203206
HALF_SIGMA_INV_Sqrt2 = GridOperator(
204-
zsqrt2.SQRT_2 * np.array([[zsqrt2.LAMBDA_INV, zsqrt2.Zero], [zsqrt2.Zero, zsqrt2.One]])
207+
_zsqrt2.SQRT_2 * np.array([[_zsqrt2.LAMBDA_INV, _zsqrt2.Zero], [_zsqrt2.Zero, _zsqrt2.One]])
205208
)

0 commit comments

Comments
 (0)