pennylane-qrack 0.10.0__py3-none-macosx_14_0_arm64.whl → 0.10.2__py3-none-macosx_14_0_arm64.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/CMakeCache.txt +7 -7
- pennylane_qrack/Makefile +10 -10
- pennylane_qrack/_version.py +1 -1
- pennylane_qrack/libqrack_device.dylib +0 -0
- pennylane_qrack/qrack_device.py +53 -25
- {pennylane_qrack-0.10.0.dist-info → pennylane_qrack-0.10.2.dist-info}/METADATA +1 -1
- pennylane_qrack-0.10.2.dist-info/RECORD +15 -0
- {pennylane_qrack-0.10.0.dist-info → pennylane_qrack-0.10.2.dist-info}/WHEEL +1 -1
- pennylane_qrack-0.10.0.dist-info/RECORD +0 -15
- {pennylane_qrack-0.10.0.dist-info → pennylane_qrack-0.10.2.dist-info}/LICENSE +0 -0
- {pennylane_qrack-0.10.0.dist-info → pennylane_qrack-0.10.2.dist-info}/entry_points.txt +0 -0
- {pennylane_qrack-0.10.0.dist-info → pennylane_qrack-0.10.2.dist-info}/top_level.txt +0 -0
pennylane_qrack/CMakeCache.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This is the CMakeCache file.
|
|
2
2
|
# For build in directory: /Users/runner/work/pennylane-qrack/pennylane-qrack/pennylane_qrack
|
|
3
|
-
# It was generated by CMake: /opt/homebrew/Cellar/cmake/3.30.
|
|
3
|
+
# It was generated by CMake: /opt/homebrew/Cellar/cmake/3.30.5/bin/cmake
|
|
4
4
|
# You can edit this file to change values found and used by cmake.
|
|
5
5
|
# If you do not want to change any of the values, simply exit the editor.
|
|
6
6
|
# If you do want to change a value, simply edit, save, and exit the editor.
|
|
@@ -247,15 +247,15 @@ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
|
|
247
247
|
//Minor version of cmake used to create the current loaded cache
|
|
248
248
|
CMAKE_CACHE_MINOR_VERSION:INTERNAL=30
|
|
249
249
|
//Patch version of cmake used to create the current loaded cache
|
|
250
|
-
CMAKE_CACHE_PATCH_VERSION:INTERNAL=
|
|
250
|
+
CMAKE_CACHE_PATCH_VERSION:INTERNAL=5
|
|
251
251
|
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
|
|
252
252
|
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
|
|
253
253
|
//Path to CMake executable.
|
|
254
|
-
CMAKE_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.
|
|
254
|
+
CMAKE_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake
|
|
255
255
|
//Path to cpack program executable.
|
|
256
|
-
CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.
|
|
256
|
+
CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.5/bin/cpack
|
|
257
257
|
//Path to ctest program executable.
|
|
258
|
-
CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.
|
|
258
|
+
CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.5/bin/ctest
|
|
259
259
|
//ADVANCED property for variable: CMAKE_CXX_COMPILER
|
|
260
260
|
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
|
|
261
261
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS
|
|
@@ -283,7 +283,7 @@ CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
|
|
283
283
|
//ADVANCED property for variable: CMAKE_DLLTOOL
|
|
284
284
|
CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
|
|
285
285
|
//Path to cache edit program executable.
|
|
286
|
-
CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.
|
|
286
|
+
CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.5/bin/ccmake
|
|
287
287
|
//Executable file format
|
|
288
288
|
CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO
|
|
289
289
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
|
@@ -342,7 +342,7 @@ CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
|
|
342
342
|
//ADVANCED property for variable: CMAKE_READELF
|
|
343
343
|
CMAKE_READELF-ADVANCED:INTERNAL=1
|
|
344
344
|
//Path to CMake installation.
|
|
345
|
-
CMAKE_ROOT:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.
|
|
345
|
+
CMAKE_ROOT:INTERNAL=/opt/homebrew/Cellar/cmake/3.30.5/share/cmake
|
|
346
346
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
|
347
347
|
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
|
348
348
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
pennylane_qrack/Makefile
CHANGED
|
@@ -48,10 +48,10 @@ cmake_force:
|
|
|
48
48
|
SHELL = /bin/sh
|
|
49
49
|
|
|
50
50
|
# The CMake executable.
|
|
51
|
-
CMAKE_COMMAND = /opt/homebrew/Cellar/cmake/3.30.
|
|
51
|
+
CMAKE_COMMAND = /opt/homebrew/Cellar/cmake/3.30.5/bin/cmake
|
|
52
52
|
|
|
53
53
|
# The command to remove a file.
|
|
54
|
-
RM = /opt/homebrew/Cellar/cmake/3.30.
|
|
54
|
+
RM = /opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -E rm -f
|
|
55
55
|
|
|
56
56
|
# Escaping for special characters.
|
|
57
57
|
EQUALS = =
|
|
@@ -68,7 +68,7 @@ CMAKE_BINARY_DIR = /Users/runner/work/pennylane-qrack/pennylane-qrack/pennylane_
|
|
|
68
68
|
# Special rule for the target edit_cache
|
|
69
69
|
edit_cache:
|
|
70
70
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
|
|
71
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
71
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
72
72
|
.PHONY : edit_cache
|
|
73
73
|
|
|
74
74
|
# Special rule for the target edit_cache
|
|
@@ -78,7 +78,7 @@ edit_cache/fast: edit_cache
|
|
|
78
78
|
# Special rule for the target rebuild_cache
|
|
79
79
|
rebuild_cache:
|
|
80
80
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
|
|
81
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
81
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
|
82
82
|
.PHONY : rebuild_cache
|
|
83
83
|
|
|
84
84
|
# Special rule for the target rebuild_cache
|
|
@@ -97,37 +97,37 @@ list_install_components/fast: list_install_components
|
|
|
97
97
|
# Special rule for the target install
|
|
98
98
|
install: preinstall
|
|
99
99
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
|
|
100
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
100
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -P cmake_install.cmake
|
|
101
101
|
.PHONY : install
|
|
102
102
|
|
|
103
103
|
# Special rule for the target install
|
|
104
104
|
install/fast: preinstall/fast
|
|
105
105
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
|
|
106
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
106
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -P cmake_install.cmake
|
|
107
107
|
.PHONY : install/fast
|
|
108
108
|
|
|
109
109
|
# Special rule for the target install/local
|
|
110
110
|
install/local: preinstall
|
|
111
111
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
|
|
112
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
112
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
|
113
113
|
.PHONY : install/local
|
|
114
114
|
|
|
115
115
|
# Special rule for the target install/local
|
|
116
116
|
install/local/fast: preinstall/fast
|
|
117
117
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
|
|
118
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
118
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
|
|
119
119
|
.PHONY : install/local/fast
|
|
120
120
|
|
|
121
121
|
# Special rule for the target install/strip
|
|
122
122
|
install/strip: preinstall
|
|
123
123
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
|
|
124
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
124
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
|
125
125
|
.PHONY : install/strip
|
|
126
126
|
|
|
127
127
|
# Special rule for the target install/strip
|
|
128
128
|
install/strip/fast: preinstall/fast
|
|
129
129
|
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
|
|
130
|
-
/opt/homebrew/Cellar/cmake/3.30.
|
|
130
|
+
/opt/homebrew/Cellar/cmake/3.30.5/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
|
|
131
131
|
.PHONY : install/strip/fast
|
|
132
132
|
|
|
133
133
|
# The main all target
|
pennylane_qrack/_version.py
CHANGED
|
Binary file
|
pennylane_qrack/qrack_device.py
CHANGED
|
@@ -24,7 +24,7 @@ import itertools as it
|
|
|
24
24
|
|
|
25
25
|
import numpy as np
|
|
26
26
|
|
|
27
|
-
from pennylane import QubitDevice, DeviceError
|
|
27
|
+
from pennylane import QubitDevice, DeviceError, QuantumFunctionError
|
|
28
28
|
from pennylane.ops import (
|
|
29
29
|
QubitStateVector,
|
|
30
30
|
BasisState,
|
|
@@ -175,31 +175,34 @@ class QrackDevice(QubitDevice):
|
|
|
175
175
|
|
|
176
176
|
def __init__(self, wires=0, shots=None, **kwargs):
|
|
177
177
|
options = dict(kwargs)
|
|
178
|
-
if
|
|
179
|
-
self.isStabilizerHybrid = options[
|
|
180
|
-
if
|
|
181
|
-
self.isTensorNetwork = options[
|
|
182
|
-
if
|
|
183
|
-
self.isSchmidtDecompose = options[
|
|
184
|
-
if
|
|
185
|
-
self.isBinaryDecisionTree = options[
|
|
186
|
-
if
|
|
187
|
-
self.isOpenCL = options[
|
|
188
|
-
if
|
|
189
|
-
self.isHostPointer = options[
|
|
190
|
-
if
|
|
191
|
-
self.noise = options[
|
|
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 "noise" in options:
|
|
191
|
+
self.noise = options["noise"]
|
|
192
|
+
if (self.noise != 0) and (shots is None):
|
|
193
|
+
raise ValueError("Shots must be finite for noisy simulation (not analytical mode).")
|
|
192
194
|
super().__init__(wires=wires, shots=shots)
|
|
193
195
|
self._state = QrackSimulator(
|
|
194
196
|
self.num_wires,
|
|
195
|
-
isStabilizerHybrid
|
|
197
|
+
isStabilizerHybrid=self.isStabilizerHybrid,
|
|
196
198
|
isTensorNetwork=self.isTensorNetwork,
|
|
197
199
|
isSchmidtDecompose=self.isSchmidtDecompose,
|
|
198
200
|
isBinaryDecisionTree=self.isBinaryDecisionTree,
|
|
199
201
|
isOpenCL=self.isOpenCL,
|
|
200
202
|
isHostPointer=self.isHostPointer,
|
|
201
|
-
noise
|
|
203
|
+
noise=self.noise,
|
|
202
204
|
)
|
|
205
|
+
self._circuit = []
|
|
203
206
|
|
|
204
207
|
def _reverse_state(self):
|
|
205
208
|
end = self.num_wires - 1
|
|
@@ -216,7 +219,14 @@ class QrackDevice(QubitDevice):
|
|
|
216
219
|
operations (List[pennylane.Operation]): operations to be applied
|
|
217
220
|
"""
|
|
218
221
|
|
|
219
|
-
|
|
222
|
+
self._circuit = self._circuit + operations
|
|
223
|
+
if self.noise == 0:
|
|
224
|
+
self._apply()
|
|
225
|
+
self._circuit = []
|
|
226
|
+
# else: Defer application until shots or expectation values are requested
|
|
227
|
+
|
|
228
|
+
def _apply(self):
|
|
229
|
+
for op in self._circuit:
|
|
220
230
|
if isinstance(op, QubitStateVector):
|
|
221
231
|
self._apply_qubit_state_vector(op)
|
|
222
232
|
elif isinstance(op, BasisState):
|
|
@@ -647,20 +657,38 @@ class QrackDevice(QubitDevice):
|
|
|
647
657
|
# estimate the ev
|
|
648
658
|
return np.mean(self.sample(observable))
|
|
649
659
|
|
|
660
|
+
def _generate_sample(self):
|
|
661
|
+
rev_sample = self._state.m_all()
|
|
662
|
+
sample = 0
|
|
663
|
+
for i in range(self.num_wires):
|
|
664
|
+
if (rev_sample & (1 << i)) > 0:
|
|
665
|
+
sample |= 1 << (self.num_wires - (i + 1))
|
|
666
|
+
return sample
|
|
667
|
+
|
|
650
668
|
def generate_samples(self):
|
|
651
669
|
if self.shots is None:
|
|
652
|
-
raise
|
|
670
|
+
raise QuantumFunctionError(
|
|
653
671
|
"The number of shots has to be explicitly set on the device "
|
|
654
672
|
"when using sample-based measurements."
|
|
655
673
|
)
|
|
656
674
|
|
|
675
|
+
if self.noise != 0:
|
|
676
|
+
self._samples = []
|
|
677
|
+
for _ in range(self.shots):
|
|
678
|
+
self._state.reset_all()
|
|
679
|
+
self._apply()
|
|
680
|
+
self._samples.append(self._generate_sample())
|
|
681
|
+
self._samples = QubitDevice.states_to_binary(
|
|
682
|
+
np.array([self._generate_sample()]), self.num_wires
|
|
683
|
+
)
|
|
684
|
+
self._circuit = []
|
|
685
|
+
|
|
686
|
+
return self._samples
|
|
687
|
+
|
|
657
688
|
if self.shots == 1:
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (rev_sample & (1 << i)) > 0:
|
|
662
|
-
sample |= 1 << (self.num_wires - (i + 1))
|
|
663
|
-
self._samples = QubitDevice.states_to_binary(np.array([sample]), self.num_wires)
|
|
689
|
+
self._samples = QubitDevice.states_to_binary(
|
|
690
|
+
np.array([self._generate_sample()]), self.num_wires
|
|
691
|
+
)
|
|
664
692
|
|
|
665
693
|
return self._samples
|
|
666
694
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pennylane_qrack/CMakeCache.txt,sha256=yyGw0eJUEd2KrfJbaqTj4OEttj99GFZ8mWT05Ri8YdM,16107
|
|
2
|
+
pennylane_qrack/Makefile,sha256=t7k0AbfvtdZhj-gehrEfc-iqgt8uUxZl1DhsqP52HVE,7819
|
|
3
|
+
pennylane_qrack/QrackDeviceConfig.toml,sha256=t_IQVSFR-GJ3VuqpQqm4M5gA3TVL4-y0qPq-f0FJwac,6219
|
|
4
|
+
pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
|
|
5
|
+
pennylane_qrack/_version.py,sha256=YL61LFzCM_V-BsclpB2jHSN9t5GG3al6nqVVC3JGW7A,692
|
|
6
|
+
pennylane_qrack/cmake_install.cmake,sha256=8dAO9uSYoUtsvOmW_n3-YvpT5rtoyLskafI-8HtQyLg,3088
|
|
7
|
+
pennylane_qrack/libqrack_device.dylib,sha256=Zf6A1Ax9Jux2cUA-wb0HUgCyenRishuCR4ZFTFSVQAg,3123240
|
|
8
|
+
pennylane_qrack/qrack_device.cpp,sha256=eRoowI7n9XV63aoZEaDjWmK1NC4JQ1GBeL2uggDttG0,36846
|
|
9
|
+
pennylane_qrack/qrack_device.py,sha256=VFwbhAKvIKwpO9_fZ_sGv__DvYzTqRW77Hd8k0-DByk,26947
|
|
10
|
+
pennylane_qrack-0.10.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
11
|
+
pennylane_qrack-0.10.2.dist-info/METADATA,sha256=L9OiqwRP5f5EB4FRcVTBXKRnMGqfQGwY7xRuVdb4FQE,5525
|
|
12
|
+
pennylane_qrack-0.10.2.dist-info/WHEEL,sha256=_P9yaEVjZzy0IOGBN1AT-XwxAW9zXQLsQ8q-c2icof0,105
|
|
13
|
+
pennylane_qrack-0.10.2.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
|
|
14
|
+
pennylane_qrack-0.10.2.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
15
|
+
pennylane_qrack-0.10.2.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
pennylane_qrack/CMakeCache.txt,sha256=SoJjAjPCsioksO73mV70sFAuui4JRgAWz0XQVL-7KS8,16107
|
|
2
|
-
pennylane_qrack/Makefile,sha256=X9xVYqxwh5W3vMzHx_lX9p2-GFth6QULomGmp1DZIl8,7819
|
|
3
|
-
pennylane_qrack/QrackDeviceConfig.toml,sha256=t_IQVSFR-GJ3VuqpQqm4M5gA3TVL4-y0qPq-f0FJwac,6219
|
|
4
|
-
pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
|
|
5
|
-
pennylane_qrack/_version.py,sha256=B5LmSBtWlr0xzCDb5hXyIgjkJdD6PC22Nfx39DaN2mU,692
|
|
6
|
-
pennylane_qrack/cmake_install.cmake,sha256=8dAO9uSYoUtsvOmW_n3-YvpT5rtoyLskafI-8HtQyLg,3088
|
|
7
|
-
pennylane_qrack/libqrack_device.dylib,sha256=aBytTres7sUOns_4HhLXdlnHscfoP2ha7Ty3xf3SX1U,3169288
|
|
8
|
-
pennylane_qrack/qrack_device.cpp,sha256=eRoowI7n9XV63aoZEaDjWmK1NC4JQ1GBeL2uggDttG0,36846
|
|
9
|
-
pennylane_qrack/qrack_device.py,sha256=tN_RPJU8m4yr7AMfJQb6apRNxCKyX1XCIxpVwFo-2jw,26001
|
|
10
|
-
pennylane_qrack-0.10.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
11
|
-
pennylane_qrack-0.10.0.dist-info/METADATA,sha256=0fJmGOxFKpzxY0-57BPftqFEORQfqYWKCXZsSy19dAE,5525
|
|
12
|
-
pennylane_qrack-0.10.0.dist-info/WHEEL,sha256=46M9oAt9fSQEkrEG7puZrs0D68SX3wCVnMePIovRInw,105
|
|
13
|
-
pennylane_qrack-0.10.0.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
|
|
14
|
-
pennylane_qrack-0.10.0.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
15
|
-
pennylane_qrack-0.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|