pennylane-qrack 0.10.17__tar.gz → 0.10.19__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 (30) hide show
  1. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/CHANGELOG.md +5 -0
  2. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/Makefile +6 -13
  3. {pennylane_qrack-0.10.17/pennylane_qrack.egg-info → pennylane_qrack-0.10.19}/PKG-INFO +1 -1
  4. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack/QrackDeviceConfig.toml +0 -1
  5. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack/_version.py +1 -1
  6. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack/qrack_device.py +6 -6
  7. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19/pennylane_qrack.egg-info}/PKG-INFO +1 -1
  8. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/tests/test_apply.py +20 -20
  9. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/CMakeLists.txt +0 -0
  10. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/LICENSE +0 -0
  11. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/MANIFEST.in +0 -0
  12. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/README.rst +0 -0
  13. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/DataView.hpp +0 -0
  14. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/DynamicLibraryLoader.hpp +0 -0
  15. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/Exception.hpp +0 -0
  16. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/QuantumDevice.hpp +0 -0
  17. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/RuntimeCAPI.h +0 -0
  18. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/catalyst/runtime/include/Types.h +0 -0
  19. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack/__init__.py +0 -0
  20. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack/qrack_device.cpp +0 -0
  21. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack.egg-info/SOURCES.txt +0 -0
  22. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack.egg-info/dependency_links.txt +0 -0
  23. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack.egg-info/entry_points.txt +0 -0
  24. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack.egg-info/requires.txt +0 -0
  25. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/pennylane_qrack.egg-info/top_level.txt +0 -0
  26. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/requirements.txt +0 -0
  27. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/setup.cfg +0 -0
  28. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/setup.py +0 -0
  29. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/tests/test_integration.py +0 -0
  30. {pennylane_qrack-0.10.17 → pennylane_qrack-0.10.19}/tests/test_units.py +0 -0
@@ -6,6 +6,9 @@
6
6
 
7
7
  ### Breaking changes 💔
8
8
 
9
+ * The `qml.QubitStateVector` template has been removed. Instead, use `qml.StatePrep`.
10
+ [(#27)](https://github.com/unitaryfund/pennylane-qrack/pull/27/)
11
+
9
12
  ### Deprecations 👋
10
13
 
11
14
  ### Documentation 📝
@@ -14,6 +17,8 @@
14
17
 
15
18
  ### Contributors ✍️
16
19
 
20
+ Andrija Paurevic
21
+
17
22
  This release contains contributions from (in alphabetical order):
18
23
 
19
24
  ---
@@ -24,32 +24,25 @@ 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 5010a034723ff0af666aa45ae3e9ea87400588a4; cd ..
27
+ git clone https://github.com/unitaryfund/qrack.git; cd qrack; git checkout 87a8b72a7e0af64745aa6b86bf080e828b933851; cd ..
28
28
  endif
29
29
  mkdir -p qrack/build
30
30
  ifeq ($(UNAME_S),Linux)
31
31
  ifeq ($(UNAME_P),x86_64)
32
- cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON ..; make all; \
33
- mkdir ../../_qrack_include; mkdir ../../_qrack_include/qrack; cp -r ../include/* ../../_qrack_include/qrack; cp -r include/* ../../_qrack_include/qrack; \
34
- cd ../../..
32
+ cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON ..; make all; cd ../..
35
33
  else
36
- cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF ..; make all; \
37
- mkdir ../../_qrack_include; mkdir ../../_qrack_include/qrack; cp -r ../include/* ../../_qrack_include/qrack; cp -r include/* ../../_qrack_include/qrack; \
38
- cd ../../..
34
+ cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_DEVRAND=ON -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF ..; make all; cd ../..
39
35
  endif
40
36
  endif
41
37
  ifeq ($(UNAME_S),Darwin)
42
38
  ifeq ($(UNAME_P),x86_64)
43
- cd qrack/build; cmake ..; make all; \
44
- mkdir ../../_qrack_include; mkdir ../../_qrack_include/qrack; cp -r ../include/* ../../_qrack_include/qrack; cp -r include/* ../../_qrack_include/qrack; \
45
- cd ../../..
39
+ cd qrack/build; cmake ..; make all; cd ../..
46
40
  else
47
- cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF ..; make all; \
48
- mkdir ../../_qrack_include; mkdir ../../_qrack_include/qrack; cp -r ../include/* ../../_qrack_include/qrack; cp -r include/* ../../_qrack_include/qrack; \
49
- cd ../../..
41
+ cd qrack/build; cmake -DENABLE_RDRAND=OFF -DENABLE_COMPLEX_X2=OFF -DENABLE_SSE3=OFF -DENABLE_OPENCL=OFF ..; make all; cd ../..
50
42
  endif
51
43
  endif
52
44
  endif
45
+ mkdir _qrack_include; mkdir _qrack_include/qrack; cp -r qrack/include/* _qrack_include/qrack; cp -r qrack/build/include/* _qrack_include/qrack; \
53
46
  cd pennylane_qrack; cmake ..; make all
54
47
 
55
48
  .PHONY: install
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.10.17
3
+ Version: 0.10.19
4
4
  Summary: PennyLane plugin for Qrack.
5
5
  Home-page: http://github.com/vm6502q
6
6
  Maintainer: vm6502q
@@ -58,7 +58,6 @@ Identity = { properties = [ "controllable", "invertible" ] }
58
58
  # SISWAP = {}
59
59
  # SQISW = {}
60
60
  # BasisState = {}
61
- # QubitStateVector = {}
62
61
  # StatePrep = {}
63
62
  # ControlledQubitUnitary = {}
64
63
  # DiagonalQubitUnitary = {}
@@ -16,4 +16,4 @@
16
16
  Version number (major.minor.patch[-label])
17
17
  """
18
18
 
19
- __version__ = "0.10.17"
19
+ __version__ = "0.10.19"
@@ -27,7 +27,7 @@ import numpy as np
27
27
  from pennylane import DeviceError, QuantumFunctionError
28
28
  from pennylane.devices import QubitDevice
29
29
  from pennylane.ops import (
30
- QubitStateVector,
30
+ StatePrep,
31
31
  BasisState,
32
32
  QubitUnitary,
33
33
  CRZ,
@@ -158,9 +158,9 @@ class QrackDevice(QubitDevice):
158
158
  # Use GPU acceleration? (Default is "true")
159
159
  isOpenCL = True
160
160
  # Use multi-GPU (or "multi-page") acceleration? (Default is "false")
161
- isPaged = False
161
+ isPaged = True
162
162
  # Use CPU/GPU method hybridization? (Default is "false")
163
- isCpuGpuHybrid = False
163
+ isCpuGpuHybrid = True
164
164
  # 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
165
  isHostPointer = False
166
166
  # Noise parameter. (Default is "0"; depolarizing noise intensity can also be controlled by "QRACK_GATE_DEPOLARIZATION" environment variable)
@@ -238,8 +238,8 @@ class QrackDevice(QubitDevice):
238
238
 
239
239
  def _apply(self):
240
240
  for op in self._circuit:
241
- if isinstance(op, QubitStateVector):
242
- self._apply_qubit_state_vector(op)
241
+ if isinstance(op, StatePrep):
242
+ self._apply_state_prep(op)
243
243
  elif isinstance(op, BasisState):
244
244
  self._apply_basis_state(op)
245
245
  elif isinstance(op, QubitUnitary):
@@ -268,7 +268,7 @@ class QrackDevice(QubitDevice):
268
268
 
269
269
  return state_vector.flatten()
270
270
 
271
- def _apply_qubit_state_vector(self, op):
271
+ def _apply_state_prep(self, op):
272
272
  """Initialize state with a state vector"""
273
273
  wires = op.wires
274
274
  input_state = op.parameters[0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.10.17
3
+ Version: 0.10.19
4
4
  Summary: PennyLane plugin for Qrack.
5
5
  Home-page: http://github.com/vm6502q
6
6
  Maintainer: vm6502q
@@ -245,12 +245,12 @@ class TestStateApply:
245
245
  expected = dev._expand_state(expected, op_wires)
246
246
  assert np.allclose(res, expected, tol)
247
247
 
248
- def test_qubit_state_vector(self, init_state, tol):
249
- """Test QubitStateVector application"""
248
+ def test_state_prep(self, init_state, tol):
249
+ """Test StatePrep application"""
250
250
  dev = QrackDevice(1, isOpenCL=False)
251
251
  state = init_state(1)
252
252
 
253
- op = qml.QubitStateVector(state, wires=[0])
253
+ op = qml.StatePrep(state, wires=[0])
254
254
  dev.apply([op])
255
255
  dev._obs_queue = []
256
256
 
@@ -260,12 +260,12 @@ class TestStateApply:
260
260
 
261
261
  @pytest.mark.parametrize("device_wires", [3, 4, 5])
262
262
  @pytest.mark.parametrize("op_wires", [[0], [2], [0, 1], [1, 0], [2, 0]])
263
- def test_qubit_state_vector_on_wires_subset(self, init_state, device_wires, op_wires, tol):
264
- """Test QubitStateVector application on a subset of device wires"""
263
+ def test_state_prep_on_wires_subset(self, init_state, device_wires, op_wires, tol):
264
+ """Test StatePrep application on a subset of device wires"""
265
265
  dev = QrackDevice(device_wires, isOpenCL=False)
266
266
  state = init_state(len(op_wires))
267
267
 
268
- op = qml.QubitStateVector(state, wires=op_wires)
268
+ op = qml.StatePrep(state, wires=op_wires)
269
269
  dev.apply([op])
270
270
  dev._obs_queue = []
271
271
 
@@ -274,7 +274,7 @@ class TestStateApply:
274
274
 
275
275
  assert np.allclose(res, expected, tol)
276
276
 
277
- def test_invalid_qubit_state_vector(self):
277
+ def test_invalid_state_prep(self):
278
278
  """Test that an exception is raised if the state
279
279
  vector is the wrong size"""
280
280
  dev = QrackDevice(2, isOpenCL=False)
@@ -284,7 +284,7 @@ class TestStateApply:
284
284
  ValueError,
285
285
  match="State vector must have shape \\(2\\*\\*wires,\\) or \\(batch_size, 2\\*\\*wires\\).",
286
286
  ):
287
- op = qml.QubitStateVector(state, wires=[0, 1])
287
+ op = qml.StatePrep(state, wires=[0, 1])
288
288
  dev.apply([op])
289
289
 
290
290
  @pytest.mark.parametrize("op,mat", single_qubit)
@@ -293,7 +293,7 @@ class TestStateApply:
293
293
  dev = QrackDevice(1, isOpenCL=False)
294
294
  state = init_state(1)
295
295
 
296
- dev.apply([qml.QubitStateVector(state, wires=[0]), op])
296
+ dev.apply([qml.StatePrep(state, wires=[0]), op])
297
297
  dev._obs_queue = []
298
298
 
299
299
  res = dev.state
@@ -328,7 +328,7 @@ class TestStateApply:
328
328
  state = init_state(1)
329
329
 
330
330
  op.data = [theta]
331
- dev.apply([qml.QubitStateVector(state, wires=[0]), op])
331
+ dev.apply([qml.StatePrep(state, wires=[0]), op])
332
332
  dev._obs_queue = []
333
333
 
334
334
  res = dev.state
@@ -368,7 +368,7 @@ class TestStateApply:
368
368
  state = init_state(1)
369
369
 
370
370
  op.data = [phi, theta, omega]
371
- dev.apply([qml.QubitStateVector(state, wires=[0]), op])
371
+ dev.apply([qml.StatePrep(state, wires=[0]), op])
372
372
  dev._obs_queue = []
373
373
 
374
374
  res = dev.state
@@ -406,7 +406,7 @@ class TestStateApply:
406
406
  dev = QrackDevice(2, isOpenCL=False)
407
407
  state = init_state(2)
408
408
 
409
- dev.apply([qml.QubitStateVector(state, wires=[0, 1]), op])
409
+ dev.apply([qml.StatePrep(state, wires=[0, 1]), op])
410
410
  dev._obs_queue = []
411
411
 
412
412
  res = dev.state
@@ -442,7 +442,7 @@ class TestStateApply:
442
442
  state = init_state(N)
443
443
 
444
444
  op = qml.QubitUnitary(mat, wires=list(range(N)))
445
- dev.apply([qml.QubitStateVector(state, wires=list(range(N))), op])
445
+ dev.apply([qml.StatePrep(state, wires=list(range(N))), op])
446
446
  dev._obs_queue = []
447
447
 
448
448
  res = dev.state
@@ -486,7 +486,7 @@ class TestStateApply:
486
486
  dev = QrackDevice(3, isOpenCL=False)
487
487
  state = init_state(3)
488
488
 
489
- dev.apply([qml.QubitStateVector(state, wires=[0, 1, 2]), op])
489
+ dev.apply([qml.StatePrep(state, wires=[0, 1, 2]), op])
490
490
  dev._obs_queue = []
491
491
 
492
492
  res = dev.state
@@ -517,7 +517,7 @@ class TestStateApply:
517
517
  dev = QrackDevice(4, isOpenCL=False)
518
518
  state = init_state(4)
519
519
 
520
- dev.apply([qml.QubitStateVector(state, wires=[0, 1, 2, 3]), op])
520
+ dev.apply([qml.StatePrep(state, wires=[0, 1, 2, 3]), op])
521
521
  dev._obs_queue = []
522
522
 
523
523
  res = dev.state
@@ -532,7 +532,7 @@ class TestStateApply:
532
532
  state = init_state(2)
533
533
 
534
534
  op.data = [theta]
535
- dev.apply([qml.QubitStateVector(state, wires=[0, 1]), op])
535
+ dev.apply([qml.StatePrep(state, wires=[0, 1]), op])
536
536
 
537
537
  dev._obs_queue = []
538
538
 
@@ -573,7 +573,7 @@ class TestStateApply:
573
573
  state = init_state(2)
574
574
 
575
575
  op.data = [phi, theta, omega]
576
- dev.apply([qml.QubitStateVector(state, wires=[0, 1]), op])
576
+ dev.apply([qml.StatePrep(state, wires=[0, 1]), op])
577
577
  dev._obs_queue = []
578
578
 
579
579
  res = dev.state
@@ -582,12 +582,12 @@ class TestStateApply:
582
582
  expected = [(x * x.conj()).real for x in expected]
583
583
  assert np.allclose(res, expected, tol)
584
584
 
585
- def test_apply_errors_qubit_state_vector(self):
585
+ def test_apply_errors_state_prep(self):
586
586
  """Test that apply fails for incorrect state preparation."""
587
587
  dev = QrackDevice(2, isOpenCL=False)
588
588
 
589
589
  with pytest.raises(ValueError, match="Sum of amplitudes-squared does not equal one."):
590
- dev.apply([qml.QubitStateVector(np.array([1, -1]), wires=[0])])
590
+ dev.apply([qml.StatePrep(np.array([1, -1]), wires=[0])])
591
591
 
592
592
  with pytest.raises(
593
593
  ValueError,
@@ -595,7 +595,7 @@ class TestStateApply:
595
595
  ):
596
596
  p = np.array([1, 0, 1, 1, 0]) / np.sqrt(3)
597
597
  dev.reset()
598
- dev.apply([qml.QubitStateVector(p, wires=[0, 1])])
598
+ dev.apply([qml.StatePrep(p, wires=[0, 1])])
599
599
 
600
600
  def test_apply_errors_basis_state(self):
601
601
  """Test that apply fails for incorrect basis state preparation."""