pyqrack-cpu 1.52.8__tar.gz → 1.53.1__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.

Potentially problematic release.


This version of pyqrack-cpu might be problematic. Click here for more details.

Files changed (29) hide show
  1. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/MANIFEST.in +1 -0
  2. pyqrack_cpu-1.53.1/Makefile +55 -0
  3. {pyqrack_cpu-1.52.8/pyqrack_cpu.egg-info → pyqrack_cpu-1.53.1}/PKG-INFO +1 -5
  4. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/README.md +0 -4
  5. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyproject.toml +2 -1
  6. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_ace_backend.py +3 -4
  7. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1/pyqrack_cpu.egg-info}/PKG-INFO +1 -5
  8. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack_cpu.egg-info/SOURCES.txt +1 -0
  9. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/setup.py +16 -2
  10. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/LICENSE +0 -0
  11. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/__init__.py +0 -0
  12. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/neuron_activation_fn.py +0 -0
  13. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/pauli.py +0 -0
  14. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_circuit.py +0 -0
  15. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_neuron.py +0 -0
  16. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_neuron_torch_layer.py +0 -0
  17. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_simulator.py +0 -0
  18. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_stabilizer.py +0 -0
  19. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_system/__init__.py +0 -0
  20. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/qrack_system/qrack_system.py +0 -0
  21. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/quimb_circuit_type.py +0 -0
  22. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/stats/__init__.py +0 -0
  23. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/stats/load_quantized_data.py +0 -0
  24. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack/stats/quantize_by_range.py +0 -0
  25. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack_cpu.egg-info/dependency_links.txt +0 -0
  26. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack_cpu.egg-info/not-zip-safe +0 -0
  27. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack_cpu.egg-info/requires.txt +0 -0
  28. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/pyqrack_cpu.egg-info/top_level.txt +0 -0
  29. {pyqrack_cpu-1.52.8 → pyqrack_cpu-1.53.1}/setup.cfg +0 -0
@@ -1,2 +1,3 @@
1
1
  include pyqrack/qrack_system/qrack_lib/*
2
2
  include pyqrack/qrack_system/qrack_cl_precompile/*
3
+ include Makefile
@@ -0,0 +1,55 @@
1
+ PYTHON3 := $(shell which python3 2>/dev/null)
2
+
3
+ PYTHON := python3
4
+
5
+ UNAME_S := $(shell uname -s)
6
+ UNAME_P := $(shell uname -p)
7
+ QRACK_PRESENT := $(wildcard qrack/.)
8
+
9
+ .PHONY: help
10
+ help:
11
+ @echo "Please use \`make <target>' where <target> is one of"
12
+ @echo " build-deps to build PennyLane-Qrack C++ dependencies"
13
+ @echo " install to install PennyLane-Qrack"
14
+ @echo " wheel to build the PennyLane-Qrack wheel"
15
+ @echo " dist to package the source distribution"
16
+
17
+ .PHONY: build-deps
18
+ build-deps:
19
+ ifneq ($(OS),Windows_NT)
20
+ ifeq ($(QRACK_PRESENT),)
21
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout f0738286f49fb0ffaeb46d6e5d2294dbfc7f6138; cd ..
22
+ endif
23
+ mkdir -p qrack/build
24
+ ifeq ($(UNAME_S),Linux)
25
+ ifeq ($(UNAME_P),x86_64)
26
+ cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DQBCAPPOW=8 ..; make qrack_pinvoke qrack_cl_precompile
27
+ else
28
+ cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DQBCAPPOW=8 ..; make qrack_pinvoke qrack_cl_precompile
29
+ endif
30
+ endif
31
+ ifeq ($(UNAME_S),Darwin)
32
+ ifeq ($(UNAME_P),x86_64)
33
+ cd qrack/build; cmake -DQBCAPPOW=8 ..; make qrack_pinvoke qrack_cl_precompile
34
+ else
35
+ cd qrack/build; cmake -DENABLE_OPENCL=OFF -DENABLE_RDRAND=OFF -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DQBCAPPOW=8 ..; make qrack_pinvoke qrack_cl_precompile
36
+ endif
37
+ endif
38
+ endif
39
+ mkdir pyqrack/qrack_system/qrack_lib; cp qrack/build/libqrack_pinvoke.* pyqrack/qrack_system/qrack_lib/; cd ../../..
40
+ mkdir pyqrack/qrack_system/qrack_cl_precompile; cp qrack/build/qrack_cl_precompile pyqrack/qrack_system/qrack_cl_precompile/; cd ../../..
41
+
42
+ .PHONY: install
43
+ install:
44
+ ifndef PYTHON3
45
+ @echo "To install PyQrack you need to have Python 3 installed"
46
+ endif
47
+ $(PYTHON) setup.py install
48
+
49
+ .PHONY: wheel
50
+ wheel:
51
+ $(PYTHON) setup.py bdist_wheel
52
+
53
+ .PHONY: dist
54
+ dist:
55
+ $(PYTHON) setup.py sdist
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.52.8
3
+ Version: 1.53.1
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -62,10 +62,6 @@ This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-c
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
 
65
- (**If you installing from source,** it doesn't matter whether you use `pyqrack` or `pyqrack-cpu`, because the build version of C++ Qrack you intend to use must already be installed locally.)
66
-
67
- **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.
68
-
69
65
  **Performance can benefit greatly from following the [Qrack repository "Quick Start" and "Power user considerations."](https://github.com/unitaryfund/qrack/blob/main/README.md#quick-start)**
70
66
 
71
67
  Import and instantiate [`QrackSimulator`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/qrack_simulator.py) instances. This simulator can perform arbitrary single qubit and controlled-single-qubit gates, as well as other specific gates like `SWAP`.
@@ -9,10 +9,6 @@ This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-c
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
 
12
- (**If you installing from source,** it doesn't matter whether you use `pyqrack` or `pyqrack-cpu`, because the build version of C++ Qrack you intend to use must already be installed locally.)
13
-
14
- **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.
15
-
16
12
  **Performance can benefit greatly from following the [Qrack repository "Quick Start" and "Power user considerations."](https://github.com/unitaryfund/qrack/blob/main/README.md#quick-start)**
17
13
 
18
14
  Import and instantiate [`QrackSimulator`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/qrack_simulator.py) instances. This simulator can perform arbitrary single qubit and controlled-single-qubit gates, as well as other specific gates like `SWAP`.
@@ -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])
@@ -534,8 +533,6 @@ class QrackAceBackend:
534
533
  hq1 = self._unpack(lq1)
535
534
  hq2 = self._unpack(lq2)
536
535
 
537
- self._correct(lq1)
538
-
539
536
  if lq1_lr and lq2_lr:
540
537
  b1 = hq1[0]
541
538
  b2 = hq2[0]
@@ -546,6 +543,8 @@ class QrackAceBackend:
546
543
  shadow(b1, b2)
547
544
  return
548
545
 
546
+ self._correct(lq1)
547
+
549
548
  if (lq2_col in connected_cols) and (connected_cols.index(lq2_col) < boundary):
550
549
  # lq2_col < lq1_col
551
550
  self._encode_decode(hq1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyqrack-cpu
3
- Version: 1.52.8
3
+ Version: 1.53.1
4
4
  Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
5
  Home-page: https://github.com/vm6502q/pyqrack
6
6
  Author: Daniel Strano
@@ -62,10 +62,6 @@ This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-c
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
 
65
- (**If you installing from source,** it doesn't matter whether you use `pyqrack` or `pyqrack-cpu`, because the build version of C++ Qrack you intend to use must already be installed locally.)
66
-
67
- **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.
68
-
69
65
  **Performance can benefit greatly from following the [Qrack repository "Quick Start" and "Power user considerations."](https://github.com/unitaryfund/qrack/blob/main/README.md#quick-start)**
70
66
 
71
67
  Import and instantiate [`QrackSimulator`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/qrack_simulator.py) instances. This simulator can perform arbitrary single qubit and controlled-single-qubit gates, as well as other specific gates like `SWAP`.
@@ -1,5 +1,6 @@
1
1
  LICENSE
2
2
  MANIFEST.in
3
+ Makefile
3
4
  README.md
4
5
  pyproject.toml
5
6
  setup.py
@@ -1,20 +1,34 @@
1
1
  # Adapted from https://github.com/Qiskit/qiskit-aer/blob/master/setup.py
2
2
 
3
3
  import os
4
+ import sys
5
+ import subprocess
4
6
  from setuptools import setup
7
+ from setuptools.command.build_py import build_py
5
8
 
6
9
 
7
- VERSION = "1.52.8"
10
+ VERSION = "1.53.1"
8
11
 
9
12
  # Read long description from README.
10
13
  README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
11
14
  with open(README_PATH) as readme_file:
12
15
  README = readme_file.read()
13
16
 
17
+
18
+ class Build(build_py):
19
+ def run(self):
20
+ protoc_command = ["make", "build-deps"]
21
+ if os.name != "nt":
22
+ if subprocess.call(protoc_command) != 0:
23
+ sys.exit(-1)
24
+ super().run()
25
+
26
+
14
27
  setup(
15
28
  name='pyqrack-cpu',
16
29
  version=VERSION,
17
30
  packages=['pyqrack', 'pyqrack.qrack_system', 'pyqrack.stats'],
31
+ cmdclass={"build_py": Build},
18
32
  description="pyqrack - Pure Python vm6502q/qrack Wrapper",
19
33
  long_description=README,
20
34
  long_description_content_type='text/markdown',
@@ -54,7 +68,7 @@ setup(
54
68
  ],
55
69
  keywords="pyqrack qrack simulator quantum gpu",
56
70
  install_requires=[],
57
- setup_requires=[],
71
+ setup_requires=['cmake'],
58
72
  extras_require={
59
73
  "dev": [
60
74
  "pytest>=7.3.1",
File without changes
File without changes