pyqrack-cpu 1.75.0__py3-none-win_amd64.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.
- pyqrack/__init__.py +20 -0
- pyqrack/neuron_activation_fn.py +21 -0
- pyqrack/pauli.py +19 -0
- pyqrack/qrack_ace_backend.py +1544 -0
- pyqrack/qrack_circuit.py +584 -0
- pyqrack/qrack_neuron.py +262 -0
- pyqrack/qrack_neuron_torch_layer.py +170 -0
- pyqrack/qrack_simulator.py +4533 -0
- pyqrack/qrack_stabilizer.py +58 -0
- pyqrack/qrack_system/__init__.py +9 -0
- pyqrack/qrack_system/qrack_lib/qrack_pinvoke.dll +0 -0
- pyqrack/qrack_system/qrack_system.py +1357 -0
- pyqrack/quimb_circuit_type.py +17 -0
- pyqrack/stats/__init__.py +6 -0
- pyqrack/stats/load_quantized_data.py +35 -0
- pyqrack/stats/quantize_by_range.py +56 -0
- pyqrack_cpu-1.75.0.dist-info/LICENSE +21 -0
- pyqrack_cpu-1.75.0.dist-info/METADATA +80 -0
- pyqrack_cpu-1.75.0.dist-info/RECORD +21 -0
- pyqrack_cpu-1.75.0.dist-info/WHEEL +5 -0
- pyqrack_cpu-1.75.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# (C) Daniel Strano and the Qrack contributors 2017-2025. 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
|
+
from .qrack_simulator import QrackSimulator
|
|
6
|
+
from .qrack_system import Qrack
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class QrackStabilizer(QrackSimulator):
|
|
10
|
+
"""Interface for pure-stabilizer Qrack functionality.
|
|
11
|
+
|
|
12
|
+
Like QrackSimulator with isTensorNetwork=True, QrackStabilizer does not implement a general ALU or phase parity operations.
|
|
13
|
+
Unlike isTensorNetwork=True, QrackStabilizer does implement compose(), decompose(), and dispose()
|
|
14
|
+
Even if your operation is non-Clifford in full generality, QrackStabilizer will attempt to reduce it to a Clifford case.
|
|
15
|
+
Hence, QrackStabilizer inherits the full interface of QrackSimulator (via Qrack::QInterface).
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
sid(int): Corresponding simulator id.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
qubitCount=-1,
|
|
24
|
+
cloneSid=-1,
|
|
25
|
+
pyzxCircuit=None,
|
|
26
|
+
qiskitCircuit=None,
|
|
27
|
+
):
|
|
28
|
+
self.sid = None
|
|
29
|
+
|
|
30
|
+
if pyzxCircuit is not None:
|
|
31
|
+
qubitCount = pyzxCircuit.qubits
|
|
32
|
+
elif qiskitCircuit is not None and qubitCount < 0:
|
|
33
|
+
raise RuntimeError(
|
|
34
|
+
"Must specify qubitCount with qiskitCircuit parameter in QrackSimulator constructor!"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
if qubitCount > -1 and cloneSid > -1:
|
|
38
|
+
raise RuntimeError(
|
|
39
|
+
"Cannot clone a QrackStabilizer and specify its qubit length at the same time, in QrackStabilizer constructor!"
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
self.is_tensor_network = False
|
|
43
|
+
self.is_pure_stabilizer = True
|
|
44
|
+
|
|
45
|
+
if cloneSid > -1:
|
|
46
|
+
self.sid = Qrack.qrack_lib.init_clone(cloneSid)
|
|
47
|
+
else:
|
|
48
|
+
if qubitCount < 0:
|
|
49
|
+
qubitCount = 0
|
|
50
|
+
|
|
51
|
+
self.sid = Qrack.qrack_lib.init_count_stabilizer(qubitCount)
|
|
52
|
+
|
|
53
|
+
self._throw_if_error()
|
|
54
|
+
|
|
55
|
+
if pyzxCircuit is not None:
|
|
56
|
+
self.run_pyzx_gates(pyzxCircuit.gates)
|
|
57
|
+
elif qiskitCircuit is not None:
|
|
58
|
+
self.run_qiskit_circuit(qiskitCircuit)
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
7
|
+
|
|
8
|
+
# Global entry-point for Qrack shared library
|
|
9
|
+
Qrack = QrackSystem()
|
|
Binary file
|