pyqrack-cpu 1.44.3__py3-none-manylinux_2_39_x86_64.whl → 1.44.5__py3-none-manylinux_2_39_x86_64.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 pyqrack-cpu might be problematic. Click here for more details.

@@ -24,24 +24,41 @@ class QrackAceBackend:
24
24
  """A back end for elided quantum error correction
25
25
 
26
26
  This back end uses elided repetition code on a nearest-neighbor topology to emulate
27
- a utility-scale superconducting chip quantum computer in very little memory.
27
+ a utility-scale superconducting chip quantum computer in very little memory.4
28
28
 
29
29
  The backend was originally designed assuming a 2D qubit grid like 2019 Sycamore.
30
30
  However, it quickly became apparent that users can basically design their own
31
31
  connectivity topologies, without breaking the concept. (Not all will work equally well.)
32
+ For maximum flexibility, set "alternating_codes=False". (For best performance on
33
+ Sycamore-like topologies, leave it "True.")
32
34
 
33
35
  Attributes:
34
36
  sim(QrackSimulator): Corresponding simulator.
37
+ alternating_codes(bool): Alternate repetition code elision by index?
38
+ row_length(int): Qubits per row.
39
+ col_length(int): Qubits per column.
35
40
  """
36
41
 
37
42
  def __init__(
38
43
  self,
39
44
  qubit_count=-1,
45
+ alternating_codes=True,
40
46
  toClone=None
41
47
  ):
42
48
  self.sim = toClone.sim.clone() if toClone else QrackSimulator(3 * qubit_count)
49
+ self._factor_width(qubit_count)
50
+ self.alternating_codes = alternating_codes
43
51
 
44
52
 
53
+ def _factor_width(self, width):
54
+ col_len = math.floor(math.sqrt(width))
55
+ while (((width // col_len) * col_len) != width):
56
+ col_len -= 1
57
+ row_len = width // col_len
58
+
59
+ self.col_length = col_len
60
+ self.row_length = row_len
61
+
45
62
  def _ct_pair_prob(self, q1, q2):
46
63
  p1 = self.sim.prob(q1)
47
64
  p2 = self.sim.prob(q2)
@@ -93,7 +110,9 @@ class QrackAceBackend:
93
110
 
94
111
 
95
112
  def _encode(self, hq, reverse = False):
96
- if reverse:
113
+ row = (hq[0] // 3) // self.row_length
114
+ even_row = not (row & 1)
115
+ if ((not self.alternating_codes) and reverse) or (even_row == reverse):
97
116
  self._cx_shadow(hq[0], hq[1])
98
117
  self.sim.mcx([hq[1]], hq[2])
99
118
  else:
@@ -102,7 +121,9 @@ class QrackAceBackend:
102
121
 
103
122
 
104
123
  def _decode(self, hq, reverse = False):
105
- if reverse:
124
+ row = (hq[0] // 3) // self.row_length
125
+ even_row = not (row & 1)
126
+ if ((not self.alternating_codes) and reverse) or (even_row == reverse):
106
127
  self.sim.mcx([hq[1]], hq[2])
107
128
  self._cx_shadow(hq[0], hq[1])
108
129
  else:
@@ -182,12 +203,16 @@ class QrackAceBackend:
182
203
 
183
204
  def _cpauli(self, lq1, lq2, anti, pauli):
184
205
  gate = None
206
+ shadow = None
185
207
  if pauli == Pauli.PauliX:
186
208
  gate = self.sim.macx if anti else self.sim.mcx
209
+ shadow = self._anti_cx_shadow if anti else self._cx_shadow
187
210
  elif pauli == Pauli.PauliY:
188
211
  gate = self.sim.macy if anti else self.sim.mcy
212
+ shadow = self._anti_cy_shadow if anti else self._cy_shadow
189
213
  elif pauli == Pauli.PauliZ:
190
214
  gate = self.sim.macz if anti else self.sim.mcz
215
+ shadow = self._anti_cz_shadow if anti else self._cz_shadow
191
216
  else:
192
217
  return
193
218
 
@@ -211,7 +236,10 @@ class QrackAceBackend:
211
236
  hq1 = self._unpack(lq1)
212
237
  hq2 = self._unpack(lq2)
213
238
  gate([hq1[0]], hq2[0])
214
- gate([hq1[1]], hq2[1])
239
+ if self.alternating_codes:
240
+ shadow(hq1[1], hq2[1])
241
+ else:
242
+ gate([hq1[1]], hq2[1])
215
243
  gate([hq1[2]], hq2[2])
216
244
 
217
245
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.44.3
3
+ Version: 1.44.5
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -1,7 +1,7 @@
1
1
  pyqrack/__init__.py,sha256=yH4CMEDLk59IphSl9303zTP8Pmj3usIQMSDCOb42KCc,768
2
2
  pyqrack/neuron_activation_fn.py,sha256=NYG78IFCiJ586E9oA6lJl38Rl18_WFfcdL6I2NYfiPs,594
3
3
  pyqrack/pauli.py,sha256=wg500wDOwdIU4lEVJoMmjtbAdmtakZYzLPjdzC2rwUQ,654
4
- pyqrack/qrack_ace_backend.py,sha256=ykDnNIKrPUbmfyhmH7gt1DUxY2x-HCYCfsdHPlxNZc0,18822
4
+ pyqrack/qrack_ace_backend.py,sha256=Ho4VNp0s9JYxxbqG2n4rGy7AMect3jJTHMOMNLVo1d8,20124
5
5
  pyqrack/qrack_circuit.py,sha256=TyppOMNk_0nolChMRewf4CfQGuYiEUJ8qUWWN6y03PE,19093
6
6
  pyqrack/qrack_neuron.py,sha256=oEvMnkFFOUBXFbIXYYY-Nir3yTo0nyw_xoRdNXeSEgk,8843
7
7
  pyqrack/qrack_neuron_torch_layer.py,sha256=Xn6MF1hSLT0bFequx4AJTsxFdg3gO01WB9rmDE7sP9w,5824
@@ -10,13 +10,13 @@ pyqrack/qrack_stabilizer.py,sha256=CJhj8GLPH-ZM38joHr9ZL-6_IY2JC8Zql7COoePJC0U,2
10
10
  pyqrack/quimb_circuit_type.py,sha256=Sk-Tmn38kUYmAkJJ75btWuhYZyTXOOezmowFhfdiGDc,621
11
11
  pyqrack/qrack_system/__init__.py,sha256=-oZ9dsb1hixsnrkUJRY_C5DzQ_l6MtifF_Z465BgqV4,334
12
12
  pyqrack/qrack_system/qrack_system.py,sha256=gEy-E8O-wyRi2lVTCkEN84fsSOpMsCNcEUgSfLAPVe8,41934
13
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=jGH5FdZqL24sYRJhowncDgneLi0fpOai52kTANzRDKQ,3530824
14
- pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.19.1,sha256=jGH5FdZqL24sYRJhowncDgneLi0fpOai52kTANzRDKQ,3530824
13
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so,sha256=L0WTaxtmEMY90fEJzmTMcGQ8RtCWlRPrsF3KjV_j0XA,3531080
14
+ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.so.9.19.2,sha256=L0WTaxtmEMY90fEJzmTMcGQ8RtCWlRPrsF3KjV_j0XA,3531080
15
15
  pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
16
16
  pyqrack/stats/load_quantized_data.py,sha256=10-ZULlnSX45br7fDtJuiCzcMTAL4eI3QyhSENXZjgM,1162
17
17
  pyqrack/stats/quantize_by_range.py,sha256=OjY0I8PGbellrRfdIyiC0RLdpdbbJex3C2D_bapNIqE,2211
18
- pyqrack_cpu-1.44.3.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
19
- pyqrack_cpu-1.44.3.dist-info/METADATA,sha256=82j10VVOmVODwsNNvoeT3uDKuqXxc-maqobu3yHVXoQ,6702
20
- pyqrack_cpu-1.44.3.dist-info/WHEEL,sha256=doDm-6Syt8k_BJ5JAagnRBCT6Lp00BS6WvJ8r832rUs,109
21
- pyqrack_cpu-1.44.3.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
22
- pyqrack_cpu-1.44.3.dist-info/RECORD,,
18
+ pyqrack_cpu-1.44.5.dist-info/licenses/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
19
+ pyqrack_cpu-1.44.5.dist-info/METADATA,sha256=ITY50UMEsdO1-Vogo-umv5wBfa2ALL0UcWzXC9LBhU8,6702
20
+ pyqrack_cpu-1.44.5.dist-info/WHEEL,sha256=g7_LICffffjPhI1CCJLD98zC0tVFxpB8H2tcQ-OnOG8,109
21
+ pyqrack_cpu-1.44.5.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
22
+ pyqrack_cpu-1.44.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-manylinux_2_39_x86_64
5
5