pennylane-qrack 0.9.6__py3-none-manylinux_2_31_x86_64.whl → 0.9.7__py3-none-manylinux_2_31_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.

Potentially problematic release.


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

@@ -16,4 +16,4 @@
16
16
  Version number (major.minor.patch[-label])
17
17
  """
18
18
 
19
- __version__ = "0.9.6"
19
+ __version__ = "0.9.7"
Binary file
@@ -489,14 +489,25 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
489
489
  default:
490
490
  break;
491
491
  }
492
- obs_cache.push_back(QrackObservable({ basis }, { (bitLenInt)dev_wires[0U] }));
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
  }
@@ -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(self.num_wires, **kwargs)
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.6
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.28.0
30
+ Requires-Dist: pyqrack>=1.30.0
31
31
  Requires-Dist: numpy>=1.16
32
32
 
33
33
  PennyLane-Qrack Plugin
@@ -0,0 +1,15 @@
1
+ pennylane_qrack/CMakeCache.txt,sha256=R25Vd0Ah5_5xzIGQM_TjT1B570RIOqLnuhQMbNw7NNM,15054
2
+ pennylane_qrack/Makefile,sha256=S9Y76wF2BB8oc3vDHA8v5RY-cuUM9L1AYRtC0Uu8r60,7584
3
+ pennylane_qrack/QrackDeviceConfig.toml,sha256=o2qw-X6LLaePYTqbCx86yZtMMyKLsFCzg-SGgwoTLP4,6228
4
+ pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
5
+ pennylane_qrack/_version.py,sha256=fNCVE1KHF3s32-k7G_saP6CM4yVLe3H4t1_dlzdDhvY,691
6
+ pennylane_qrack/cmake_install.cmake,sha256=kW9d9vjuxI8PW08r6P09h7d6vmG74xsRzq1AuqYchh8,3336
7
+ pennylane_qrack/libqrack_device.so,sha256=6BOZhSJAdiu_6EjCVdHiCIPD8ulFbdUCATgtSHIQHgk,5597360
8
+ pennylane_qrack/qrack_device.cpp,sha256=1y3FDwlEksbwktPUHXaNP6UXUa__TtNnzy3tjhj2Hh0,36647
9
+ pennylane_qrack/qrack_device.py,sha256=4NAQpJc77DN7bqwU5-dOcR1iMHlY_YCzV6kmvAaZBRg,26019
10
+ pennylane_qrack-0.9.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ pennylane_qrack-0.9.7.dist-info/METADATA,sha256=WaHoJ04kRht6BEYObBREMAe6rt1Gwg0ggRGd5SM42Ys,5524
12
+ pennylane_qrack-0.9.7.dist-info/WHEEL,sha256=vhkxkeQo6qYm0IR8SRPDozzBUxC5K_7HGPrR2uA3AC8,110
13
+ pennylane_qrack-0.9.7.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
+ pennylane_qrack-0.9.7.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
+ pennylane_qrack-0.9.7.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- pennylane_qrack/CMakeCache.txt,sha256=R25Vd0Ah5_5xzIGQM_TjT1B570RIOqLnuhQMbNw7NNM,15054
2
- pennylane_qrack/Makefile,sha256=S9Y76wF2BB8oc3vDHA8v5RY-cuUM9L1AYRtC0Uu8r60,7584
3
- pennylane_qrack/QrackDeviceConfig.toml,sha256=o2qw-X6LLaePYTqbCx86yZtMMyKLsFCzg-SGgwoTLP4,6228
4
- pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
5
- pennylane_qrack/_version.py,sha256=CYxXujxsbQrWDaGGBX2W8Cwj_brYIw4tElRl5yY7Q2k,691
6
- pennylane_qrack/cmake_install.cmake,sha256=kW9d9vjuxI8PW08r6P09h7d6vmG74xsRzq1AuqYchh8,3336
7
- pennylane_qrack/libqrack_device.so,sha256=AJceb7DPeUtQyKYyU7iDRdv6QS20zX2JCgsvWdePWfU,5601800
8
- pennylane_qrack/qrack_device.cpp,sha256=QvbMcieq4HAoF2GbN4mrckMhS4XU4TZRijJslafW8nU,35963
9
- pennylane_qrack/qrack_device.py,sha256=EO-qaf4jE0WWY8hfnewebETxUQEMJsi6bNASmW2mdUY,23670
10
- pennylane_qrack-0.9.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- pennylane_qrack-0.9.6.dist-info/METADATA,sha256=2NdbG1ru5URXTfIyPKM5Tvt7byrFGlWFbjbTJXjGGSg,5524
12
- pennylane_qrack-0.9.6.dist-info/WHEEL,sha256=vhkxkeQo6qYm0IR8SRPDozzBUxC5K_7HGPrR2uA3AC8,110
13
- pennylane_qrack-0.9.6.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
- pennylane_qrack-0.9.6.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
- pennylane_qrack-0.9.6.dist-info/RECORD,,