stimcirq 1.15.dev1737498006__tar.gz → 1.15.dev1737977492__tar.gz

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.
Files changed (32) hide show
  1. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/PKG-INFO +1 -1
  2. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/setup.py +1 -1
  3. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/__init__.py +1 -1
  4. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cirq_to_stim_test.py +13 -1
  5. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_measure_and_or_reset_gate.py +4 -2
  6. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq.egg-info/PKG-INFO +1 -1
  7. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/README.md +0 -0
  8. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/setup.cfg +0 -0
  9. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cirq_to_stim.py +0 -0
  10. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cx_swap_gate.py +0 -0
  11. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cx_swap_test.py +0 -0
  12. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cz_swap_gate.py +0 -0
  13. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_cz_swap_test.py +0 -0
  14. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_det_annotation.py +0 -0
  15. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_det_annotation_test.py +0 -0
  16. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_measure_and_or_reset_gate_test.py +0 -0
  17. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_obs_annotation.py +0 -0
  18. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_obs_annotation_test.py +0 -0
  19. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_shift_coords_annotation.py +0 -0
  20. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_shift_coords_annotation_test.py +0 -0
  21. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_stim_sampler.py +0 -0
  22. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_stim_sampler_test.py +0 -0
  23. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_stim_to_cirq.py +0 -0
  24. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_stim_to_cirq_test.py +0 -0
  25. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_sweep_pauli.py +0 -0
  26. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_sweep_pauli_test.py +0 -0
  27. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_two_qubit_asymmetric_depolarize.py +0 -0
  28. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq/_two_qubit_asymmetric_depolarize_test.py +0 -0
  29. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq.egg-info/SOURCES.txt +0 -0
  30. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq.egg-info/dependency_links.txt +0 -0
  31. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq.egg-info/requires.txt +0 -0
  32. {stimcirq-1.15.dev1737498006 → stimcirq-1.15.dev1737977492}/stimcirq.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: stimcirq
3
- Version: 1.15.dev1737498006
3
+ Version: 1.15.dev1737977492
4
4
  Summary: Implements a cirq.Sampler backed by stim.
5
5
  Home-page: https://github.com/quantumlib/stim
6
6
  Author: Craig Gidney
@@ -17,7 +17,7 @@ from setuptools import setup
17
17
  with open('README.md', encoding='UTF-8') as f:
18
18
  long_description = f.read()
19
19
 
20
- __version__ = '1.15.dev1737498006'
20
+ __version__ = '1.15.dev1737977492'
21
21
 
22
22
  setup(
23
23
  name='stimcirq',
@@ -1,4 +1,4 @@
1
- __version__ = '1.15.dev1737498006'
1
+ __version__ = '1.15.dev1737977492'
2
2
  from ._cirq_to_stim import cirq_circuit_to_stim_circuit
3
3
  from ._cx_swap_gate import CXSwapGate
4
4
  from ._cz_swap_gate import CZSwapGate
@@ -377,7 +377,7 @@ def test_on_tagged_loop():
377
377
  repetitions=3,
378
378
  ).with_tags('my_tag')
379
379
  )
380
-
380
+
381
381
  stim_circuit = stimcirq.cirq_circuit_to_stim_circuit(c)
382
382
  assert stim.CircuitRepeatBlock in {type(instr) for instr in stim_circuit}
383
383
 
@@ -410,3 +410,15 @@ def test_custom_tagging():
410
410
  H[PAIR] 0
411
411
  TICK
412
412
  """)
413
+
414
+
415
+ def test_round_trip_example_circuit():
416
+ stim_circuit = stim.Circuit.generated(
417
+ "surface_code:rotated_memory_x",
418
+ distance=3,
419
+ rounds=1,
420
+ after_clifford_depolarization=0.01,
421
+ )
422
+ cirq_circuit = stimcirq.stim_circuit_to_cirq_circuit(stim_circuit.flattened())
423
+ circuit_back = stimcirq.cirq_circuit_to_stim_circuit(cirq_circuit)
424
+ assert len(circuit_back.shortest_graphlike_error()) == 3
@@ -1,4 +1,4 @@
1
- from typing import Any, Dict, List
1
+ from typing import Any, Dict, List, Tuple
2
2
 
3
3
  import cirq
4
4
  import stim
@@ -91,7 +91,9 @@ class MeasureAndOrResetGate(cirq.Gate):
91
91
  result += self.basis
92
92
  return result
93
93
 
94
- def _stim_conversion_(self, *, edit_circuit: stim.Circuit, targets: List[int], tag: str, **kwargs):
94
+ def _stim_conversion_(self, *, edit_circuit: stim.Circuit, targets: List[int], tag: str, edit_measurement_key_lengths: List[Tuple[str, int]], **kwargs):
95
+ if self.measure:
96
+ edit_measurement_key_lengths.append((self.key, 1))
95
97
  if self.invert_measure:
96
98
  targets[0] = stim.target_inv(targets[0])
97
99
  if self.measure_flip_probability:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: stimcirq
3
- Version: 1.15.dev1737498006
3
+ Version: 1.15.dev1737977492
4
4
  Summary: Implements a cirq.Sampler backed by stim.
5
5
  Home-page: https://github.com/quantumlib/stim
6
6
  Author: Craig Gidney