cirq-core 1.5.0.dev20250107200829__py3-none-any.whl → 1.5.0.dev20250107215806__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cirq-core might be problematic. Click here for more details.
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/transformers/gauge_compiling/gauge_compiling.py +10 -5
- cirq/transformers/gauge_compiling/iswap_gauge.py +7 -1
- cirq/transformers/gauge_compiling/iswap_gauge_test.py +1 -0
- cirq/transformers/gauge_compiling/spin_inversion_gauge.py +2 -2
- cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py +4 -0
- cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py +12 -2
- cirq/transformers/gauge_compiling/sqrt_iswap_gauge_test.py +1 -0
- {cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/RECORD +14 -14
- {cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
|
@@ -118,6 +118,7 @@ class SameGateGauge(Gauge):
|
|
|
118
118
|
default=(), converter=lambda g: (g,) if isinstance(g, ops.Gate) else tuple(g)
|
|
119
119
|
)
|
|
120
120
|
swap_qubits: bool = False
|
|
121
|
+
support_sweep: bool = False
|
|
121
122
|
|
|
122
123
|
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
123
124
|
return ConstantGauge(
|
|
@@ -127,6 +128,7 @@ class SameGateGauge(Gauge):
|
|
|
127
128
|
post_q0=self.post_q0,
|
|
128
129
|
post_q1=self.post_q1,
|
|
129
130
|
swap_qubits=self.swap_qubits,
|
|
131
|
+
support_sweep=self.support_sweep,
|
|
130
132
|
)
|
|
131
133
|
|
|
132
134
|
|
|
@@ -332,6 +334,13 @@ def _parameterize(num_qubits: int, symbol_id: int) -> Dict[str, sympy.Symbol]:
|
|
|
332
334
|
def _gate_sequence_to_phxz_params(
|
|
333
335
|
gates: Tuple[ops.Gate, ...], xza_by_symbols: Dict[str, sympy.Symbol]
|
|
334
336
|
) -> Dict[str, float]:
|
|
337
|
+
identity_gate_in_phxz = {
|
|
338
|
+
str(xza_by_symbols["x_exponent"]): 0.0,
|
|
339
|
+
str(xza_by_symbols["z_exponent"]): 0.0,
|
|
340
|
+
str(xza_by_symbols["axis_phase_exponent"]): 0.0,
|
|
341
|
+
}
|
|
342
|
+
if not gates:
|
|
343
|
+
return identity_gate_in_phxz
|
|
335
344
|
for gate in gates:
|
|
336
345
|
if not has_unitary(gate) or gate.num_qubits() != 1:
|
|
337
346
|
raise ValueError(
|
|
@@ -347,11 +356,7 @@ def _gate_sequence_to_phxz_params(
|
|
|
347
356
|
or ops.I
|
|
348
357
|
)
|
|
349
358
|
if phxz is ops.I: # Identity gate
|
|
350
|
-
return
|
|
351
|
-
str(xza_by_symbols["x_exponent"]): 0.0,
|
|
352
|
-
str(xza_by_symbols["z_exponent"]): 0.0,
|
|
353
|
-
str(xza_by_symbols["axis_phase_exponent"]): 0.0,
|
|
354
|
-
}
|
|
359
|
+
return identity_gate_in_phxz
|
|
355
360
|
# Check the gate type, needs to be a PhasedXZ gate.
|
|
356
361
|
if not isinstance(phxz, ops.PhasedXZGate):
|
|
357
362
|
raise ValueError("Failed to convert the gate sequence to a PhasedXZ gate.")
|
|
@@ -56,6 +56,7 @@ class RZRotation(Gauge):
|
|
|
56
56
|
pre_q1=n_rz if flip_diangonal else rz,
|
|
57
57
|
post_q0=rz if flip_diangonal else n_rz,
|
|
58
58
|
post_q1=n_rz,
|
|
59
|
+
support_sweep=True,
|
|
59
60
|
)
|
|
60
61
|
|
|
61
62
|
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
@@ -88,7 +89,12 @@ class XYRotation(Gauge):
|
|
|
88
89
|
xy_a = self._xy(a)
|
|
89
90
|
xy_b = self._xy(b)
|
|
90
91
|
return ConstantGauge(
|
|
91
|
-
two_qubit_gate=ops.ISWAP,
|
|
92
|
+
two_qubit_gate=ops.ISWAP,
|
|
93
|
+
pre_q0=xy_a,
|
|
94
|
+
pre_q1=xy_b,
|
|
95
|
+
post_q0=xy_b,
|
|
96
|
+
post_q1=xy_a,
|
|
97
|
+
support_sweep=True,
|
|
92
98
|
)
|
|
93
99
|
|
|
94
100
|
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
@@ -23,8 +23,8 @@ from cirq import ops
|
|
|
23
23
|
|
|
24
24
|
SpinInversionGaugeSelector = GaugeSelector(
|
|
25
25
|
gauges=[
|
|
26
|
-
SameGateGauge(pre_q0=ops.X, post_q0=ops.X, pre_q1=ops.X, post_q1=ops.X),
|
|
27
|
-
SameGateGauge(),
|
|
26
|
+
SameGateGauge(pre_q0=ops.X, post_q0=ops.X, pre_q1=ops.X, post_q1=ops.X, support_sweep=True),
|
|
27
|
+
SameGateGauge(support_sweep=True),
|
|
28
28
|
]
|
|
29
29
|
)
|
|
30
30
|
|
|
@@ -20,18 +20,22 @@ from cirq.transformers.gauge_compiling.gauge_compiling_test_utils import GaugeTe
|
|
|
20
20
|
class TestSpinInversionGauge_0(GaugeTester):
|
|
21
21
|
two_qubit_gate = cirq.ZZ
|
|
22
22
|
gauge_transformer = SpinInversionGaugeTransformer
|
|
23
|
+
sweep_must_pass = True
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
class TestSpinInversionGauge_1(GaugeTester):
|
|
26
27
|
two_qubit_gate = cirq.ZZ**0.1
|
|
27
28
|
gauge_transformer = SpinInversionGaugeTransformer
|
|
29
|
+
sweep_must_pass = True
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
class TestSpinInversionGauge_2(GaugeTester):
|
|
31
33
|
two_qubit_gate = cirq.ZZ**-1
|
|
32
34
|
gauge_transformer = SpinInversionGaugeTransformer
|
|
35
|
+
sweep_must_pass = True
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
class TestSpinInversionGauge_3(GaugeTester):
|
|
36
39
|
two_qubit_gate = cirq.ZZ**0.3
|
|
37
40
|
gauge_transformer = SpinInversionGaugeTransformer
|
|
41
|
+
sweep_must_pass = True
|
|
@@ -49,7 +49,12 @@ class RZRotation(Gauge):
|
|
|
49
49
|
rz = ops.rz(theta)
|
|
50
50
|
n_rz = ops.rz(-theta)
|
|
51
51
|
return ConstantGauge(
|
|
52
|
-
two_qubit_gate=ops.SQRT_ISWAP,
|
|
52
|
+
two_qubit_gate=ops.SQRT_ISWAP,
|
|
53
|
+
pre_q0=rz,
|
|
54
|
+
pre_q1=rz,
|
|
55
|
+
post_q0=n_rz,
|
|
56
|
+
post_q1=n_rz,
|
|
57
|
+
support_sweep=True,
|
|
53
58
|
)
|
|
54
59
|
|
|
55
60
|
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
|
@@ -80,7 +85,12 @@ class XYRotation(Gauge):
|
|
|
80
85
|
def _xy_gauge(self, theta: float) -> ConstantGauge:
|
|
81
86
|
xy = self._xy(theta)
|
|
82
87
|
return ConstantGauge(
|
|
83
|
-
two_qubit_gate=ops.SQRT_ISWAP,
|
|
88
|
+
two_qubit_gate=ops.SQRT_ISWAP,
|
|
89
|
+
pre_q0=xy,
|
|
90
|
+
pre_q1=xy,
|
|
91
|
+
post_q0=xy,
|
|
92
|
+
post_q1=xy,
|
|
93
|
+
support_sweep=True,
|
|
84
94
|
)
|
|
85
95
|
|
|
86
96
|
def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
|
{cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev20250107215806
|
|
4
4
|
Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
{cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=Qq3ZcfgD-Nb81cEppQdJqhAyrVqXKtfXZYGXT0p-Wh0,34718
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=p9gMHJscbtDDkfHOaulvd3Aer0pwUF5AXpL89XR8dNw,8402
|
|
6
6
|
cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=CAtr1Cx78Iy565nVQWtm92OusQzhb7-jk_W2uwOnaYs,1206
|
|
8
|
+
cirq/_version_test.py,sha256=e18NtfUe3JrzzaNo7vFCnWEbqLxngqyj48pupAlRq1s,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=03MVo6Y-UYrzt9CKHmwpiBLN2ixL6uSU-OWnKZXfG7k,13302
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -1094,18 +1094,18 @@ cirq/transformers/analytical_decompositions/two_qubit_to_sqrt_iswap_test.py,sha2
|
|
|
1094
1094
|
cirq/transformers/gauge_compiling/__init__.py,sha256=ZF53ZtYRJeKsVJYjKc_QrAqE1pyd8FFmmb6Wo8JdgQs,1385
|
|
1095
1095
|
cirq/transformers/gauge_compiling/cz_gauge.py,sha256=pJ41uVaUltigKLIayxr0XMqTYEs0zUDnaWD-tp65pPk,4198
|
|
1096
1096
|
cirq/transformers/gauge_compiling/cz_gauge_test.py,sha256=sHEgEEI_z9-Ka5ChN2JmtoYcEHhNYHysOjGJzaaKkoA,881
|
|
1097
|
-
cirq/transformers/gauge_compiling/gauge_compiling.py,sha256=
|
|
1097
|
+
cirq/transformers/gauge_compiling/gauge_compiling.py,sha256=kNIJwyGchc1eVrsb1tzSkwm01_PVDYyLSL56mG8xlcA,15230
|
|
1098
1098
|
cirq/transformers/gauge_compiling/gauge_compiling_test.py,sha256=Nm0Uxqrq1Y5puQep9UpKXK2zg9a3Dx2NSFArIxeawUg,4444
|
|
1099
1099
|
cirq/transformers/gauge_compiling/gauge_compiling_test_utils.py,sha256=7RNZ6-xQ1iKjoNWTokgok7xTCeAnrQUzbpdBhdJZEfY,4933
|
|
1100
1100
|
cirq/transformers/gauge_compiling/gauge_compiling_test_utils_test.py,sha256=cWEAP1EWbpHNp7wQPXLyT413raoG3aIg8aFod_aXAtQ,2340
|
|
1101
|
-
cirq/transformers/gauge_compiling/iswap_gauge.py,sha256=
|
|
1102
|
-
cirq/transformers/gauge_compiling/iswap_gauge_test.py,sha256=
|
|
1103
|
-
cirq/transformers/gauge_compiling/spin_inversion_gauge.py,sha256=
|
|
1104
|
-
cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py,sha256=
|
|
1101
|
+
cirq/transformers/gauge_compiling/iswap_gauge.py,sha256=W2g2DXhN1OQbVL1UxBjvZa3YsRPMFAiaC-tvxKImSHU,3613
|
|
1102
|
+
cirq/transformers/gauge_compiling/iswap_gauge_test.py,sha256=HoeJgSJSrr3ARXDPP9uOb5z4fgvR94snTWGfqG7-yuE,893
|
|
1103
|
+
cirq/transformers/gauge_compiling/spin_inversion_gauge.py,sha256=wpZx2-FbBt2Eq9ORUzMYPqtuJcHkU_5PTcQFDRfwSBo,1124
|
|
1104
|
+
cirq/transformers/gauge_compiling/spin_inversion_gauge_test.py,sha256=eQ65i1GovnL2-VmPumcFKMIjqE0Pee1PdmsO0XDGmW4,1400
|
|
1105
1105
|
cirq/transformers/gauge_compiling/sqrt_cz_gauge.py,sha256=32OGTcYT3tBFEQ1GQlrssc1wtwCcSvk4ZC0I1XD1QXg,1869
|
|
1106
1106
|
cirq/transformers/gauge_compiling/sqrt_cz_gauge_test.py,sha256=RwjadOOJfa2Qf7iryTIMJLPzeDMNqFkP6Tewjq68gJI,997
|
|
1107
|
-
cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py,sha256=
|
|
1108
|
-
cirq/transformers/gauge_compiling/sqrt_iswap_gauge_test.py,sha256=
|
|
1107
|
+
cirq/transformers/gauge_compiling/sqrt_iswap_gauge.py,sha256=VnlO4eqy5Yx-cE_EO0JSV2iccyJnrp7WWgzPiF_cJGg,3288
|
|
1108
|
+
cirq/transformers/gauge_compiling/sqrt_iswap_gauge_test.py,sha256=n0so4a7TLvpL5CelBUExpA0dgGvfAVxLsqLxRpKqFYE,909
|
|
1109
1109
|
cirq/transformers/heuristic_decompositions/__init__.py,sha256=_LEidXfFkmJicQapJVR1etyH1fLJ3ZwtBgq2M2_ECZI,926
|
|
1110
1110
|
cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils.py,sha256=j9bbiIbC2rvwG830gTTf9zr9C7RVA5Ilhka_ZNF-N7w,10785
|
|
1111
1111
|
cirq/transformers/heuristic_decompositions/gate_tabulation_math_utils_test.py,sha256=N02nlz7tISYVArvWNILwg-hnDB5Y9PCHbwIxk42Afv8,1534
|
|
@@ -1189,8 +1189,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
|
|
|
1189
1189
|
cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
|
|
1190
1190
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1191
1191
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1192
|
-
cirq_core-1.5.0.
|
|
1193
|
-
cirq_core-1.5.0.
|
|
1194
|
-
cirq_core-1.5.0.
|
|
1195
|
-
cirq_core-1.5.0.
|
|
1196
|
-
cirq_core-1.5.0.
|
|
1192
|
+
cirq_core-1.5.0.dev20250107215806.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1193
|
+
cirq_core-1.5.0.dev20250107215806.dist-info/METADATA,sha256=OXQ35IIeVp3zgqbtpPux5UZodNGwAnUC_Z8y90bJ3J0,1992
|
|
1194
|
+
cirq_core-1.5.0.dev20250107215806.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1195
|
+
cirq_core-1.5.0.dev20250107215806.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1196
|
+
cirq_core-1.5.0.dev20250107215806.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20250107200829.dist-info → cirq_core-1.5.0.dev20250107215806.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|