pyqrack-cpu 1.44.16__py3-none-macosx_13_0_x86_64.whl → 1.44.17__py3-none-macosx_13_0_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.

@@ -154,10 +154,10 @@ class QrackAceBackend:
154
154
  other_bits = [1, 2]
155
155
 
156
156
  max_syndrome = max(syndrome)
157
- error_bit = syndrome.index(max_syndrome)
158
157
  force_syndrome = True
159
158
  if (2 * max_syndrome) >= shots:
160
159
  # There is an error.
160
+ error_bit = syndrome.index(max_syndrome)
161
161
  if error_bit == single_bit:
162
162
  # The stand-alone bit carries the error.
163
163
  self.sim.x(hq[error_bit])
@@ -182,18 +182,39 @@ class QrackAceBackend:
182
182
  # Force the syndrome non-pathological.
183
183
  self.sim.force_m(self._ancilla, False)
184
184
 
185
+ def _correct_if_like_h(self, th, lq):
186
+ while th > math.pi:
187
+ th -= 2 * math.pi
188
+ while th <= -math.pi:
189
+ th += 2 * math.pi
190
+ th = abs(th)
191
+ if (th >= (math.pi / 4)) and (th < (3 * math.pi / 4)):
192
+ self._correct(lq)
193
+
185
194
 
186
195
  def u(self, th, ph, lm, lq):
187
196
  hq = self._unpack(lq)
188
197
  self._decode(hq)
189
198
  self.sim.u(hq[0], th, ph, lm)
190
199
  self._encode(hq)
200
+ while ph > math.pi:
201
+ ph -= 2 * math.pi
202
+ while ph <= -math.pi:
203
+ ph += 2 * math.pi
204
+ while lm > math.pi:
205
+ lm -= 2 * math.pi
206
+ while lm <= -math.pi:
207
+ lm += 2 * math.pi
208
+ if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
209
+ self._correct_if_like_h(th, lq)
191
210
 
192
211
  def r(self, p, th, lq):
193
212
  hq = self._unpack(lq)
194
213
  self._decode(hq)
195
214
  self.sim.r(p, th, hq[0])
196
215
  self._encode(hq)
216
+ if p == Pauli.PauliY:
217
+ self._correct_if_like_h(th, lq)
197
218
 
198
219
  def s(self, lq):
199
220
  hq = self._unpack(lq)
@@ -230,6 +251,7 @@ class QrackAceBackend:
230
251
  self._decode(hq)
231
252
  self.sim.h(hq[0])
232
253
  self._encode(hq)
254
+ self._correct(lq)
233
255
 
234
256
  def t(self, lq):
235
257
  hq = self._unpack(lq)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyqrack-cpu
3
- Version: 1.44.16
3
+ Version: 1.44.17
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=3tBwfCCD-zQjQ2g1EUZdggKdn-3b2uSFTbT7LS0YLaU,785
2
2
  pyqrack/neuron_activation_fn.py,sha256=fQTTFfsvwcot_43Vopacot47IV2Rxk8pelUyuzwpXPs,593
3
3
  pyqrack/pauli.py,sha256=wg500wDOwdIU4lEVJoMmjtbAdmtakZYzLPjdzC2rwUQ,654
4
- pyqrack/qrack_ace_backend.py,sha256=BygCxnOhXkTczFiJz3-zBevj4r5-BamN1xc3j03Sd8M,22972
4
+ pyqrack/qrack_ace_backend.py,sha256=aIQvV6uDLVHAjV4qLsNDk-WyJ8P6TDx5PYVlXcx-6WU,23712
5
5
  pyqrack/qrack_circuit.py,sha256=vDCKGbcEHJDFUKprjCpWgit8lXFnMrPimKHURD2_Hj4,19538
6
6
  pyqrack/qrack_neuron.py,sha256=UiJdjAGB6usjAGHWSosSFCUUeIkhh3MtZbsaxfsIsNw,9043
7
7
  pyqrack/qrack_neuron_torch_layer.py,sha256=Bs5BLC2GFevfSpo_jSJ2AZl-hfDRJmzlGN9pFw1CtoQ,6160
@@ -15,8 +15,8 @@ pyqrack/qrack_system/qrack_lib/libqrack_pinvoke.dylib,sha256=XIvA7sjxSY9_v_bJcch
15
15
  pyqrack/stats/__init__.py,sha256=Hla85my2fY_roR9lIjGBVpEG7ySOTMwjWa8D6-kgCnY,276
16
16
  pyqrack/stats/load_quantized_data.py,sha256=z12u9F7Nt3P-i44nY1xxvso_klS6WIHS3iqq7R2_lqE,1184
17
17
  pyqrack/stats/quantize_by_range.py,sha256=UM0_7jJDdQ7g30cR3UQAxkbzkqrmsy1oUfqg0h11FUY,2270
18
- pyqrack_cpu-1.44.16.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
19
- pyqrack_cpu-1.44.16.dist-info/METADATA,sha256=27Mkgn8iDaL4FoelqwiI12aeThi4nYWzXkeJ-xhK66g,6473
20
- pyqrack_cpu-1.44.16.dist-info/WHEEL,sha256=nZx8s83OrgdDmpcWX-8FgI0sEAjdQimt4SdYsdcCaC8,107
21
- pyqrack_cpu-1.44.16.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
22
- pyqrack_cpu-1.44.16.dist-info/RECORD,,
18
+ pyqrack_cpu-1.44.17.dist-info/LICENSE,sha256=HxB-7SaWTuewAk1nz-3_3FUD6QhgX73kNT_taKVUTq8,1069
19
+ pyqrack_cpu-1.44.17.dist-info/METADATA,sha256=ayQVFI4favo8cGR_P9LMZYfTqrQl8OluObw7wJnLp_4,6473
20
+ pyqrack_cpu-1.44.17.dist-info/WHEEL,sha256=nZx8s83OrgdDmpcWX-8FgI0sEAjdQimt4SdYsdcCaC8,107
21
+ pyqrack_cpu-1.44.17.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
22
+ pyqrack_cpu-1.44.17.dist-info/RECORD,,