pyqrack-cpu 1.34.7__tar.gz → 1.38.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 (24) hide show
  1. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/LICENSE +21 -21
  2. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/MANIFEST.in +2 -2
  3. {pyqrack_cpu-1.34.7/pyqrack_cpu.egg-info → pyqrack_cpu-1.38.1}/PKG-INFO +95 -82
  4. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/README.md +42 -40
  5. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyproject.toml +6 -6
  6. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/__init__.py +12 -13
  7. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/neuron_activation_fn.py +21 -21
  8. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/pauli.py +19 -19
  9. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/qrack_circuit.py +556 -556
  10. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/qrack_neuron.py +244 -244
  11. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/qrack_simulator.py +4016 -4019
  12. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/qrack_system/__init__.py +9 -9
  13. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/qrack_system/qrack_system.py +1283 -1283
  14. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack/quimb_circuit_type.py +17 -17
  15. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1/pyqrack_cpu.egg-info}/PKG-INFO +95 -82
  16. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack_cpu.egg-info/SOURCES.txt +0 -2
  17. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack_cpu.egg-info/not-zip-safe +1 -1
  18. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/setup.cfg +4 -4
  19. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/setup.py +65 -65
  20. pyqrack_cpu-1.34.7/pyqrack/util/__init__.py +0 -8
  21. pyqrack_cpu-1.34.7/pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py +0 -61
  22. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack_cpu.egg-info/dependency_links.txt +0 -0
  23. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack_cpu.egg-info/requires.txt +0 -0
  24. {pyqrack_cpu-1.34.7 → pyqrack_cpu-1.38.1}/pyqrack_cpu.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021-2023 vm6502q
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021-2023 vm6502q
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,2 +1,2 @@
1
- include pyqrack/qrack_system/qrack_lib/*
2
- include pyqrack/qrack_system/qrack_cl_precompile/*
1
+ include pyqrack/qrack_system/qrack_lib/*
2
+ include pyqrack/qrack_system/qrack_cl_precompile/*
@@ -1,82 +1,95 @@
1
- Metadata-Version: 2.1
2
- Name: pyqrack-cpu
3
- Version: 1.34.7
4
- Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
- Home-page: https://github.com/vm6502q/pyqrack
6
- Author: Daniel Strano
7
- Author-email: dan@unitary.fund
8
- License: MIT
9
- Keywords: pyqrack qrack simulator quantum gpu
10
- Classifier: Environment :: Console
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: Operating System :: Microsoft :: Windows
14
- Classifier: Operating System :: MacOS
15
- Classifier: Operating System :: POSIX :: Linux
16
- Classifier: Programming Language :: C++
17
- Classifier: Programming Language :: Python :: 2
18
- Classifier: Programming Language :: Python :: 2.3
19
- Classifier: Programming Language :: Python :: 2.4
20
- Classifier: Programming Language :: Python :: 2.5
21
- Classifier: Programming Language :: Python :: 2.6
22
- Classifier: Programming Language :: Python :: 2.7
23
- Classifier: Programming Language :: Python :: 3
24
- Classifier: Programming Language :: Python :: 3.0
25
- Classifier: Programming Language :: Python :: 3.1
26
- Classifier: Programming Language :: Python :: 3.2
27
- Classifier: Programming Language :: Python :: 3.3
28
- Classifier: Programming Language :: Python :: 3.4
29
- Classifier: Programming Language :: Python :: 3.5
30
- Classifier: Programming Language :: Python :: 3.6
31
- Classifier: Programming Language :: Python :: 3.7
32
- Classifier: Programming Language :: Python :: 3.8
33
- Classifier: Programming Language :: Python :: 3.9
34
- Classifier: Programming Language :: Python :: 3.10
35
- Classifier: Programming Language :: Python :: 3.11
36
- Classifier: Programming Language :: Python :: 3.12
37
- Classifier: Topic :: Scientific/Engineering
38
- Description-Content-Type: text/markdown
39
- License-File: LICENSE
40
- Provides-Extra: dev
41
- Requires-Dist: pytest>=7.3.1; extra == "dev"
42
-
43
- # pyqrack
44
- [![Downloads](https://pepy.tech/badge/pyqrack-cpu)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://pepy.tech/badge/pyqrack-cpu/month)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://static.pepy.tech/badge/pyqrack-cpu/week)](https://pepy.tech/project/pyqrack-cpu)
45
-
46
- Pure Python bindings for the pure C++11 Qrack quantum computer simulator library
47
-
48
- (**PyQrack** is just pure Qrack.)
49
-
50
- <<<<<<< HEAD
51
- This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-cpu`). This alternate build of PyQrack is provided so that systems that won't use OpenCL anyway (such as because they lack any GPUs or other accelerators like the Intel HD) do not need to install the OpenCL library in order to use PyQrack. In this form, both the PyQrack module and the underlying C++ Qrack library are entirely external **dependency-free.**
52
-
53
- (**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.)
54
- =======
55
- **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. **You must also install OpenCL.**
56
- >>>>>>> main
57
-
58
- 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`.
59
-
60
- Any 2x2 bit operator matrix is represented by a list of 4 `complex` floating point numbers, in [**row-major order**](https://en.wikipedia.org/wiki/Row-_and_column-major_order).
61
-
62
- Single and array "`b`" parameters represent [**Pauli operator bases**](https://en.wikipedia.org/wiki/Pauli_matrices). They are specified according to the enumeration of the [`Pauli`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/pauli.py) class.
63
-
64
- `MC[x]` and `MAC[x]` methods are controlled single bit gates, with as many control qubits as you specify via Python list `c` argument. `MCX` is multiply-controlled Pauli X, and `MACX` is "anti-"controlled Pauli X, i.e. "anti-control" activates the gate if all control bits are specifically **off**, as opposed to **on**.
65
-
66
- To load the required **unitaryfund/qrack** libraries from a different location, set the `PYQRACK_SHARED_LIB_PATH` environment variable.
67
-
68
- PyQrack has experimental support for [PyZX](https://github.com/Quantomatic/pyzx) `Circuit` definitions as an intermediate representation for `QrackSimulator`. To try this, load a `Circuit` in PyZX, (use that module to optimize your circuit, as you like,) and create a `QrackSimulator()` instance using the `pyzxCircuit` named argument of the constructor, like so:
69
-
70
- ```python
71
- sim = QrackSimulator(pyzxCircuit=c)
72
- ```
73
-
74
- where `c` is a PyZX circuit object. The circuit will automatically be simulated in the constructed `QrackSimulator` instance. This also allows loading from QASM and other intermediate representations supported by PyZX.
75
-
76
- See [https://pyqrack.readthedocs.io/en/latest/](https://pyqrack.readthedocs.io/en/latest/) for an API reference.
77
-
78
- For custom Qrack build floating-point precision, where options are `half`, `float`, `double`, and `quad`, set an environment variable via `export QRACK_FPPOW=[n]` (or as appropriate to your shell) where `[n]` is the logarithm base 2 of the number of bits in the systemic floating point type (`4`, `5`, `6`, or `7`, with `5` or `float` as default, i.e. `2**5=32` for 32-bit `float`). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.
79
-
80
- Please feel welcome to open an issue, if you'd like help. 😃
81
-
82
- **Special thanks go to Zeeshan Ahmed, for bug fixes and design suggestions, Ashish Panigrahi, for documentation and design suggestions, WingCode, for documentation, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!**
1
+ Metadata-Version: 2.4
2
+ Name: pyqrack-cpu
3
+ Version: 1.38.1
4
+ Summary: pyqrack - Pure Python vm6502q/qrack Wrapper
5
+ Home-page: https://github.com/vm6502q/pyqrack
6
+ Author: Daniel Strano
7
+ Author-email: dan@unitary.fund
8
+ License: MIT
9
+ Keywords: pyqrack qrack simulator quantum gpu
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: C++
17
+ Classifier: Programming Language :: Python :: 2
18
+ Classifier: Programming Language :: Python :: 2.3
19
+ Classifier: Programming Language :: Python :: 2.4
20
+ Classifier: Programming Language :: Python :: 2.5
21
+ Classifier: Programming Language :: Python :: 2.6
22
+ Classifier: Programming Language :: Python :: 2.7
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.0
25
+ Classifier: Programming Language :: Python :: 3.1
26
+ Classifier: Programming Language :: Python :: 3.2
27
+ Classifier: Programming Language :: Python :: 3.3
28
+ Classifier: Programming Language :: Python :: 3.4
29
+ Classifier: Programming Language :: Python :: 3.5
30
+ Classifier: Programming Language :: Python :: 3.6
31
+ Classifier: Programming Language :: Python :: 3.7
32
+ Classifier: Programming Language :: Python :: 3.8
33
+ Classifier: Programming Language :: Python :: 3.9
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Topic :: Scientific/Engineering
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest>=7.3.1; extra == "dev"
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: keywords
49
+ Dynamic: license
50
+ Dynamic: license-file
51
+ Dynamic: provides-extra
52
+ Dynamic: summary
53
+
54
+ # pyqrack
55
+ [![Downloads](https://pepy.tech/badge/pyqrack-cpu)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://pepy.tech/badge/pyqrack-cpu/month)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://static.pepy.tech/badge/pyqrack-cpu/week)](https://pepy.tech/project/pyqrack-cpu)
56
+
57
+ Pure Python bindings for the pure C++11 Qrack quantum computer simulator library
58
+
59
+ (**PyQrack** is just pure Qrack.)
60
+
61
+ This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-cpu`). This alternate build of PyQrack is provided so that systems that won't use OpenCL or CUDA anyway (such as because they lack any GPUs or other accelerators like the Intel HD) do not need to install the OpenCL library in order to use PyQrack. In this form, both the PyQrack module and the underlying C++ Qrack library are entirely external **dependency-free.**
62
+
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
+
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
+ **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
+
71
+ 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`.
72
+
73
+ Any 2x2 bit operator matrix is represented by a list of 4 `complex` floating point numbers, in [**row-major order**](https://en.wikipedia.org/wiki/Row-_and_column-major_order).
74
+
75
+ Single and array "`b`" parameters represent [**Pauli operator bases**](https://en.wikipedia.org/wiki/Pauli_matrices). They are specified according to the enumeration of the [`Pauli`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/pauli.py) class.
76
+
77
+ `MC[x]` and `MAC[x]` methods are controlled single bit gates, with as many control qubits as you specify via Python list `c` argument. `MCX` is multiply-controlled Pauli X, and `MACX` is "anti-"controlled Pauli X, i.e. "anti-control" activates the gate if all control bits are specifically **off**, as opposed to **on**.
78
+
79
+ To load the required **unitaryfund/qrack** libraries from a different location, set the `PYQRACK_SHARED_LIB_PATH` environment variable.
80
+
81
+ PyQrack has experimental support for [PyZX](https://github.com/Quantomatic/pyzx) `Circuit` definitions as an intermediate representation for `QrackSimulator`. To try this, load a `Circuit` in PyZX, (use that module to optimize your circuit, as you like,) and create a `QrackSimulator()` instance using the `pyzxCircuit` named argument of the constructor, like so:
82
+
83
+ ```python
84
+ sim = QrackSimulator(pyzxCircuit=c)
85
+ ```
86
+
87
+ where `c` is a PyZX circuit object. The circuit will automatically be simulated in the constructed `QrackSimulator` instance. This also allows loading from QASM and other intermediate representations supported by PyZX.
88
+
89
+ See [https://pyqrack.readthedocs.io/en/latest/](https://pyqrack.readthedocs.io/en/latest/) for an API reference.
90
+
91
+ For custom Qrack build floating-point precision, where options are `half`, `float`, `double`, and `quad`, set an environment variable via `export QRACK_FPPOW=[n]` (or as appropriate to your shell) where `[n]` is the logarithm base 2 of the number of bits in the systemic floating point type (`4`, `5`, `6`, or `7`, with `5` or `float` as default, i.e. `2**5=32` for 32-bit `float`). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.
92
+
93
+ Please feel welcome to open an issue, if you'd like help. 😃
94
+
95
+ **Special thanks go to Zeeshan Ahmed, for bug fixes and design suggestions, Ashish Panigrahi, for documentation and design suggestions, WingCode, for documentation, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!**
@@ -1,40 +1,42 @@
1
- # pyqrack
2
- [![Downloads](https://pepy.tech/badge/pyqrack-cpu)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://pepy.tech/badge/pyqrack-cpu/month)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://static.pepy.tech/badge/pyqrack-cpu/week)](https://pepy.tech/project/pyqrack-cpu)
3
-
4
- Pure Python bindings for the pure C++11 Qrack quantum computer simulator library
5
-
6
- (**PyQrack** is just pure Qrack.)
7
-
8
- <<<<<<< HEAD
9
- This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-cpu`). This alternate build of PyQrack is provided so that systems that won't use OpenCL anyway (such as because they lack any GPUs or other accelerators like the Intel HD) do not need to install the OpenCL library in order to use PyQrack. In this form, both the PyQrack module and the underlying C++ Qrack library are entirely external **dependency-free.**
10
-
11
- (**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.)
12
- =======
13
- **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. **You must also install OpenCL.**
14
- >>>>>>> main
15
-
16
- 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`.
17
-
18
- Any 2x2 bit operator matrix is represented by a list of 4 `complex` floating point numbers, in [**row-major order**](https://en.wikipedia.org/wiki/Row-_and_column-major_order).
19
-
20
- Single and array "`b`" parameters represent [**Pauli operator bases**](https://en.wikipedia.org/wiki/Pauli_matrices). They are specified according to the enumeration of the [`Pauli`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/pauli.py) class.
21
-
22
- `MC[x]` and `MAC[x]` methods are controlled single bit gates, with as many control qubits as you specify via Python list `c` argument. `MCX` is multiply-controlled Pauli X, and `MACX` is "anti-"controlled Pauli X, i.e. "anti-control" activates the gate if all control bits are specifically **off**, as opposed to **on**.
23
-
24
- To load the required **unitaryfund/qrack** libraries from a different location, set the `PYQRACK_SHARED_LIB_PATH` environment variable.
25
-
26
- PyQrack has experimental support for [PyZX](https://github.com/Quantomatic/pyzx) `Circuit` definitions as an intermediate representation for `QrackSimulator`. To try this, load a `Circuit` in PyZX, (use that module to optimize your circuit, as you like,) and create a `QrackSimulator()` instance using the `pyzxCircuit` named argument of the constructor, like so:
27
-
28
- ```python
29
- sim = QrackSimulator(pyzxCircuit=c)
30
- ```
31
-
32
- where `c` is a PyZX circuit object. The circuit will automatically be simulated in the constructed `QrackSimulator` instance. This also allows loading from QASM and other intermediate representations supported by PyZX.
33
-
34
- See [https://pyqrack.readthedocs.io/en/latest/](https://pyqrack.readthedocs.io/en/latest/) for an API reference.
35
-
36
- For custom Qrack build floating-point precision, where options are `half`, `float`, `double`, and `quad`, set an environment variable via `export QRACK_FPPOW=[n]` (or as appropriate to your shell) where `[n]` is the logarithm base 2 of the number of bits in the systemic floating point type (`4`, `5`, `6`, or `7`, with `5` or `float` as default, i.e. `2**5=32` for 32-bit `float`). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.
37
-
38
- Please feel welcome to open an issue, if you'd like help. 😃
39
-
40
- **Special thanks go to Zeeshan Ahmed, for bug fixes and design suggestions, Ashish Panigrahi, for documentation and design suggestions, WingCode, for documentation, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!**
1
+ # pyqrack
2
+ [![Downloads](https://pepy.tech/badge/pyqrack-cpu)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://pepy.tech/badge/pyqrack-cpu/month)](https://pepy.tech/project/pyqrack-cpu) [![Downloads](https://static.pepy.tech/badge/pyqrack-cpu/week)](https://pepy.tech/project/pyqrack-cpu)
3
+
4
+ Pure Python bindings for the pure C++11 Qrack quantum computer simulator library
5
+
6
+ (**PyQrack** is just pure Qrack.)
7
+
8
+ This is the **purely CPU-based** variant of PyQrack (with module name `pyqrack-cpu`). This alternate build of PyQrack is provided so that systems that won't use OpenCL or CUDA anyway (such as because they lack any GPUs or other accelerators like the Intel HD) do not need to install the OpenCL library in order to use PyQrack. In this form, both the PyQrack module and the underlying C++ Qrack library are entirely external **dependency-free.**
9
+
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
+
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
+ **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
+
18
+ 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`.
19
+
20
+ Any 2x2 bit operator matrix is represented by a list of 4 `complex` floating point numbers, in [**row-major order**](https://en.wikipedia.org/wiki/Row-_and_column-major_order).
21
+
22
+ Single and array "`b`" parameters represent [**Pauli operator bases**](https://en.wikipedia.org/wiki/Pauli_matrices). They are specified according to the enumeration of the [`Pauli`](https://github.com/unitaryfund/pyqrack/blob/main/pyqrack/pauli.py) class.
23
+
24
+ `MC[x]` and `MAC[x]` methods are controlled single bit gates, with as many control qubits as you specify via Python list `c` argument. `MCX` is multiply-controlled Pauli X, and `MACX` is "anti-"controlled Pauli X, i.e. "anti-control" activates the gate if all control bits are specifically **off**, as opposed to **on**.
25
+
26
+ To load the required **unitaryfund/qrack** libraries from a different location, set the `PYQRACK_SHARED_LIB_PATH` environment variable.
27
+
28
+ PyQrack has experimental support for [PyZX](https://github.com/Quantomatic/pyzx) `Circuit` definitions as an intermediate representation for `QrackSimulator`. To try this, load a `Circuit` in PyZX, (use that module to optimize your circuit, as you like,) and create a `QrackSimulator()` instance using the `pyzxCircuit` named argument of the constructor, like so:
29
+
30
+ ```python
31
+ sim = QrackSimulator(pyzxCircuit=c)
32
+ ```
33
+
34
+ where `c` is a PyZX circuit object. The circuit will automatically be simulated in the constructed `QrackSimulator` instance. This also allows loading from QASM and other intermediate representations supported by PyZX.
35
+
36
+ See [https://pyqrack.readthedocs.io/en/latest/](https://pyqrack.readthedocs.io/en/latest/) for an API reference.
37
+
38
+ For custom Qrack build floating-point precision, where options are `half`, `float`, `double`, and `quad`, set an environment variable via `export QRACK_FPPOW=[n]` (or as appropriate to your shell) where `[n]` is the logarithm base 2 of the number of bits in the systemic floating point type (`4`, `5`, `6`, or `7`, with `5` or `float` as default, i.e. `2**5=32` for 32-bit `float`). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.
39
+
40
+ Please feel welcome to open an issue, if you'd like help. 😃
41
+
42
+ **Special thanks go to Zeeshan Ahmed, for bug fixes and design suggestions, Ashish Panigrahi, for documentation and design suggestions, WingCode, for documentation, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!**
@@ -1,6 +1,6 @@
1
- [build-system]
2
- requires = [
3
- "setuptools>=42",
4
- "wheel"
5
- ]
6
- build-backend = "setuptools.build_meta"
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=42",
4
+ "wheel"
5
+ ]
6
+ build-backend = "setuptools.build_meta"
@@ -1,13 +1,12 @@
1
- # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
- #
3
- # Use of this source code is governed by an MIT-style license that can be
4
- # found in the LICENSE file or at https://opensource.org/licenses/MIT.
5
-
6
- from .qrack_system import QrackSystem, Qrack
7
- from .qrack_simulator import QrackSimulator
8
- from .qrack_neuron import QrackNeuron
9
- from .qrack_circuit import QrackCircuit
10
- from .pauli import Pauli
11
- from .neuron_activation_fn import NeuronActivationFn
12
- from .quimb_circuit_type import QuimbCircuitType
13
- from .util import convert_qiskit_circuit_to_qasm_experiment
1
+ # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
+ #
3
+ # Use of this source code is governed by an MIT-style license that can be
4
+ # found in the LICENSE file or at https://opensource.org/licenses/MIT.
5
+
6
+ from .qrack_system import QrackSystem, Qrack
7
+ from .qrack_simulator import QrackSimulator
8
+ from .qrack_neuron import QrackNeuron
9
+ from .qrack_circuit import QrackCircuit
10
+ from .pauli import Pauli
11
+ from .neuron_activation_fn import NeuronActivationFn
12
+ from .quimb_circuit_type import QuimbCircuitType
@@ -1,21 +1,21 @@
1
- # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
- #
3
- # Pauli operators are specified for "b" (or "basis") parameters.
4
- #
5
- # Use of this source code is governed by an MIT-style license that can be
6
- # found in the LICENSE file or at https://opensource.org/licenses/MIT.
7
-
8
- from enum import IntEnum
9
-
10
-
11
- class NeuronActivationFn(IntEnum):
12
- # Default
13
- Sigmoid = 0
14
- # Rectified linear
15
- ReLU = 1
16
- # Gaussian linear
17
- GeLU = 2
18
- # Version of (default) "Sigmoid" with tunable sharpness
19
- Generalized_Logistic = 3
20
- # Leaky rectified linear
21
- LeakyReLU = 4
1
+ # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
+ #
3
+ # Pauli operators are specified for "b" (or "basis") parameters.
4
+ #
5
+ # Use of this source code is governed by an MIT-style license that can be
6
+ # found in the LICENSE file or at https://opensource.org/licenses/MIT.
7
+
8
+ from enum import IntEnum
9
+
10
+
11
+ class NeuronActivationFn(IntEnum):
12
+ # Default
13
+ Sigmoid = 0
14
+ # Rectified linear
15
+ ReLU = 1
16
+ # Gaussian linear
17
+ GeLU = 2
18
+ # Version of (default) "Sigmoid" with tunable sharpness
19
+ Generalized_Logistic = 3
20
+ # Leaky rectified linear
21
+ LeakyReLU = 4
@@ -1,19 +1,19 @@
1
- # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
- #
3
- # Pauli operators are specified for "b" (or "basis") parameters.
4
- #
5
- # Use of this source code is governed by an MIT-style license that can be
6
- # found in the LICENSE file or at https://opensource.org/licenses/MIT.
7
-
8
- from enum import IntEnum
9
-
10
-
11
- class Pauli(IntEnum):
12
- # Pauli Identity operator. Corresponds to Q# constant "PauliI."
13
- PauliI = 0
14
- # Pauli X operator. Corresponds to Q# constant "PauliX."
15
- PauliX = 1
16
- # Pauli Y operator. Corresponds to Q# constant "PauliY."
17
- PauliY = 3
18
- # Pauli Z operator. Corresponds to Q# constant "PauliZ."
19
- PauliZ = 2
1
+ # (C) Daniel Strano and the Qrack contributors 2017-2021. All rights reserved.
2
+ #
3
+ # Pauli operators are specified for "b" (or "basis") parameters.
4
+ #
5
+ # Use of this source code is governed by an MIT-style license that can be
6
+ # found in the LICENSE file or at https://opensource.org/licenses/MIT.
7
+
8
+ from enum import IntEnum
9
+
10
+
11
+ class Pauli(IntEnum):
12
+ # Pauli Identity operator. Corresponds to Q# constant "PauliI."
13
+ PauliI = 0
14
+ # Pauli X operator. Corresponds to Q# constant "PauliX."
15
+ PauliX = 1
16
+ # Pauli Y operator. Corresponds to Q# constant "PauliY."
17
+ PauliY = 3
18
+ # Pauli Z operator. Corresponds to Q# constant "PauliZ."
19
+ PauliZ = 2