pennylane-qrack 0.9.5__py3-none-win_amd64.whl → 0.9.7__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.
Potentially problematic release.
This version of pennylane-qrack might be problematic. Click here for more details.
- pennylane_qrack/_version.py +1 -1
- pennylane_qrack/qrack_device.cpp +18 -1
- pennylane_qrack/qrack_device.py +42 -1
- {pennylane_qrack-0.9.5.dist-info → pennylane_qrack-0.9.7.dist-info}/METADATA +2 -2
- pennylane_qrack-0.9.7.dist-info/RECORD +11 -0
- pennylane_qrack-0.9.5.dist-info/RECORD +0 -11
- {pennylane_qrack-0.9.5.dist-info → pennylane_qrack-0.9.7.dist-info}/LICENSE +0 -0
- {pennylane_qrack-0.9.5.dist-info → pennylane_qrack-0.9.7.dist-info}/WHEEL +0 -0
- {pennylane_qrack-0.9.5.dist-info → pennylane_qrack-0.9.7.dist-info}/entry_points.txt +0 -0
- {pennylane_qrack-0.9.5.dist-info → pennylane_qrack-0.9.7.dist-info}/top_level.txt +0 -0
pennylane_qrack/_version.py
CHANGED
pennylane_qrack/qrack_device.cpp
CHANGED
|
@@ -489,14 +489,25 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
489
489
|
default:
|
|
490
490
|
break;
|
|
491
491
|
}
|
|
492
|
-
|
|
492
|
+
std::vector<Qrack::Pauli> bases;
|
|
493
|
+
bases.reserve(dev_wires.size());
|
|
494
|
+
for (size_t i = 0U; i < dev_wires.size(); ++i) {
|
|
495
|
+
bases.emplace_back(basis);
|
|
496
|
+
}
|
|
497
|
+
obs_cache.push_back(QrackObservable(bases, dev_wires));
|
|
493
498
|
|
|
494
499
|
return obs_cache.size() - 1U;
|
|
495
500
|
}
|
|
496
501
|
auto TensorObservable(const std::vector<ObsIdType> &obs) -> ObsIdType override
|
|
497
502
|
{
|
|
503
|
+
if (!obs.size()) {
|
|
504
|
+
return -1;
|
|
505
|
+
}
|
|
498
506
|
QrackObservable o;
|
|
499
507
|
for (const ObsIdType& id : obs) {
|
|
508
|
+
if (id >= obs_cache.size()) {
|
|
509
|
+
throw std::invalid_argument("Observable ID not in device cache: " + std::to_string(id));
|
|
510
|
+
}
|
|
500
511
|
const QrackObservable& i = obs_cache[id];
|
|
501
512
|
o.obs.insert(o.obs.end(), i.obs.begin(), i.obs.end());
|
|
502
513
|
o.wires.insert(o.wires.end(), i.wires.begin(), i.wires.end());
|
|
@@ -633,11 +644,17 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
633
644
|
}
|
|
634
645
|
auto Expval(ObsIdType id) -> double override
|
|
635
646
|
{
|
|
647
|
+
if (id >= obs_cache.size()) {
|
|
648
|
+
throw std::invalid_argument("Observable ID not in device cache: " + std::to_string(id));
|
|
649
|
+
}
|
|
636
650
|
const QrackObservable& obs = obs_cache[id];
|
|
637
651
|
return qsim->ExpectationPauliAll(obs.wires, obs.obs);
|
|
638
652
|
}
|
|
639
653
|
auto Var(ObsIdType id) -> double override
|
|
640
654
|
{
|
|
655
|
+
if (id >= obs_cache.size()) {
|
|
656
|
+
throw std::invalid_argument("Observable ID not in device cache: " + std::to_string(id));
|
|
657
|
+
}
|
|
641
658
|
const QrackObservable& obs = obs_cache[id];
|
|
642
659
|
return qsim->VariancePauliAll(obs.wires, obs.obs);
|
|
643
660
|
}
|
pennylane_qrack/qrack_device.py
CHANGED
|
@@ -144,6 +144,23 @@ class QrackDevice(QubitDevice):
|
|
|
144
144
|
os.path.dirname(sys.modules[__name__].__file__) + "/QrackDeviceConfig.toml"
|
|
145
145
|
)
|
|
146
146
|
|
|
147
|
+
# Use "hybrid" stabilizer optimization? (Default is "true"; non-Clifford circuits will fall back to near-Clifford or universal simulation)
|
|
148
|
+
isStabilizerHybrid = True
|
|
149
|
+
# Use "tensor network" optimization? (Default is "true"; prevents dynamic qubit de-allocation; might function sub-optimally with "hybrid" stabilizer enabled)
|
|
150
|
+
isTensorNetwork = True
|
|
151
|
+
# Use Schmidt decomposition optimizations? (Default is "true")
|
|
152
|
+
isSchmidtDecompose = True
|
|
153
|
+
# Distribute Schmidt-decomposed qubit subsystems to multiple GPUs or accelerators, if available? (Default is "true"; mismatched device capacities might hurt overall performance)
|
|
154
|
+
isSchmidtDecomposeMulti = True
|
|
155
|
+
# Use "quantum binary decision diagram" ("QBDD") methods? (Default is "false"; note that QBDD is CPU-only)
|
|
156
|
+
isBinaryDecisionTree = False
|
|
157
|
+
# Use GPU acceleration? (Default is "true")
|
|
158
|
+
isOpenCL = True
|
|
159
|
+
# 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)
|
|
160
|
+
isHostPointer = False
|
|
161
|
+
# Use noisy simulation? (Default is "false"; depolarizing noise intensity can be controlled by "QRACK_GATE_DEPOLARIZATION" environment variable)
|
|
162
|
+
isNoisy = False
|
|
163
|
+
|
|
147
164
|
@staticmethod
|
|
148
165
|
def get_c_interface():
|
|
149
166
|
shared_lib_path = os.path.dirname(sys.modules[__name__].__file__) + "/libqrack_device.so"
|
|
@@ -157,8 +174,32 @@ class QrackDevice(QubitDevice):
|
|
|
157
174
|
return ("QrackDevice", shared_lib_path)
|
|
158
175
|
|
|
159
176
|
def __init__(self, wires=0, shots=None, **kwargs):
|
|
177
|
+
options = dict(kwargs)
|
|
178
|
+
if 'isStabilizerHybrid' in options:
|
|
179
|
+
self.isStabilizerHybrid = options['isStabilizerHybrid']
|
|
180
|
+
if 'isTensorNetwork' in options:
|
|
181
|
+
self.isTensorNetwork = options['isTensorNetwork']
|
|
182
|
+
if 'isSchmidtDecompose' in options:
|
|
183
|
+
self.isSchmidtDecompose = options['isSchmidtDecompose']
|
|
184
|
+
if 'isBinaryDecisionTree' in options:
|
|
185
|
+
self.isBinaryDecisionTree = options['isBinaryDecisionTree']
|
|
186
|
+
if 'isOpenCL' in options:
|
|
187
|
+
self.isOpenCL = options['isOpenCL']
|
|
188
|
+
if 'isHostPointer' in options:
|
|
189
|
+
self.isHostPointer = options['isHostPointer']
|
|
190
|
+
if 'isNoisy' in options:
|
|
191
|
+
self.isNoisy = options['isNoisy']
|
|
160
192
|
super().__init__(wires=wires, shots=shots)
|
|
161
|
-
self._state = QrackSimulator(
|
|
193
|
+
self._state = QrackSimulator(
|
|
194
|
+
self.num_wires,
|
|
195
|
+
isStabilizerHybrid = self.isStabilizerHybrid,
|
|
196
|
+
isTensorNetwork=self.isTensorNetwork,
|
|
197
|
+
isSchmidtDecompose=self.isSchmidtDecompose,
|
|
198
|
+
isBinaryDecisionTree=self.isBinaryDecisionTree,
|
|
199
|
+
isOpenCL=self.isOpenCL,
|
|
200
|
+
isHostPointer=self.isHostPointer,
|
|
201
|
+
isNoisy=self.isNoisy
|
|
202
|
+
)
|
|
162
203
|
|
|
163
204
|
def _reverse_state(self):
|
|
164
205
|
end = self.num_wires - 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pennylane-qrack
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
4
4
|
Summary: PennyLane plugin for Qrack.
|
|
5
5
|
Home-page: http://github.com/vm6502q
|
|
6
6
|
Maintainer: vm6502q
|
|
@@ -27,7 +27,7 @@ Provides: pennylane_qrack
|
|
|
27
27
|
Description-Content-Type: text/x-rst
|
|
28
28
|
License-File: LICENSE
|
|
29
29
|
Requires-Dist: pennylane>=0.32
|
|
30
|
-
Requires-Dist: pyqrack>=1.
|
|
30
|
+
Requires-Dist: pyqrack>=1.30.0
|
|
31
31
|
Requires-Dist: numpy>=1.16
|
|
32
32
|
|
|
33
33
|
PennyLane-Qrack Plugin
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
pennylane_qrack/QrackDeviceConfig.toml,sha256=F7u3h-coiXe0bm978GbU2uCiOaGMVdUOgGETZO4X1Vg,6383
|
|
2
|
+
pennylane_qrack/__init__.py,sha256=5iuZ5OqhRPLxj5cs9jGaUTDv55iPXRVbcDHM6FNk-5c,689
|
|
3
|
+
pennylane_qrack/_version.py,sha256=8HPTP86_e4l7AaxjJfazvFZhnmqrdJC7kEorv1TORhk,710
|
|
4
|
+
pennylane_qrack/qrack_device.cpp,sha256=7RRwhGBaN9fvRASYDgQI9DA21PEcq6grkZRBNP9YGMg,37500
|
|
5
|
+
pennylane_qrack/qrack_device.py,sha256=sGVTLXoh3SwBGOmVHqo1ivUS1h1x1bM7iP8aegXeUzQ,26702
|
|
6
|
+
pennylane_qrack-0.9.7.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
7
|
+
pennylane_qrack-0.9.7.dist-info/METADATA,sha256=6gwQMNGwjiJPdtNdhESZoUg2gb3KUJ_AX1KXq2C1mRA,5668
|
|
8
|
+
pennylane_qrack-0.9.7.dist-info/WHEEL,sha256=MKsKTYcJ8UB7nlhmb6_u5qoYj_ULa0PDSKtamp2tTfc,98
|
|
9
|
+
pennylane_qrack-0.9.7.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
|
|
10
|
+
pennylane_qrack-0.9.7.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
11
|
+
pennylane_qrack-0.9.7.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
pennylane_qrack/QrackDeviceConfig.toml,sha256=F7u3h-coiXe0bm978GbU2uCiOaGMVdUOgGETZO4X1Vg,6383
|
|
2
|
-
pennylane_qrack/__init__.py,sha256=5iuZ5OqhRPLxj5cs9jGaUTDv55iPXRVbcDHM6FNk-5c,689
|
|
3
|
-
pennylane_qrack/_version.py,sha256=v7-ZDJ2hnLOCi3jLckbhrPk9YtZJqmgt9wTS3C0d08c,710
|
|
4
|
-
pennylane_qrack/qrack_device.cpp,sha256=C1iqtzQr9-5MG46Df1N4lFDqHrcX2qIib1qG3W87Qjo,36799
|
|
5
|
-
pennylane_qrack/qrack_device.py,sha256=ew_9fcjNRt2qcp1zxR_jgDtAVagia2rGLqFqkn2Huow,24312
|
|
6
|
-
pennylane_qrack-0.9.5.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
7
|
-
pennylane_qrack-0.9.5.dist-info/METADATA,sha256=oZ2Q2ok68hBHVChoMvWf020YK7HAaYCeyNyGS6mQ1yk,5668
|
|
8
|
-
pennylane_qrack-0.9.5.dist-info/WHEEL,sha256=MKsKTYcJ8UB7nlhmb6_u5qoYj_ULa0PDSKtamp2tTfc,98
|
|
9
|
-
pennylane_qrack-0.9.5.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
|
|
10
|
-
pennylane_qrack-0.9.5.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
11
|
-
pennylane_qrack-0.9.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|