pyqrack-cuda 1.27.0__py3-none-manylinux_2_35_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.
@@ -0,0 +1,17 @@
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 QuimbCircuitType(IntEnum):
12
+ # Class for simulating quantum circuits using tensor networks.
13
+ Circuit = 0
14
+ # Quantum circuit simulation keeping the state in full dense form.
15
+ CircuitDense = 1
16
+ # Quantum circuit simulation keeping the state always in a MPS form.
17
+ CircuitMPS = 3
@@ -0,0 +1,8 @@
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 .convert_qiskit_circuit_to_qasm_experiment import (
7
+ convert_qiskit_circuit_to_qasm_experiment,
8
+ )
@@ -0,0 +1,61 @@
1
+ _IS_QISKIT_AVAILABLE = True
2
+ try:
3
+ from qiskit.circuit.quantumcircuit import QuantumCircuit
4
+ from qiskit.qobj.qasm_qobj import QasmQobjExperiment, QasmQobjInstruction
5
+ except ImportError:
6
+ _IS_QISKIT_AVAILABLE = False
7
+
8
+
9
+ class QrackQasmQobjInstructionConditional:
10
+ def __init__(self, mask, val):
11
+ self.mask = mask
12
+ self.val = val
13
+
14
+
15
+ def convert_qiskit_circuit_to_qasm_experiment(experiment, config=None, header=None):
16
+ if not _IS_QISKIT_AVAILABLE:
17
+ raise RuntimeError(
18
+ "Before trying to convert_circuit_to_qasm_experiment() with QrackSimulator, you must install Qiskit!"
19
+ )
20
+
21
+ instructions = []
22
+ for datum in experiment._data:
23
+ qubits = []
24
+ for qubit in datum[1]:
25
+ qubits.append(experiment.qubits.index(qubit))
26
+
27
+ clbits = []
28
+ for clbit in datum[2]:
29
+ clbits.append(experiment.clbits.index(clbit))
30
+
31
+ conditional = None
32
+ condition = datum[0].condition
33
+ if condition is not None:
34
+ if isinstance(condition[0], Clbit):
35
+ conditional = experiment.clbits.index(condition[0])
36
+ else:
37
+ creg_index = experiment.cregs.index(condition[0])
38
+ size = experiment.cregs[creg_index].size
39
+ offset = 0
40
+ for i in range(creg_index):
41
+ offset += len(experiment.cregs[i])
42
+ mask = ((1 << offset) - 1) ^ ((1 << (offset + size)) - 1)
43
+ val = condition[1]
44
+ conditional = (
45
+ offset
46
+ if (size == 1)
47
+ else QrackQasmQobjInstructionConditional(mask, val)
48
+ )
49
+
50
+ instructions.append(
51
+ QasmQobjInstruction(
52
+ datum[0].name,
53
+ qubits=qubits,
54
+ memory=clbits,
55
+ condition=condition,
56
+ conditional=conditional,
57
+ params=datum[0].params,
58
+ )
59
+ )
60
+
61
+ return QasmQobjExperiment(config=config, header=header, instructions=instructions)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 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.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.1
2
+ Name: pyqrack-cuda
3
+ Version: 1.27.0
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 :: 3.5
18
+ Classifier: Programming Language :: Python :: 3.6
19
+ Classifier: Programming Language :: Python :: 3.7
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Topic :: Scientific/Engineering
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest (>=7.3.1) ; extra == 'dev'
28
+
29
+ # pyqrack
30
+ [![Downloads](https://pepy.tech/badge/pyqrack)](https://pepy.tech/project/pyqrack) [![Downloads](https://pepy.tech/badge/pyqrack/month)](https://pepy.tech/project/pyqrack)
31
+
32
+ Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library
33
+
34
+ (**PyQrack** is just pure Qrack.)
35
+
36
+ To use this package, it's helpful to be familiar with [vm6502q/qrack](https://github.com/vm6502q/qrack). Users gain **much** more control over options by building **vm6502q/qrack** and [vm6502q/pyqrack](https://github.com/vm6502q/pyqrack) from source. For advanced users, building from source is the intended primary method of **PyQrack** package distribution and use.
37
+
38
+ Import and instantiate [`QrackSimulator`](https://github.com/vm6502q/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`.
39
+
40
+ 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).
41
+
42
+ 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/vm6502q/pyqrack/blob/main/pyqrack/pauli.py) class.
43
+
44
+ `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**.
45
+
46
+ The package installation directory contains a `qrack_cl_precompile` folder with executables for supported platforms, to compile OpenCL kernels once, beforehand, avoiding the need to recompile "just-in-time" every time that you load this package in a Python interpreter. If you no longer want to use precompiled kernels, or if precompilation fails, just delete the `~/.qrack` directory, or the equivalent `.qrack` sub-directory in the user home folder of your operating system.
47
+
48
+ To load the required **vm6502q/qrack** libraries from a different location, set the `PYQRACK_SHARED_LIB_PATH` environment variable. If an absolute path is set for this variable, it will be treated as an absolute path. If a relative path is used, the **pyqrack** package `qrack_system` directory is the root.
49
+
50
+ PyQrack v0.4.6 adds 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:
51
+
52
+ ```python
53
+ sim = QrackSimulator(pyzxCircuit=c)
54
+ ```
55
+
56
+ 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.
57
+
58
+ See [https://pyqrack.readthedocs.io/en/latest/](https://pyqrack.readthedocs.io/en/latest/) for an API reference.
59
+
60
+ Please feel welcome to open an issue, if you'd like help. 😃
61
+
62
+ **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!**
@@ -0,0 +1,20 @@
1
+ pyqrack/__init__.py,sha256=OnxLLs0PUKiAqiGvMSbCDDYQvbshMyX2H0dy5RoAaCo,581
2
+ pyqrack/neuron_activation_fn.py,sha256=xpL5MLEOi4FwAI3XZbtvdzM_5nan02yDnvO_tH4chVM,594
3
+ pyqrack/pauli.py,sha256=DPvdqrz6w6M35f87sFYhwiQULrTThy2Nxd_CKp7EfXo,654
4
+ pyqrack/qrack_circuit.py,sha256=FMLdCntmJa4-71DnlCP1dCkEpp6-LLSYH73ZXSQyTHs,17178
5
+ pyqrack/qrack_neuron.py,sha256=UAwv9WMk6svfk79s7Q_6nOZdfupwj-gmGsesWW-9Rcc,8882
6
+ pyqrack/qrack_simulator.py,sha256=-Z2fGiiAsmIWH7iuPxhfl0rbjSwFF3vnm_e0wofS8VU,116490
7
+ pyqrack/quimb_circuit_type.py,sha256=UDiojIfsPQCsBFGekEsbg8t1j11cz4e4Kg7OetkFNfk,621
8
+ pyqrack/qrack_cl_precompile/Linux/2_35/qrack_cl_precompile,sha256=E-AHyaZ_p4lnWfMRGlglcASR6LQbkdCaE0uD0Krsw-o,16576
9
+ pyqrack/qrack_system/__init__.py,sha256=-oZ9dsb1hixsnrkUJRY_C5DzQ_l6MtifF_Z465BgqV4,334
10
+ pyqrack/qrack_system/qrack_system.py,sha256=0TfEmawSSUWFK-8rodq-VWa084d2pt-8kj9-7Hey1IU,33764
11
+ pyqrack/qrack_system/qrack_lib/Linux/2_35/libqrack.a,sha256=SZRzzaaRPaf27SQarl6JqP-KVrkIn0u6d7RwvvEdhrU,9927472
12
+ pyqrack/qrack_system/qrack_lib/Linux/2_35/libqrack_pinvoke.so,sha256=EiDiZj7dSJ4ldnxeWEaSDEYtnreveh6fCoqE-H_yrpI,6241720
13
+ pyqrack/qrack_system/qrack_lib/Linux/2_35/libqrack_pinvoke.so.9.6.0,sha256=EiDiZj7dSJ4ldnxeWEaSDEYtnreveh6fCoqE-H_yrpI,6241720
14
+ pyqrack/util/__init__.py,sha256=8ruN0efivTWkGQUevXnd0qvC9k36LJjJNf2f39Zc5jc,333
15
+ pyqrack/util/convert_qiskit_circuit_to_qasm_experiment.py,sha256=omp5MxOa8m5H0cyClFGCLlTacNu5K9ezKbitwqABu0U,2065
16
+ pyqrack_cuda-1.27.0.dist-info/LICENSE,sha256=Qgx0JeqddJkiPf_gu_K0_U56bf-VAFjFOCm5xINNFU0,1064
17
+ pyqrack_cuda-1.27.0.dist-info/METADATA,sha256=3quT684isg2OZvuILQvy4GanKwJPhVHNTc4J9dYjIAs,4607
18
+ pyqrack_cuda-1.27.0.dist-info/WHEEL,sha256=IxknDv4vOrcoQxiAQzyEiGWss20R4uNhAlN6FAzMLcU,110
19
+ pyqrack_cuda-1.27.0.dist-info/top_level.txt,sha256=YE_3q9JTGRLMilNg2tGP1y7uU-Dx8PDao2OhwoIbv8E,8
20
+ pyqrack_cuda-1.27.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.37.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-manylinux_2_35_x86_64
5
+
@@ -0,0 +1 @@
1
+ pyqrack