cirq-core 1.4.0.dev20240202192938__py3-none-any.whl → 1.4.0.dev20240203002706__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/sim/simulation_product_state.py +14 -7
- cirq/transformers/optimize_for_target_gateset.py +39 -17
- cirq/transformers/optimize_for_target_gateset_test.py +150 -0
- cirq/transformers/target_gatesets/compilation_target_gateset.py +26 -2
- cirq/transformers/target_gatesets/cz_gateset.py +4 -0
- {cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/METADATA +1 -1
- {cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/RECORD +11 -11
- {cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/LICENSE +0 -0
- {cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/WHEEL +0 -0
- {cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.4.0.
|
|
1
|
+
__version__ = "1.4.0.dev20240203002706"
|
|
@@ -63,12 +63,19 @@ class SimulationProductState(
|
|
|
63
63
|
return self._split_untangled_states
|
|
64
64
|
|
|
65
65
|
def create_merged_state(self) -> TSimulationState:
|
|
66
|
+
merged_state = self.sim_states[None]
|
|
66
67
|
if not self.split_untangled_states:
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
return merged_state
|
|
69
|
+
extra_states = set([self.sim_states[k] for k in self.sim_states.keys() if k is not None])
|
|
70
|
+
if not extra_states:
|
|
71
|
+
return merged_state
|
|
72
|
+
|
|
73
|
+
# This comes from a member variable so we need to copy it if we're going to modify inplace
|
|
74
|
+
# before returning. We're not running a step currently, so no need to copy buffers.
|
|
75
|
+
merged_state = merged_state.copy(deep_copy_buffers=False)
|
|
76
|
+
for state in extra_states:
|
|
77
|
+
merged_state.kronecker_product(state, inplace=True)
|
|
78
|
+
return merged_state.transpose_to_qubit_order(self.qubits, inplace=True)
|
|
72
79
|
|
|
73
80
|
def _act_on_fallback_(
|
|
74
81
|
self, action: Any, qubits: Sequence['cirq.Qid'], allow_decompose: bool = True
|
|
@@ -106,7 +113,7 @@ class SimulationProductState(
|
|
|
106
113
|
if op_args_opt is None:
|
|
107
114
|
op_args_opt = self.sim_states[q]
|
|
108
115
|
elif q not in op_args_opt.qubits:
|
|
109
|
-
op_args_opt
|
|
116
|
+
op_args_opt.kronecker_product(self.sim_states[q], inplace=True)
|
|
110
117
|
op_args = op_args_opt or self.sim_states[None]
|
|
111
118
|
|
|
112
119
|
# (Backfill the args map with the new value)
|
|
@@ -123,7 +130,7 @@ class SimulationProductState(
|
|
|
123
130
|
):
|
|
124
131
|
for q in qubits:
|
|
125
132
|
if op_args.allows_factoring and len(op_args.qubits) > 1:
|
|
126
|
-
q_args,
|
|
133
|
+
q_args, _ = op_args.factor((q,), validate=False, inplace=True)
|
|
127
134
|
self._sim_states[q] = q_args
|
|
128
135
|
|
|
129
136
|
# (Backfill the args map with the new value)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Transformers to rewrite a circuit using gates from a given target gateset."""
|
|
16
16
|
|
|
17
|
-
from typing import Optional, Callable, Hashable, Sequence, TYPE_CHECKING
|
|
17
|
+
from typing import Optional, Callable, Hashable, Sequence, TYPE_CHECKING, Union
|
|
18
18
|
|
|
19
19
|
from cirq import circuits
|
|
20
20
|
from cirq.protocols import decompose_protocol as dp
|
|
@@ -102,19 +102,29 @@ def optimize_for_target_gateset(
|
|
|
102
102
|
context: Optional['cirq.TransformerContext'] = None,
|
|
103
103
|
gateset: Optional['cirq.CompilationTargetGateset'] = None,
|
|
104
104
|
ignore_failures: bool = True,
|
|
105
|
+
max_num_passes: Union[int, None] = 1,
|
|
105
106
|
) -> 'cirq.Circuit':
|
|
106
107
|
"""Transforms the given circuit into an equivalent circuit using gates accepted by `gateset`.
|
|
107
108
|
|
|
109
|
+
Repeat max_num_passes times or when `max_num_passes=None` until no further changes can be done
|
|
108
110
|
1. Run all `gateset.preprocess_transformers`
|
|
109
111
|
2. Convert operations using built-in cirq decompose + `gateset.decompose_to_target_gateset`.
|
|
110
112
|
3. Run all `gateset.postprocess_transformers`
|
|
111
113
|
|
|
114
|
+
Note:
|
|
115
|
+
The optimizer is a heuristic and may not produce optimal results even with
|
|
116
|
+
max_num_passes=None. The preprocessors and postprocessors of the gate set
|
|
117
|
+
as well as their order yield different results.
|
|
118
|
+
|
|
119
|
+
|
|
112
120
|
Args:
|
|
113
121
|
circuit: Input circuit to transform. It will not be modified.
|
|
114
122
|
context: `cirq.TransformerContext` storing common configurable options for transformers.
|
|
115
123
|
gateset: Target gateset, which should be an instance of `cirq.CompilationTargetGateset`.
|
|
116
124
|
ignore_failures: If set, operations that fail to convert are left unchanged. If not set,
|
|
117
125
|
conversion failures raise a ValueError.
|
|
126
|
+
max_num_passes: The maximum number of passes to do. A value of `None` means to keep
|
|
127
|
+
iterating until no more changes happen to the number of moments or operations.
|
|
118
128
|
|
|
119
129
|
Returns:
|
|
120
130
|
An equivalent circuit containing gates accepted by `gateset`.
|
|
@@ -126,20 +136,32 @@ def optimize_for_target_gateset(
|
|
|
126
136
|
return _decompose_operations_to_target_gateset(
|
|
127
137
|
circuit, context=context, ignore_failures=ignore_failures
|
|
128
138
|
)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
if isinstance(max_num_passes, int):
|
|
140
|
+
_outerloop = lambda: range(max_num_passes)
|
|
141
|
+
else:
|
|
142
|
+
|
|
143
|
+
def _outerloop():
|
|
144
|
+
while True:
|
|
145
|
+
yield 0
|
|
146
|
+
|
|
147
|
+
initial_num_moments, initial_num_ops = len(circuit), sum(1 for _ in circuit.all_operations())
|
|
148
|
+
for _ in _outerloop():
|
|
149
|
+
for transformer in gateset.preprocess_transformers:
|
|
150
|
+
circuit = transformer(circuit, context=context)
|
|
151
|
+
circuit = _decompose_operations_to_target_gateset(
|
|
152
|
+
circuit,
|
|
153
|
+
context=context,
|
|
154
|
+
gateset=gateset,
|
|
155
|
+
decomposer=gateset.decompose_to_target_gateset,
|
|
156
|
+
ignore_failures=ignore_failures,
|
|
157
|
+
tags_to_decompose=(gateset._intermediate_result_tag,),
|
|
158
|
+
)
|
|
159
|
+
for transformer in gateset.postprocess_transformers:
|
|
160
|
+
circuit = transformer(circuit, context=context)
|
|
161
|
+
|
|
162
|
+
num_moments, num_ops = len(circuit), sum(1 for _ in circuit.all_operations())
|
|
163
|
+
if (num_moments, num_ops) == (initial_num_moments, initial_num_ops):
|
|
164
|
+
# Stop early. No further optimizations can be done.
|
|
165
|
+
break
|
|
166
|
+
initial_num_moments, initial_num_ops = num_moments, num_ops
|
|
145
167
|
return circuit.unfreeze(copy=False)
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from typing import Union
|
|
16
|
+
|
|
15
17
|
import cirq
|
|
16
18
|
from cirq.protocols.decompose_protocol import DecomposeResult
|
|
17
19
|
from cirq.transformers.optimize_for_target_gateset import _decompose_operations_to_target_gateset
|
|
@@ -243,3 +245,151 @@ def test_optimize_for_target_gateset_deep():
|
|
|
243
245
|
1: ───#2───────────────────────────────────────────────────────────────────────────
|
|
244
246
|
''',
|
|
245
247
|
)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@pytest.mark.parametrize('max_num_passes', [2, None])
|
|
251
|
+
def test_optimize_for_target_gateset_multiple_passes(max_num_passes: Union[int, None]):
|
|
252
|
+
gateset = cirq.CZTargetGateset()
|
|
253
|
+
|
|
254
|
+
input_circuit = cirq.Circuit(
|
|
255
|
+
[
|
|
256
|
+
cirq.Moment(
|
|
257
|
+
cirq.X(cirq.LineQubit(1)),
|
|
258
|
+
cirq.X(cirq.LineQubit(2)),
|
|
259
|
+
cirq.X(cirq.LineQubit(3)),
|
|
260
|
+
cirq.X(cirq.LineQubit(6)),
|
|
261
|
+
),
|
|
262
|
+
cirq.Moment(
|
|
263
|
+
cirq.H(cirq.LineQubit(0)),
|
|
264
|
+
cirq.H(cirq.LineQubit(1)),
|
|
265
|
+
cirq.H(cirq.LineQubit(2)),
|
|
266
|
+
cirq.H(cirq.LineQubit(3)),
|
|
267
|
+
cirq.H(cirq.LineQubit(4)),
|
|
268
|
+
cirq.H(cirq.LineQubit(5)),
|
|
269
|
+
cirq.H(cirq.LineQubit(6)),
|
|
270
|
+
),
|
|
271
|
+
cirq.Moment(
|
|
272
|
+
cirq.H(cirq.LineQubit(1)), cirq.H(cirq.LineQubit(3)), cirq.H(cirq.LineQubit(5))
|
|
273
|
+
),
|
|
274
|
+
cirq.Moment(
|
|
275
|
+
cirq.CZ(cirq.LineQubit(0), cirq.LineQubit(1)),
|
|
276
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(3)),
|
|
277
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(5)),
|
|
278
|
+
),
|
|
279
|
+
cirq.Moment(
|
|
280
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(1)),
|
|
281
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(3)),
|
|
282
|
+
cirq.CZ(cirq.LineQubit(6), cirq.LineQubit(5)),
|
|
283
|
+
),
|
|
284
|
+
]
|
|
285
|
+
)
|
|
286
|
+
desired_circuit = cirq.Circuit.from_moments(
|
|
287
|
+
cirq.Moment(
|
|
288
|
+
cirq.PhasedXZGate(axis_phase_exponent=0.5, x_exponent=-0.5, z_exponent=1.0).on(
|
|
289
|
+
cirq.LineQubit(4)
|
|
290
|
+
)
|
|
291
|
+
),
|
|
292
|
+
cirq.Moment(cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(5))),
|
|
293
|
+
cirq.Moment(
|
|
294
|
+
cirq.PhasedXZGate(axis_phase_exponent=-1.0, x_exponent=1, z_exponent=0).on(
|
|
295
|
+
cirq.LineQubit(1)
|
|
296
|
+
),
|
|
297
|
+
cirq.PhasedXZGate(axis_phase_exponent=0.5, x_exponent=-0.5, z_exponent=1.0).on(
|
|
298
|
+
cirq.LineQubit(0)
|
|
299
|
+
),
|
|
300
|
+
cirq.PhasedXZGate(axis_phase_exponent=-1.0, x_exponent=1, z_exponent=0).on(
|
|
301
|
+
cirq.LineQubit(3)
|
|
302
|
+
),
|
|
303
|
+
cirq.PhasedXZGate(axis_phase_exponent=-0.5, x_exponent=0.5, z_exponent=0.0).on(
|
|
304
|
+
cirq.LineQubit(2)
|
|
305
|
+
),
|
|
306
|
+
),
|
|
307
|
+
cirq.Moment(
|
|
308
|
+
cirq.CZ(cirq.LineQubit(0), cirq.LineQubit(1)),
|
|
309
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(3)),
|
|
310
|
+
),
|
|
311
|
+
cirq.Moment(
|
|
312
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(1)),
|
|
313
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(3)),
|
|
314
|
+
),
|
|
315
|
+
cirq.Moment(
|
|
316
|
+
cirq.PhasedXZGate(axis_phase_exponent=-0.5, x_exponent=0.5, z_exponent=0.0).on(
|
|
317
|
+
cirq.LineQubit(6)
|
|
318
|
+
)
|
|
319
|
+
),
|
|
320
|
+
cirq.Moment(cirq.CZ(cirq.LineQubit(6), cirq.LineQubit(5))),
|
|
321
|
+
)
|
|
322
|
+
got = cirq.optimize_for_target_gateset(
|
|
323
|
+
input_circuit, gateset=gateset, max_num_passes=max_num_passes
|
|
324
|
+
)
|
|
325
|
+
cirq.testing.assert_same_circuits(got, desired_circuit)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
@pytest.mark.parametrize('max_num_passes', [2, None])
|
|
329
|
+
def test_optimize_for_target_gateset_multiple_passes_dont_preserve_moment_structure(
|
|
330
|
+
max_num_passes: Union[int, None]
|
|
331
|
+
):
|
|
332
|
+
gateset = cirq.CZTargetGateset(preserve_moment_structure=False)
|
|
333
|
+
|
|
334
|
+
input_circuit = cirq.Circuit(
|
|
335
|
+
[
|
|
336
|
+
cirq.Moment(
|
|
337
|
+
cirq.X(cirq.LineQubit(1)),
|
|
338
|
+
cirq.X(cirq.LineQubit(2)),
|
|
339
|
+
cirq.X(cirq.LineQubit(3)),
|
|
340
|
+
cirq.X(cirq.LineQubit(6)),
|
|
341
|
+
),
|
|
342
|
+
cirq.Moment(
|
|
343
|
+
cirq.H(cirq.LineQubit(0)),
|
|
344
|
+
cirq.H(cirq.LineQubit(1)),
|
|
345
|
+
cirq.H(cirq.LineQubit(2)),
|
|
346
|
+
cirq.H(cirq.LineQubit(3)),
|
|
347
|
+
cirq.H(cirq.LineQubit(4)),
|
|
348
|
+
cirq.H(cirq.LineQubit(5)),
|
|
349
|
+
cirq.H(cirq.LineQubit(6)),
|
|
350
|
+
),
|
|
351
|
+
cirq.Moment(
|
|
352
|
+
cirq.H(cirq.LineQubit(1)), cirq.H(cirq.LineQubit(3)), cirq.H(cirq.LineQubit(5))
|
|
353
|
+
),
|
|
354
|
+
cirq.Moment(
|
|
355
|
+
cirq.CZ(cirq.LineQubit(0), cirq.LineQubit(1)),
|
|
356
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(3)),
|
|
357
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(5)),
|
|
358
|
+
),
|
|
359
|
+
cirq.Moment(
|
|
360
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(1)),
|
|
361
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(3)),
|
|
362
|
+
cirq.CZ(cirq.LineQubit(6), cirq.LineQubit(5)),
|
|
363
|
+
),
|
|
364
|
+
]
|
|
365
|
+
)
|
|
366
|
+
desired_circuit = cirq.Circuit(
|
|
367
|
+
cirq.PhasedXZGate(axis_phase_exponent=0.5, x_exponent=-0.5, z_exponent=1.0).on(
|
|
368
|
+
cirq.LineQubit(4)
|
|
369
|
+
),
|
|
370
|
+
cirq.PhasedXZGate(axis_phase_exponent=-1.0, x_exponent=1, z_exponent=0).on(
|
|
371
|
+
cirq.LineQubit(1)
|
|
372
|
+
),
|
|
373
|
+
cirq.PhasedXZGate(axis_phase_exponent=-0.5, x_exponent=0.5, z_exponent=0.0).on(
|
|
374
|
+
cirq.LineQubit(2)
|
|
375
|
+
),
|
|
376
|
+
cirq.PhasedXZGate(axis_phase_exponent=0.5, x_exponent=-0.5, z_exponent=1.0).on(
|
|
377
|
+
cirq.LineQubit(0)
|
|
378
|
+
),
|
|
379
|
+
cirq.PhasedXZGate(axis_phase_exponent=-1.0, x_exponent=1, z_exponent=0).on(
|
|
380
|
+
cirq.LineQubit(3)
|
|
381
|
+
),
|
|
382
|
+
cirq.PhasedXZGate(axis_phase_exponent=-0.5, x_exponent=0.5, z_exponent=0.0).on(
|
|
383
|
+
cirq.LineQubit(6)
|
|
384
|
+
),
|
|
385
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(5)),
|
|
386
|
+
cirq.CZ(cirq.LineQubit(0), cirq.LineQubit(1)),
|
|
387
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(3)),
|
|
388
|
+
cirq.CZ(cirq.LineQubit(2), cirq.LineQubit(1)),
|
|
389
|
+
cirq.CZ(cirq.LineQubit(4), cirq.LineQubit(3)),
|
|
390
|
+
cirq.CZ(cirq.LineQubit(6), cirq.LineQubit(5)),
|
|
391
|
+
)
|
|
392
|
+
got = cirq.optimize_for_target_gateset(
|
|
393
|
+
input_circuit, gateset=gateset, max_num_passes=max_num_passes
|
|
394
|
+
)
|
|
395
|
+
cirq.testing.assert_same_circuits(got, desired_circuit)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Base class for creating custom target gatesets which can be used for compilation."""
|
|
16
16
|
|
|
17
|
-
from typing import Optional, List, Hashable, TYPE_CHECKING
|
|
17
|
+
from typing import Optional, List, Hashable, TYPE_CHECKING, Union, Type
|
|
18
18
|
import abc
|
|
19
19
|
|
|
20
20
|
from cirq import circuits, ops, protocols, transformers
|
|
@@ -80,6 +80,27 @@ class CompilationTargetGateset(ops.Gateset, metaclass=abc.ABCMeta):
|
|
|
80
80
|
which can transform any given circuit to contain gates accepted by this gateset.
|
|
81
81
|
"""
|
|
82
82
|
|
|
83
|
+
def __init__(
|
|
84
|
+
self,
|
|
85
|
+
*gates: Union[Type['cirq.Gate'], 'cirq.Gate', 'cirq.GateFamily'],
|
|
86
|
+
name: Optional[str] = None,
|
|
87
|
+
unroll_circuit_op: bool = True,
|
|
88
|
+
preserve_moment_structure: bool = True,
|
|
89
|
+
):
|
|
90
|
+
"""Initializes CompilationTargetGateset.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
*gates: A list of `cirq.Gate` subclasses / `cirq.Gate` instances /
|
|
94
|
+
`cirq.GateFamily` instances to initialize the Gateset.
|
|
95
|
+
name: (Optional) Name for the Gateset. Useful for description.
|
|
96
|
+
unroll_circuit_op: If True, `cirq.CircuitOperation` is recursively
|
|
97
|
+
validated by validating the underlying `cirq.Circuit`.
|
|
98
|
+
preserve_moment_structure: Whether to preserve the moment structure of the
|
|
99
|
+
circuit during compilation or not.
|
|
100
|
+
"""
|
|
101
|
+
super().__init__(*gates, name=name, unroll_circuit_op=unroll_circuit_op)
|
|
102
|
+
self._preserve_moment_structure = preserve_moment_structure
|
|
103
|
+
|
|
83
104
|
@property
|
|
84
105
|
@abc.abstractmethod
|
|
85
106
|
def num_qubits(self) -> int:
|
|
@@ -140,11 +161,14 @@ class CompilationTargetGateset(ops.Gateset, metaclass=abc.ABCMeta):
|
|
|
140
161
|
@property
|
|
141
162
|
def postprocess_transformers(self) -> List['cirq.TRANSFORMER']:
|
|
142
163
|
"""List of transformers which should be run after decomposing individual operations."""
|
|
143
|
-
|
|
164
|
+
processors: List['cirq.TRANSFORMER'] = [
|
|
144
165
|
merge_single_qubit_gates.merge_single_qubit_moments_to_phxz,
|
|
145
166
|
transformers.drop_negligible_operations,
|
|
146
167
|
transformers.drop_empty_moments,
|
|
147
168
|
]
|
|
169
|
+
if not self._preserve_moment_structure:
|
|
170
|
+
processors.append(transformers.stratified_circuit)
|
|
171
|
+
return processors
|
|
148
172
|
|
|
149
173
|
|
|
150
174
|
class TwoQubitCompilationTargetGateset(CompilationTargetGateset):
|
|
@@ -48,6 +48,7 @@ class CZTargetGateset(compilation_target_gateset.TwoQubitCompilationTargetGatese
|
|
|
48
48
|
atol: float = 1e-8,
|
|
49
49
|
allow_partial_czs: bool = False,
|
|
50
50
|
additional_gates: Sequence[Union[Type['cirq.Gate'], 'cirq.Gate', 'cirq.GateFamily']] = (),
|
|
51
|
+
preserve_moment_structure: bool = True,
|
|
51
52
|
) -> None:
|
|
52
53
|
"""Initializes CZTargetGateset
|
|
53
54
|
|
|
@@ -57,6 +58,8 @@ class CZTargetGateset(compilation_target_gateset.TwoQubitCompilationTargetGatese
|
|
|
57
58
|
`cirq.CZ`, are part of this gateset.
|
|
58
59
|
additional_gates: Sequence of additional gates / gate families which should also
|
|
59
60
|
be "accepted" by this gateset. This is empty by default.
|
|
61
|
+
preserve_moment_structure: Whether to preserve the moment structure of the
|
|
62
|
+
circuit during compilation or not.
|
|
60
63
|
"""
|
|
61
64
|
super().__init__(
|
|
62
65
|
ops.CZPowGate if allow_partial_czs else ops.CZ,
|
|
@@ -65,6 +68,7 @@ class CZTargetGateset(compilation_target_gateset.TwoQubitCompilationTargetGatese
|
|
|
65
68
|
ops.GlobalPhaseGate,
|
|
66
69
|
*additional_gates,
|
|
67
70
|
name='CZPowTargetGateset' if allow_partial_czs else 'CZTargetGateset',
|
|
71
|
+
preserve_moment_structure=preserve_moment_structure,
|
|
68
72
|
)
|
|
69
73
|
self.additional_gates = tuple(
|
|
70
74
|
g if isinstance(g, ops.GateFamily) else ops.GateFamily(gate=g) for g in additional_gates
|
{cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.4.0.
|
|
3
|
+
Version: 1.4.0.dev20240203002706
|
|
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.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/RECORD
RENAMED
|
@@ -4,7 +4,7 @@ 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=
|
|
7
|
+
cirq/_version.py,sha256=_oK0Ij5sCSjO6t24BdebXRvmtGUL2E0rip7ZvXy7tZQ,40
|
|
8
8
|
cirq/_version_test.py,sha256=yYS6xm5-nuBRQJa9R3n41WdvFtVyY7Lb5Q8bea3VgBI,133
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=S0HaPOCUIck-vNSQlS6KxnQtle6w-2dGuSxkUbJQY9Y,13168
|
|
@@ -887,7 +887,7 @@ cirq/sim/density_matrix_utils.py,sha256=9Fbzh0c9hzwEff383YwRit2K_tvlpT4Vyq3rjLij
|
|
|
887
887
|
cirq/sim/density_matrix_utils_test.py,sha256=ZJpeolcie9rSIvrWhxcGhzr6Ojyn8me00rfrDwn4y-M,14225
|
|
888
888
|
cirq/sim/mux.py,sha256=ysXjeMddmNaaG3twkGBqJqLLQa_Pm-Y9c6yeGLpYbxo,12469
|
|
889
889
|
cirq/sim/mux_test.py,sha256=uJUUnE9qg10rF0pGWo_bAWhp8JzsmOGW4hFRZeTKwdM,13680
|
|
890
|
-
cirq/sim/simulation_product_state.py,sha256=
|
|
890
|
+
cirq/sim/simulation_product_state.py,sha256=u0GLCgPAmdMhuoVCkQu2rwRrsM3DBQFsYJUXae-2ETs,7076
|
|
891
891
|
cirq/sim/simulation_product_state_test.py,sha256=ajfQcf5QpF40FndpoKetNluRfq6ds91buKFxiTafoXg,8905
|
|
892
892
|
cirq/sim/simulation_state.py,sha256=ARvnXjw6n-GqPV07ZQMC7rLEgm4GDNhdTUItXRZ-TeU,12626
|
|
893
893
|
cirq/sim/simulation_state_base.py,sha256=95FDt2omBxU-3KXwii6KCKMC9MtXRc1ZtnLZRE8vI0o,4196
|
|
@@ -1026,8 +1026,8 @@ cirq/transformers/merge_k_qubit_gates.py,sha256=dUsswQOIHfbb6Lu37fecgrpT6_45zmDE
|
|
|
1026
1026
|
cirq/transformers/merge_k_qubit_gates_test.py,sha256=0zp3FZpoNqUstrHxb7mGRQ79Ld6mV4a_inNqwfw8Wjw,14341
|
|
1027
1027
|
cirq/transformers/merge_single_qubit_gates.py,sha256=NRREV4Z6Ptc3mZnOUgzQePdj4H0aix17WOUwZUB7iQ8,5826
|
|
1028
1028
|
cirq/transformers/merge_single_qubit_gates_test.py,sha256=0U5oitYfOIka1hUOn1Cv8zVK1Uo34DVaOnGMgqfRg4Q,9966
|
|
1029
|
-
cirq/transformers/optimize_for_target_gateset.py,sha256=
|
|
1030
|
-
cirq/transformers/optimize_for_target_gateset_test.py,sha256=
|
|
1029
|
+
cirq/transformers/optimize_for_target_gateset.py,sha256=MxhFsCm2XgW3gdpNW4NGVmz1VdQvzKdNNCtVZDuZiVE,7229
|
|
1030
|
+
cirq/transformers/optimize_for_target_gateset_test.py,sha256=a2z7y7sgeQ2l2xo15b9xMuaSEmNB9_Z9vUyt8fIVXF4,19641
|
|
1031
1031
|
cirq/transformers/qubit_management_transformers.py,sha256=A7Mweu9ElLSCsy_atmgFbYlzOFXKhct5gQ5YNTjjaVU,9430
|
|
1032
1032
|
cirq/transformers/qubit_management_transformers_test.py,sha256=GGuZ4uxtFI59t9diW67_J17XQdBu9NFZjOHeMAHmm8Y,13991
|
|
1033
1033
|
cirq/transformers/stratify.py,sha256=EEcXD6PEdHTZAoaAfaHnsw3Hf1SftbIl19hZOU_ZnXE,10469
|
|
@@ -1082,9 +1082,9 @@ cirq/transformers/routing/route_circuit_cqc_test.py,sha256=gKGIBwftHR6CkUGdZ5z8t
|
|
|
1082
1082
|
cirq/transformers/routing/visualize_routed_circuit.py,sha256=cKYvswXnNIQJ0Okketzkpy9Tw0Z_Y2DaG4cJmK9ouHY,2917
|
|
1083
1083
|
cirq/transformers/routing/visualize_routed_circuit_test.py,sha256=MHL0DTdWCTsS1ayXlaJmBor8UbXo94lhgPKDXc97lRw,5040
|
|
1084
1084
|
cirq/transformers/target_gatesets/__init__.py,sha256=Sy572ZdTcImWcFinPq53rwf1Yxm9S3tpp4mjSCx-_T8,991
|
|
1085
|
-
cirq/transformers/target_gatesets/compilation_target_gateset.py,sha256=
|
|
1085
|
+
cirq/transformers/target_gatesets/compilation_target_gateset.py,sha256=EarJ3_dIkpKzPVGd8898o1_kVH9ISNS8KT2PPUPq6Zk,13535
|
|
1086
1086
|
cirq/transformers/target_gatesets/compilation_target_gateset_test.py,sha256=-3pTUXcNvO-2OigtNco4DtF9jAaKu6SnnXBzlOmhxKU,9538
|
|
1087
|
-
cirq/transformers/target_gatesets/cz_gateset.py,sha256=
|
|
1087
|
+
cirq/transformers/target_gatesets/cz_gateset.py,sha256=5YJVD0uyb6w848_x8Qg5nLYMKyylyWmgDBNtm725oAU,4750
|
|
1088
1088
|
cirq/transformers/target_gatesets/cz_gateset_test.py,sha256=M5rhQPt2XGrX26cvyknTIFGLBqa2jPgg4D0z8rhFogU,10584
|
|
1089
1089
|
cirq/transformers/target_gatesets/sqrt_iswap_gateset.py,sha256=Rtoi2xmhlk_fobf5Hwc1nDQlLtmKPcJm2FJTR8JgpN0,6278
|
|
1090
1090
|
cirq/transformers/target_gatesets/sqrt_iswap_gateset_test.py,sha256=-Oi3b9oX-0_3U9SKAkijVO-uBy4ut4PrFnsx-yFJ9mU,14391
|
|
@@ -1148,8 +1148,8 @@ cirq/work/sampler.py,sha256=JEAeQQRF3bqlO9AkOf4XbrTATDI5f5JgyM_FAUCNxao,19751
|
|
|
1148
1148
|
cirq/work/sampler_test.py,sha256=B2ZsuqGT854gQtBIAh8k0LiG9Vj5wSzcGvkxOUoTcW4,13217
|
|
1149
1149
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1150
1150
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1151
|
-
cirq_core-1.4.0.
|
|
1152
|
-
cirq_core-1.4.0.
|
|
1153
|
-
cirq_core-1.4.0.
|
|
1154
|
-
cirq_core-1.4.0.
|
|
1155
|
-
cirq_core-1.4.0.
|
|
1151
|
+
cirq_core-1.4.0.dev20240203002706.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1152
|
+
cirq_core-1.4.0.dev20240203002706.dist-info/METADATA,sha256=ZCY9qeGHNT-NRK9C4lMd4mYcHfO9-jO20HR5Vcrnj5c,2083
|
|
1153
|
+
cirq_core-1.4.0.dev20240203002706.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
1154
|
+
cirq_core-1.4.0.dev20240203002706.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1155
|
+
cirq_core-1.4.0.dev20240203002706.dist-info/RECORD,,
|
{cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.4.0.dev20240202192938.dist-info → cirq_core-1.4.0.dev20240203002706.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|