pyqrack-cuda 1.52.7__tar.gz → 1.53.0__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 (29) hide show
  1. {pyqrack_cuda-1.52.7/pyqrack_cuda.egg-info → pyqrack_cuda-1.53.0}/PKG-INFO +2 -2
  2. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/README.md +1 -1
  3. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyproject.toml +2 -1
  4. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_ace_backend.py +44 -60
  5. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0/pyqrack_cuda.egg-info}/PKG-INFO +2 -2
  6. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/setup.py +1 -1
  7. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/LICENSE +0 -0
  8. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/MANIFEST.in +0 -0
  9. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/Makefile +0 -0
  10. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/__init__.py +0 -0
  11. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/neuron_activation_fn.py +0 -0
  12. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/pauli.py +0 -0
  13. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_circuit.py +0 -0
  14. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_neuron.py +0 -0
  15. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  16. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_simulator.py +0 -0
  17. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_stabilizer.py +0 -0
  18. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_system/__init__.py +0 -0
  19. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/qrack_system/qrack_system.py +0 -0
  20. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/quimb_circuit_type.py +0 -0
  21. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/stats/__init__.py +0 -0
  22. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/stats/load_quantized_data.py +0 -0
  23. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack/stats/quantize_by_range.py +0 -0
  24. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack_cuda.egg-info/SOURCES.txt +0 -0
  25. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack_cuda.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack_cuda.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack_cuda.egg-info/requires.txt +0 -0
  28. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/pyqrack_cuda.egg-info/top_level.txt +0 -0
  29. {pyqrack_cuda-1.52.7 → pyqrack_cuda-1.53.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.52.7
3
+ Version: 1.53.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -58,7 +58,7 @@ Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator
58
58
 
59
59
  (**PyQrack** is just pure Qrack.)
60
60
 
61
- **Note, if building from source**: You must build and install [unitaryfund/qrack](https://github.com/unitaryfund/qrack) to build the `main` branch from source. CI/CD builds wheels that contain pre-compiled Qrack binaries, and that is the form published on PyPi. **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
61
+ **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
62
62
 
63
63
  **If you're looking for Mac ARM support, use the package `pyqrack`, not `pyqrack-cpu`.** Mac officially "deprecated" OpenCL years ago. Hence, accelerator support is not included in ARM-based Mac wheels, and OpenCL installation is **not** required on these systems, but, if you have a CUDA accelerator on ARM-based Mac, you could try the package `pyqrack-cuda` instead.
64
64
 
@@ -5,7 +5,7 @@ Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator
5
5
 
6
6
  (**PyQrack** is just pure Qrack.)
7
7
 
8
- **Note, if building from source**: You must build and install [unitaryfund/qrack](https://github.com/unitaryfund/qrack) to build the `main` branch from source. CI/CD builds wheels that contain pre-compiled Qrack binaries, and that is the form published on PyPi. **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
8
+ **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
9
9
 
10
10
  **If you're looking for Mac ARM support, use the package `pyqrack`, not `pyqrack-cpu`.** Mac officially "deprecated" OpenCL years ago. Hence, accelerator support is not included in ARM-based Mac wheels, and OpenCL installation is **not** required on these systems, but, if you have a CUDA accelerator on ARM-based Mac, you could try the package `pyqrack-cuda` instead.
11
11
 
@@ -1,6 +1,7 @@
1
1
  [build-system]
2
2
  requires = [
3
3
  "setuptools>=42",
4
- "wheel"
4
+ "wheel",
5
+ "cmake"
5
6
  ]
6
7
  build-backend = "setuptools.build_meta"
@@ -146,8 +146,7 @@ class QrackAceBackend:
146
146
  col_len -= 1
147
147
  row_len = width // col_len
148
148
 
149
- self.col_length = row_len if reverse else col_len
150
- self.row_length = col_len if reverse else row_len
149
+ self.col_length, self.row_length = (row_len, col_len) if reverse else (col_len, row_len)
151
150
 
152
151
  def _ct_pair_prob(self, q1, q2):
153
152
  p1 = self.sim[q1[0]].prob(q1[1])
@@ -220,25 +219,14 @@ class QrackAceBackend:
220
219
  self._qubit_dict[offset + 2],
221
220
  ]
222
221
 
223
- def _encode_decode(self, lq, hq):
222
+ def _encode_decode(self, hq):
224
223
  if len(hq) < 2:
225
224
  return
226
225
  if hq[0][0] == hq[1][0]:
227
- b0 = hq[0]
228
- self.sim[b0[0]].mcx([b0[1]], hq[1][1])
226
+ b = hq[0]
229
227
  else:
230
- b2 = hq[2]
231
- self.sim[b2[0]].mcx([b2[1]], hq[1][1])
232
-
233
- def _encode_decode_half(self, lq, hq, toward_0):
234
- if len(hq) < 2:
235
- return
236
- if toward_0 and (hq[0][0] == hq[1][0]):
237
- b0 = hq[0]
238
- self.sim[b0[0]].mcx([b0[1]], hq[1][1])
239
- elif not toward_0 and (hq[2][0] == hq[1][0]):
240
- b2 = hq[2]
241
- self.sim[b2[0]].mcx([b2[1]], hq[1][1])
228
+ b = hq[2]
229
+ self.sim[b[0]].mcx([b[1]], hq[1][1])
242
230
 
243
231
  def _correct(self, lq, phase=False):
244
232
  if self._is_col_long_range[lq % self.row_length]:
@@ -373,12 +361,12 @@ class QrackAceBackend:
373
361
 
374
362
  if not math.isclose(ph, -lm) and not math.isclose(abs(ph), math.pi / 2):
375
363
  # Produces/destroys superposition
376
- self._encode_decode(lq, hq)
364
+ self._encode_decode(hq)
377
365
  b = hq[0]
378
366
  self.sim[b[0]].u(b[1], th, ph, lm)
379
367
  b = hq[2]
380
368
  self.sim[b[0]].u(b[1], th, ph, lm)
381
- self._encode_decode(lq, hq)
369
+ self._encode_decode(hq)
382
370
  self._correct(lq)
383
371
  else:
384
372
  # Shouldn't produce/destroy superposition
@@ -402,12 +390,12 @@ class QrackAceBackend:
402
390
  self.sim[b[0]].r(p, th, b[1])
403
391
  else:
404
392
  # Produces/destroys superposition
405
- self._encode_decode(lq, hq)
393
+ self._encode_decode(hq)
406
394
  b = hq[0]
407
395
  self.sim[b[0]].r(p, th, b[1])
408
396
  b = hq[2]
409
397
  self.sim[b[0]].r(p, th, b[1])
410
- self._encode_decode(lq, hq)
398
+ self._encode_decode(hq)
411
399
  self._correct(lq)
412
400
 
413
401
  def h(self, lq):
@@ -417,12 +405,12 @@ class QrackAceBackend:
417
405
  self.sim[b[0]].h(b[1])
418
406
  return
419
407
 
420
- self._encode_decode(lq, hq)
408
+ self._encode_decode(hq)
421
409
  b = hq[0]
422
410
  self.sim[b[0]].h(b[1])
423
411
  b = hq[2]
424
412
  self.sim[b[0]].h(b[1])
425
- self._encode_decode(lq, hq)
413
+ self._encode_decode(hq)
426
414
  self._correct(lq)
427
415
 
428
416
  def s(self, lq):
@@ -555,66 +543,62 @@ class QrackAceBackend:
555
543
  shadow(b1, b2)
556
544
  return
557
545
 
546
+ self._correct(lq1)
547
+
558
548
  if (lq2_col in connected_cols) and (connected_cols.index(lq2_col) < boundary):
559
549
  # lq2_col < lq1_col
560
- self._encode_decode_half(lq1, hq1, True)
561
- self._encode_decode_half(lq2, hq2, False)
562
- b = hq1[0]
550
+ self._encode_decode(hq1)
551
+ self._encode_decode(hq2)
552
+ gate, shadow = self._get_gate(pauli, anti, hq1[0][0])
563
553
  if lq1_lr:
564
- self._get_gate(pauli, anti, hq1[0][0])[0]([b[1]], hq2[2][1])
554
+ gate([hq1[0][1]], hq2[2][1])
555
+ shadow(hq1[0], hq2[0])
565
556
  elif lq2_lr:
566
- self._get_gate(pauli, anti, hq2[0][0])[0]([b[1]], hq2[0][1])
557
+ gate([hq1[0][1]], hq2[0][1])
567
558
  else:
568
- self._get_gate(pauli, anti, b[0])[0]([b[1]], hq2[2][1])
569
- self._encode_decode_half(lq2, hq2, False)
570
- self._encode_decode_half(lq1, hq1, True)
559
+ gate([hq1[0][1]], hq2[2][1])
560
+ shadow(hq1[2], hq2[0])
561
+ self._encode_decode(hq2)
562
+ self._encode_decode(hq1)
571
563
  elif lq2_col in connected_cols:
572
564
  # lq1_col < lq2_col
573
- self._encode_decode_half(lq1, hq1, False)
574
- self._encode_decode_half(lq2, hq2, True)
575
- b = hq2[0]
565
+ self._encode_decode(hq1)
566
+ self._encode_decode(hq2)
567
+ gate, shadow = self._get_gate(pauli, anti, hq2[0][0])
576
568
  if lq1_lr:
577
- self._get_gate(pauli, anti, hq1[0][0])[0]([hq1[0][1]], b[1])
569
+ gate([hq1[0][1]], hq2[0][1])
570
+ shadow(hq1[0], hq2[2])
578
571
  elif lq2_lr:
579
- self._get_gate(pauli, anti, hq2[0][0])[0]([hq1[2][1]], b[1])
572
+ gate([hq1[2][1]], hq2[0][1])
580
573
  else:
581
- self._get_gate(pauli, anti, b[0])[0]([hq1[2][1]], b[1])
582
- self._encode_decode_half(lq2, hq2, True)
583
- self._encode_decode_half(lq1, hq1, False)
574
+ gate([hq1[2][1]], hq2[0][1])
575
+ shadow(hq1[0], hq2[2])
576
+ self._encode_decode(hq2)
577
+ self._encode_decode(hq1)
584
578
  elif lq1_col == lq2_col:
585
579
  # Both are in the same boundary column.
580
+ self._encode_decode(hq1)
581
+ self._encode_decode(hq2)
586
582
  b = hq1[0]
587
583
  gate, shadow = self._get_gate(pauli, anti, b[0])
588
584
  gate([b[1]], hq2[0][1])
589
- if (lq1_row & 1) == (lq2_row & 1):
590
- b = hq1[1]
591
- gate, shadow = self._get_gate(pauli, anti, b[0])
592
- gate([b[1]], hq2[1][1])
593
- else:
594
- shadow(hq1[1], hq2[1])
595
585
  b = hq1[2]
596
586
  gate, shadow = self._get_gate(pauli, anti, b[0])
597
587
  gate([b[1]], hq2[2][1])
588
+ self._encode_decode(hq1)
589
+ self._encode_decode(hq2)
598
590
  else:
599
591
  # The qubits have no quantum connection.
600
592
  gate, shadow = self._get_gate(pauli, anti, hq1[0][0])
593
+ self._encode_decode(hq1)
594
+ self._encode_decode(hq2)
595
+ shadow(hq1[0], hq2[0])
601
596
  if lq1_lr:
602
- connected01 = (hq2[0][0] == hq2[1][0])
603
- self._encode_decode(lq2, hq2)
604
- shadow(hq1[0], hq2[0] if connected01 else hq2[2])
605
- self._encode_decode(lq2, hq2)
606
- elif lq2_lr:
607
- connected01 = (hq1[0][0] == hq1[1][0])
608
- self._encode_decode(lq1, hq1)
609
- shadow(hq1[0] if connected01 else hq1[2], hq2[0])
610
- self._encode_decode(lq1, hq1)
611
- else:
612
- self._encode_decode(lq1, hq1)
613
- self._encode_decode(lq2, hq2)
614
- shadow(hq1[0], hq2[0])
597
+ shadow(hq1[0], hq2[2])
598
+ elif not lq2_lr:
615
599
  shadow(hq1[2], hq2[2])
616
- self._encode_decode(lq2, hq2)
617
- self._encode_decode(lq1, hq1)
600
+ self._encode_decode(hq2)
601
+ self._encode_decode(hq1)
618
602
 
619
603
  self._correct(lq1, True)
620
604
  if pauli != Pauli.PauliZ:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cuda
3
- Version: 1.52.7
3
+ Version: 1.53.0
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -58,7 +58,7 @@ Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator
58
58
 
59
59
  (**PyQrack** is just pure Qrack.)
60
60
 
61
- **Note, if building from source**: You must build and install [unitaryfund/qrack](https://github.com/unitaryfund/qrack) to build the `main` branch from source. CI/CD builds wheels that contain pre-compiled Qrack binaries, and that is the form published on PyPi. **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
61
+ **For PyQrack-CUDA, the package is distributed as source-only on PyPi, so that the Qrack build step can do its best to try to automatically detect your available CUDA architectures.**
62
62
 
63
63
  **If you're looking for Mac ARM support, use the package `pyqrack`, not `pyqrack-cpu`.** Mac officially "deprecated" OpenCL years ago. Hence, accelerator support is not included in ARM-based Mac wheels, and OpenCL installation is **not** required on these systems, but, if you have a CUDA accelerator on ARM-based Mac, you could try the package `pyqrack-cuda` instead.
64
64
 
@@ -7,7 +7,7 @@ from setuptools import setup
7
7
  from setuptools.command.build_py import build_py
8
8
 
9
9
 
10
- VERSION = "1.52.7"
10
+ VERSION = "1.53.0"
11
11
 
12
12
  # Read long description from README.
13
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
File without changes
File without changes
File without changes
File without changes