pennylane-qrack 0.11.5__tar.gz → 0.12.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.

Potentially problematic release.


This version of pennylane-qrack might be problematic. Click here for more details.

Files changed (31) hide show
  1. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/Makefile +1 -1
  2. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/PKG-INFO +3 -1
  3. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/README.rst +2 -0
  4. pennylane_qrack-0.12.0/pennylane_qrack/QrackDeviceConfig.toml +158 -0
  5. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack/_version.py +1 -1
  6. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack/qrack_device.py +2 -17
  7. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/PKG-INFO +3 -1
  8. pennylane_qrack-0.11.5/pennylane_qrack/QrackDeviceConfig.toml +0 -117
  9. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/CHANGELOG.md +0 -0
  10. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/CMakeLists.txt +0 -0
  11. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/LICENSE +0 -0
  12. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/MANIFEST.in +0 -0
  13. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/DataView.hpp +0 -0
  14. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/DynamicLibraryLoader.hpp +0 -0
  15. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/Exception.hpp +0 -0
  16. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/QuantumDevice.hpp +0 -0
  17. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/RuntimeCAPI.h +0 -0
  18. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/catalyst/runtime/include/Types.h +0 -0
  19. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack/__init__.py +0 -0
  20. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack/qrack_device.cpp +0 -0
  21. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/SOURCES.txt +0 -0
  22. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/dependency_links.txt +0 -0
  23. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/entry_points.txt +0 -0
  24. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/requires.txt +0 -0
  25. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/pennylane_qrack.egg-info/top_level.txt +0 -0
  26. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/requirements.txt +0 -0
  27. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/setup.cfg +0 -0
  28. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/setup.py +0 -0
  29. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/tests/test_apply.py +0 -0
  30. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/tests/test_integration.py +0 -0
  31. {pennylane_qrack-0.11.5 → pennylane_qrack-0.12.0}/tests/test_units.py +0 -0
@@ -24,7 +24,7 @@ help:
24
24
  build-deps:
25
25
  ifneq ($(OS),Windows_NT)
26
26
  ifeq ($(QRACK_PRESENT),)
27
- git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout f3e6277d52424079e08f45677682c7604c19927c; cd ..
27
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout d906dffdf033441e221573f989c3760bc325ca03; cd ..
28
28
  endif
29
29
  mkdir -p qrack/build
30
30
  ifeq ($(UNAME_S),Linux)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.11.5
3
+ Version: 0.12.0
4
4
  Summary: PennyLane plugin for Qrack.
5
5
  Home-page: http://github.com/vm6502q
6
6
  Maintainer: vm6502q
@@ -37,6 +37,8 @@ PennyLane-Qrack Plugin
37
37
 
38
38
  The PennyLane-Qrack plugin integrates the Qrack quantum computing framework with PennyLane's quantum machine learning capabilities.
39
39
 
40
+ **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)**
41
+
40
42
  This plugin is addapted from the `PennyLane-Qulacs plugin, <https://github.com/PennyLaneAI/pennylane-qulacs>`__ under the Apache License 2.0, with many thanks to the original developers!
41
43
 
42
44
  `PennyLane <https://pennylane.readthedocs.io>`__ is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
@@ -5,6 +5,8 @@ PennyLane-Qrack Plugin
5
5
 
6
6
  The PennyLane-Qrack plugin integrates the Qrack quantum computing framework with PennyLane's quantum machine learning capabilities.
7
7
 
8
+ **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)**
9
+
8
10
  This plugin is addapted from the `PennyLane-Qulacs plugin, <https://github.com/PennyLaneAI/pennylane-qulacs>`__ under the Apache License 2.0, with many thanks to the original developers!
9
11
 
10
12
  `PennyLane <https://pennylane.readthedocs.io>`__ is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
@@ -0,0 +1,158 @@
1
+ # Which version of the specification format is being used.
2
+ schema = 2
3
+
4
+ # The union of all gate types listed in this section must match what
5
+ # the device considers "supported" through PennyLane's device API.
6
+ # The gate definition has the following format:
7
+ #
8
+ # GATE = { properties = [ PROPS ], condition = [ COND ] }
9
+ #
10
+ # Where:
11
+ #
12
+ # PROPS: zero or more comma-separated quoted strings:
13
+ # "controllable", "invertible", "differentiable"
14
+ # COND: quoted string, on of:
15
+ # "analytic", "finiteshots"
16
+ #
17
+ [operators.gates.native]
18
+
19
+ PauliX = { properties = [ "controllable", "invertible"] }
20
+ PauliY = { properties = [ "controllable", "invertible"] }
21
+ PauliZ = { properties = [ "controllable", "invertible"] }
22
+ SX = { properties = [ "controllable", "invertible"] }
23
+ MultiRZ = { properties = [ "controllable", "invertible" ] }
24
+ Hadamard = { properties = [ "controllable", "invertible"] }
25
+ S = { properties = [ "controllable", "invertible" ] }
26
+ T = { properties = [ "controllable", "invertible" ] }
27
+ CNOT = { properties = [ "controllable", "invertible" ] }
28
+ SWAP = { properties = [ "controllable", "invertible" ] }
29
+ CSWAP = { properties = [ "controllable", "invertible" ] }
30
+ ISWAP = { properties = [ "controllable", "invertible"] }
31
+ PSWAP = { properties = [ "controllable", "invertible"] }
32
+ Toffoli = { properties = [ "controllable", "invertible" ] }
33
+ CY = { properties = [ "controllable", "invertible" ] }
34
+ CZ = { properties = [ "controllable", "invertible" ] }
35
+ PhaseShift = { properties = [ "controllable", "invertible" ] }
36
+ ControlledPhaseShift = { properties = [ "controllable", "invertible" ] }
37
+ CPhase = { properties = [ "controllable", "invertible" ] }
38
+ RX = { properties = [ "controllable", "invertible" ] }
39
+ RY = { properties = [ "controllable", "invertible" ] }
40
+ RZ = { properties = [ "controllable", "invertible" ] }
41
+ Rot = { properties = [ "controllable", "invertible" ] }
42
+ CRX = { properties = [ "controllable", "invertible" ] }
43
+ CRY = { properties = [ "controllable", "invertible" ] }
44
+ CRZ = { properties = [ "controllable", "invertible" ] }
45
+ CRot = { properties = [ "controllable", "invertible" ] }
46
+ U3 = { properties = [ "controllable", "invertible" ] }
47
+ MultiControlledX = { properties = [ "controllable", "invertible" ] }
48
+ Identity = { properties = [ "controllable", "invertible" ] }
49
+
50
+ # Operators that should be decomposed according to the algorithm used
51
+ # by PennyLane's device API.
52
+ # Optional, since gates not listed in this list will typically be decomposed by
53
+ # default, but can be useful to express a deviation from this device's regular
54
+ # strategy in PennyLane.
55
+ # [operators.gates.decomp]
56
+
57
+ # QubitUnitary = {}
58
+ # SISWAP = {}
59
+ # SQISW = {}
60
+ # BasisState = {}
61
+ # StatePrep = {}
62
+ # ControlledQubitUnitary = {}
63
+ # DiagonalQubitUnitary = {}
64
+ # SingleExcitation = {}
65
+ # SingleExcitationPlus = {}
66
+ # SingleExcitationMinus = {}
67
+ # DoubleExcitation = {}
68
+ # DoubleExcitationPlus = {}
69
+ # DoubleExcitationMinus = {}
70
+ # QubitCarry = {}
71
+ # QubitSum = {}
72
+ # OrbitalRotation = {}
73
+ # ECR = {}
74
+ # IsingXX = {}
75
+ # IsingYY = {}
76
+ # IsingZZ = {}
77
+ # IsingXY = {}
78
+ # U2 = {}
79
+ # U1 = {}
80
+ # QFT = {}
81
+
82
+ # Gates which should be translated to QubitUnitary
83
+ # [operators.gates.matrix]
84
+
85
+ # Observables supported by the device
86
+ [operators.observables]
87
+
88
+ PauliX = {}
89
+ PauliY = {}
90
+ PauliZ = {}
91
+ Identity = {}
92
+ Prod = {}
93
+ # Hadamard = {}
94
+ # Hermitian = {}
95
+ # Projector = {}
96
+ # SparseHamiltonian = {}
97
+ # Hamiltonian = {}
98
+ # Sum = {}
99
+ # SProd = {}
100
+ # Exp = {}
101
+
102
+ [measurement_processes]
103
+
104
+ Expval = { condition = [ "analytic" ] }
105
+ Var = { condition = [ "analytic" ] }
106
+ Probs = { condition = [ "analytic" ] }
107
+ State = { condition = [ "analytic" ] }
108
+ Sample = { condition = [ "finiteshots" ] }
109
+ Counts = { condition = [ "finiteshots" ] }
110
+
111
+ [compilation]
112
+
113
+ # If the device is compatible with qjit
114
+ qjit_compatible = true
115
+ # If the device requires run time generation of the quantum circuit.
116
+ runtime_code_generation = false
117
+ # If the device supports mid circuit measurements natively
118
+ mid_circuit_measurement = true
119
+ # This field is currently unchecked but it is reserved for the purpose of
120
+ # determining if the device supports dynamic qubit allocation/deallocation.
121
+ dynamic_qubit_management = true
122
+
123
+ [options]
124
+ # Options is an optional field.
125
+ # These options represent runtime parameters that can be passed to the device
126
+ # upon the device initialization.
127
+ # The option key will be the key in a dictionary.
128
+ # The string corresponds to a field queried in the `qml.Device` instance.
129
+
130
+ # Use "hybrid" stabilizer optimization? (Default is "true"; non-Clifford circuits will fall back to near-Clifford or universal simulation)
131
+ is_hybrid_stabilizer = "isStabilizerHybrid"
132
+ # Use "tensor network" optimization? (Default is "true"; prevents dynamic qubit de-allocation; might function sub-optimally with "hybrid" stabilizer enabled)
133
+ is_tensor_network = "isTensorNetwork"
134
+ # Use Schmidt decomposition optimizations? (Default is "true")
135
+ is_schmidt_decomposed = "isSchmidtDecompose"
136
+ # Distribute Schmidt-decomposed qubit subsystems to multiple GPUs or accelerators, if available? (Default is "true"; mismatched device capacities might hurt overall performance)
137
+ is_schmidt_decomposition_parallel = "isSchmidtDecomposeMulti"
138
+ # Use "quantum binary decision diagram" ("QBDD") methods? (Default is "false"; note that QBDD is CPU-only)
139
+ is_qbdd = "isBinaryDecisionTree"
140
+ # Use GPU acceleration? (Default is "true")
141
+ is_gpu = "isOpenCL"
142
+ # Use multi-GPU (or "multi-page") acceleration? (Default is "false")
143
+ is_paged = "isPaged"
144
+ # Use CPU/GPU method hybridization? (Default is "false")
145
+ is_hybrid_cpu_gpu = "isCpuGpuHybrid"
146
+ # Allocate GPU buffer from general host heap? (Default is "false"; "true" might improve performance or reliability in certain cases, like if using an Intel HD as accelerator)
147
+ is_host_pointer = "isHostPointer"
148
+ # Noise parameter. (Default is "0"; depolarizing noise intensity can also be controlled by "QRACK_GATE_DEPOLARIZATION" environment variable)
149
+ noise = "noise"
150
+
151
+ # In the above example, a dictionary will be constructed at run time.
152
+ # The dictionary will contain the string key "option_key" and its value
153
+ # will be the value in `qml.Device` `option_field`.
154
+ # The value can be any Python type, but will be converted to a string.
155
+ # During the initialization of your `class QuantumDevice`, the dictionary
156
+ # will be sent to the constructor of your implementation of `class QuantumDevice`.
157
+ # The dictionary will be a JSON string like the following:
158
+ # { 'option_key': option_field }
@@ -16,4 +16,4 @@
16
16
  Version number (major.minor.patch[-label])
17
17
  """
18
18
 
19
- __version__ = "0.11.5"
19
+ __version__ = "0.12.0"
@@ -14,7 +14,6 @@
14
14
  """
15
15
  Base device class for PennyLane-Qrack.
16
16
  """
17
- from collections import OrderedDict
18
17
  from functools import reduce
19
18
  import cmath, math
20
19
  import os
@@ -30,8 +29,6 @@ from pennylane.ops import (
30
29
  StatePrep,
31
30
  BasisState,
32
31
  QubitUnitary,
33
- CRZ,
34
- PhaseShift,
35
32
  Adjoint,
36
33
  )
37
34
  from pennylane.wires import Wires
@@ -141,7 +138,7 @@ class QrackDevice(QubitDevice):
141
138
  "C(MultiControlledX)",
142
139
  }
143
140
 
144
- config_filepath = pathlib.Path(
141
+ config = pathlib.Path(
145
142
  os.path.dirname(sys.modules[__name__].__file__) + "/QrackDeviceConfig.toml"
146
143
  )
147
144
 
@@ -162,7 +159,7 @@ class QrackDevice(QubitDevice):
162
159
  # Use CPU/GPU method hybridization? (Default is "false")
163
160
  isCpuGpuHybrid = True
164
161
  # Allocate GPU buffer from general host heap? (Default is "false"; "true" might improve performance or reliability in certain cases, like if using an Intel HD as accelerator)
165
- isHostPointer = False
162
+ isHostPointer = True if os.environ.get('PYQRACK_HOST_POINTER_DEFAULT_ON') else False
166
163
  # Noise parameter. (Default is "0"; depolarizing noise intensity can also be controlled by "QRACK_GATE_DEPOLARIZATION" environment variable)
167
164
  noise = 0
168
165
 
@@ -213,18 +210,6 @@ class QrackDevice(QubitDevice):
213
210
  isHostPointer=self.isHostPointer,
214
211
  noise=self.noise,
215
212
  )
216
- self.device_kwargs = {
217
- "is_hybrid_stabilizer": self.isStabilizerHybrid,
218
- "is_tensor_network": self.isTensorNetwork,
219
- "is_schmidt_decompose": self.isSchmidtDecompose,
220
- "is_schmidt_decompose_parallel": self.isSchmidtDecomposeMulti,
221
- "is_qpdd": self.isBinaryDecisionTree,
222
- "is_gpu": self.isOpenCL,
223
- "is_paged": self.isPaged,
224
- "is_hybrid_cpu_gpu": self.isCpuGpuHybrid,
225
- "is_host_pointer": self.isHostPointer,
226
- "noise": self.noise,
227
- }
228
213
  self._circuit = []
229
214
 
230
215
  def _reverse_state(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.11.5
3
+ Version: 0.12.0
4
4
  Summary: PennyLane plugin for Qrack.
5
5
  Home-page: http://github.com/vm6502q
6
6
  Maintainer: vm6502q
@@ -37,6 +37,8 @@ PennyLane-Qrack Plugin
37
37
 
38
38
  The PennyLane-Qrack plugin integrates the Qrack quantum computing framework with PennyLane's quantum machine learning capabilities.
39
39
 
40
+ **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)**
41
+
40
42
  This plugin is addapted from the `PennyLane-Qulacs plugin, <https://github.com/PennyLaneAI/pennylane-qulacs>`__ under the Apache License 2.0, with many thanks to the original developers!
41
43
 
42
44
  `PennyLane <https://pennylane.readthedocs.io>`__ is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
@@ -1,117 +0,0 @@
1
- schema = 3
2
-
3
- # The set of all gate types supported at the runtime execution interface of the
4
- # device, i.e., what is supported by the `execute` method. The gate definitions
5
- # should have the following format:
6
- #
7
- # GATE = { properties = [ PROPS ], conditions = [ CONDS ] }
8
- #
9
- # where PROPS and CONS are zero or more comma separated quoted strings.
10
- #
11
- # PROPS: additional support provided for each gate.
12
- # - "controllable": if a controlled version of this gate is supported.
13
- # - "invertible": if the adjoint of this operation is supported.
14
- # - "differentiable": if device gradient is supported for this gate.
15
- # CONDS: constraints on the support for each gate.
16
- # - "analytic" or "finiteshots": if this operation is only supported in
17
- # either analytic execution or with shots, respectively.
18
- #
19
- [operators.gates]
20
-
21
- PauliX = { properties = [ "controllable", "invertible" ] }
22
- PauliY = { properties = [ "controllable", "invertible" ] }
23
- PauliZ = { properties = [ "controllable", "invertible" ] }
24
- SX = { properties = [ "controllable", "invertible" ] }
25
- MultiRZ = { properties = [ "controllable", "invertible" ] }
26
- Hadamard = { properties = [ "controllable", "invertible" ] }
27
- S = { properties = [ "controllable", "invertible" ] }
28
- T = { properties = [ "controllable", "invertible" ] }
29
- CNOT = { properties = [ "controllable", "invertible" ] }
30
- SWAP = { properties = [ "controllable", "invertible" ] }
31
- CSWAP = { properties = [ "controllable", "invertible" ] }
32
- ISWAP = { properties = [ "controllable", "invertible" ] }
33
- PSWAP = { properties = [ "controllable", "invertible" ] }
34
- Toffoli = { properties = [ "controllable", "invertible" ] }
35
- CY = { properties = [ "controllable", "invertible" ] }
36
- CZ = { properties = [ "controllable", "invertible" ] }
37
- PhaseShift = { properties = [ "controllable", "invertible" ] }
38
- ControlledPhaseShift = { properties = [ "controllable", "invertible" ] }
39
- CPhase = { properties = [ "controllable", "invertible" ] }
40
- RX = { properties = [ "controllable", "invertible" ] }
41
- RY = { properties = [ "controllable", "invertible" ] }
42
- RZ = { properties = [ "controllable", "invertible" ] }
43
- Rot = { properties = [ "controllable", "invertible" ] }
44
- CRX = { properties = [ "controllable", "invertible" ] }
45
- CRY = { properties = [ "controllable", "invertible" ] }
46
- CRZ = { properties = [ "controllable", "invertible" ] }
47
- CRot = { properties = [ "controllable", "invertible" ] }
48
- U3 = { properties = [ "controllable", "invertible" ] }
49
- MultiControlledX = { properties = [ "controllable", "invertible" ] }
50
- Identity = { properties = [ "controllable", "invertible" ] }
51
-
52
- # Observables supported by the device for measurements. The observables defined
53
- # in this section should have the following format:
54
- #
55
- # OBSERVABLE = { conditions = [ CONDS ] }
56
- #
57
- # where CONDS is zero or more comma separated quoted strings, same as above.
58
- #
59
- # CONDS: constraints on the support for each observable.
60
- # - "analytic" or "finiteshots": if this observable is only supported in
61
- # either analytic execution or with shots, respectively.
62
- # - "terms-commute": if a composite operator is only supported under the
63
- # condition that its terms commute.
64
- #
65
- [operators.observables]
66
-
67
- PauliX = {}
68
- PauliY = {}
69
- PauliZ = {}
70
- Identity = {}
71
- Prod = {}
72
- # Hadamard = {}
73
- # Hermitian = {}
74
- # Projector = {}
75
- # SparseHamiltonian = {}
76
- # Hamiltonian = {}
77
- # Sum = {}
78
- # SProd = {}
79
- # Exp = {}
80
-
81
- # Types of measurement processes supported on the device. The measurements in
82
- # this section should have the following format:
83
- #
84
- # MEASUREMENT_PROCESS = { conditions = [ CONDS ] }
85
- #
86
- # where CONDS is zero or more comma separated quoted strings, same as above.
87
- #
88
- # CONDS: constraints on the support for each measurement process.
89
- # - "analytic" or "finiteshots": if this measurement is only supported
90
- # in either analytic execution or with shots, respectively.
91
- #
92
- [measurement_processes]
93
-
94
- ExpectationMP = { conditions = [ "analytic" ] }
95
- VarianceMP = { conditions = [ "analytic" ] }
96
- ProbabilityMP = { conditions = [ "analytic" ] }
97
- StateMP = { conditions = [ "analytic" ] }
98
- SampleMP = { conditions = [ "finiteshots" ] }
99
- CountsMP = { conditions = [ "finiteshots" ] }
100
-
101
- # Additional support that the device may provide that informs the compilation
102
- # process. All accepted fields and their default values are listed below.
103
- [compilation]
104
-
105
- # Whether the device is compatible with qjit.
106
- qjit_compatible = true
107
-
108
- # Whether the device requires run time generation of the quantum circuit.
109
- runtime_code_generation = false
110
-
111
- # Whether the device supports allocating and releasing qubits during execution.
112
- dynamic_qubit_management = true
113
-
114
- # The methods of handling mid-circuit measurements that the device supports,
115
- # e.g., "one-shot", "tree-traversal", "device", etc. An empty list indicates
116
- # that the device does not support mid-circuit measurements.
117
- supported_mcm_methods = [ "device", "one-shot" ]