pennylane-qrack 0.8.2__py3-none-macosx_13_0_x86_64.whl → 0.8.5__py3-none-macosx_13_0_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.

@@ -102,9 +102,9 @@ Prod = {}
102
102
 
103
103
  [measurement_processes]
104
104
 
105
- Expval = {}
106
- Var = {}
107
- Probs = {}
105
+ Expval = { condition = [ "analytic" ] }
106
+ Var = { condition = [ "analytic" ] }
107
+ Probs = { condition = [ "analytic" ] }
108
108
  State = { condition = [ "analytic" ] }
109
109
  Sample = { condition = [ "finiteshots" ] }
110
110
  Counts = { condition = [ "finiteshots" ] }
@@ -128,10 +128,6 @@ dynamic_qubit_management = true
128
128
  # The option key will be the key in a dictionary.
129
129
  # The string corresponds to a field queried in the `qml.Device` instance.
130
130
 
131
- # Number of qubit wires
132
- wires = "wires"
133
- # Number of shots per job
134
- shots = "shots"
135
131
  # Use "hybrid" stabilizer optimization? (Default is "true"; non-Clifford circuits will fall back to near-Clifford or universal simulation)
136
132
  is_hybrid_stabilizer = "isStabilizerHybrid"
137
133
  # Use "tensor network" optimization? (Default is "true"; prevents dynamic qubit de-allocation; might function sub-optimally with "hybrid" stabilizer enabled)
@@ -16,4 +16,4 @@
16
16
  Version number (major.minor.patch[-label])
17
17
  """
18
18
 
19
- __version__ = "0.8.2"
19
+ __version__ = "0.8.5"
Binary file
@@ -40,8 +40,6 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
40
40
  bool oc;
41
41
  bool hp;
42
42
  bool nw;
43
- bitLenInt allocated_qubits;
44
- bitLenInt mapped_qubits;
45
43
  size_t shots;
46
44
  Qrack::QInterfacePtr qsim;
47
45
  std::map<QubitIdType, bitLenInt> qubit_map;
@@ -391,8 +389,6 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
391
389
  , oc(true)
392
390
  , hp(false)
393
391
  , nw(false)
394
- , allocated_qubits(0U)
395
- , mapped_qubits(0U)
396
392
  , shots(1U)
397
393
  , qsim(nullptr)
398
394
  {
@@ -403,101 +399,46 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
403
399
  kwargs = trim(kwargs);
404
400
 
405
401
  std::map<std::string, int> keyMap;
406
- keyMap["'wires'"] = 1;
407
- keyMap["'shots'"] = 2;
408
- keyMap["'is_hybrid_stabilizer'"] = 3;
409
- keyMap["'is_tensor_network'"] = 4;
410
- keyMap["'is_schmidt_decomposed'"] = 5;
411
- keyMap["'is_schmidt_decomposition_parallel'"] = 6;
412
- keyMap["'is_qbdd'"] = 7;
413
- keyMap["'is_gpu'"] = 8;
414
- keyMap["'is_host_pointer'"] = 9;
415
- keyMap["'is_noisy'"] = 10;
402
+ keyMap["'is_hybrid_stabilizer'"] = 1;
403
+ keyMap["'is_tensor_network'"] = 2;
404
+ keyMap["'is_schmidt_decomposed'"] = 3;
405
+ keyMap["'is_schmidt_decomposition_parallel'"] = 4;
406
+ keyMap["'is_qbdd'"] = 5;
407
+ keyMap["'is_gpu'"] = 6;
408
+ keyMap["'is_host_pointer'"] =7;
409
+ keyMap["'is_noisy'"] = 8;
416
410
 
417
411
  size_t pos;
418
412
  while ((pos = kwargs.find(":")) != std::string::npos) {
419
413
  std::string key = trim(kwargs.substr(0, pos));
420
414
  kwargs.erase(0, pos + 1U);
421
-
422
- if (key == "'wires'") {
423
- // Handle if empty
424
- // We look for ',' or npos, to respect other Wires value kwargs
425
- if (kwargs.find("<Wires = []>") != kwargs.find("<Wires = []>,")) {
426
- continue;
427
- }
428
- if (kwargs.find("Wires([])") != kwargs.find("Wires([]),")) {
429
- continue;
430
- }
431
-
432
- // Handle if integer
433
- pos = kwargs.find(",");
434
- bool isInt = true;
435
- for (size_t i = 0; i < pos; ++i) {
436
- if ((kwargs[i] != ' ') && !isdigit(kwargs[i])) {
437
- isInt = false;
438
- break;
439
- }
440
- }
441
- if (isInt) {
442
- mapped_qubits = stoi(trim(kwargs.substr(0, pos)));
443
- for (size_t i = 0U; i < mapped_qubits; ++i) {
444
- qubit_map[i] = i;
445
- }
446
- kwargs.erase(0, pos + 1U);
447
-
448
- continue;
449
- }
450
-
451
- // Handles if Wires object
452
- pos = kwargs.find("]");
453
- std::string value = kwargs.substr(0, pos);
454
- kwargs.erase(0, pos + 3U);
455
- size_t p = value.find("[");
456
- value.erase(0, p + 1U);
457
- size_t q;
458
- while ((q = value.find(",")) != std::string::npos) {
459
- qubit_map[(QubitIdType)stoi(trim(value.substr(0, q)))] = mapped_qubits;
460
- ++mapped_qubits;
461
- value.erase(0, q + 1U);
462
- }
463
- qubit_map[stoi(trim(value))] = mapped_qubits;
464
- ++mapped_qubits;
465
-
466
- continue;
467
- }
468
-
469
415
  pos = kwargs.find(",");
470
416
  std::string value = trim(kwargs.substr(0, pos));
471
417
  kwargs.erase(0, pos + 1U);
472
418
  const bool val = (value == "True");
473
419
  switch (keyMap[key]) {
474
- case 2:
475
- if (value != "None") {
476
- shots = std::stoi(value);
477
- }
478
- break;
479
- case 3:
420
+ case 1:
480
421
  sh = val;
481
422
  break;
482
- case 4:
423
+ case 2:
483
424
  tn = val;
484
425
  break;
485
- case 5:
426
+ case 3:
486
427
  sd = val;
487
428
  break;
488
- case 6:
429
+ case 4:
489
430
  md = val;
490
431
  break;
491
- case 7:
432
+ case 5:
492
433
  bdt = val;
493
434
  break;
494
- case 8:
435
+ case 6:
495
436
  oc = val;
496
437
  break;
497
- case 9:
438
+ case 7:
498
439
  hp = val;
499
440
  break;
500
- case 10:
441
+ case 8:
501
442
  nw = val;
502
443
  break;
503
444
  default:
@@ -514,16 +455,8 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
514
455
  QrackDevice &operator=(QuantumDevice &&) = delete;
515
456
 
516
457
  auto AllocateQubit() -> QubitIdType override {
517
- if (allocated_qubits >= qubit_map.size()) {
518
- throw std::runtime_error("Catalyst has requested more qubits than exist in device, with "
519
- + std::to_string(allocated_qubits) + " allocated qubits. "
520
- + "(Set your wires count high enough, for the device.)");
521
- }
458
+ const QubitIdType label = qsim->GetQubitCount();
522
459
  qsim->Allocate(1U);
523
- auto it = qubit_map.begin();
524
- std::advance(it, allocated_qubits);
525
- const QubitIdType label = it->first;
526
- ++allocated_qubits;
527
460
  return label;
528
461
  }
529
462
  auto AllocateQubits(size_t num_qubits) -> std::vector<QubitIdType> override {
@@ -593,13 +526,11 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
593
526
  qsim->M(id);
594
527
  // Deallocate
595
528
  qsim->Dispose(id, 1U);
596
- --allocated_qubits;
597
529
  }
598
530
  void ReleaseAllQubits() override
599
531
  {
600
532
  // State vector is left empty
601
533
  qsim = QSIM_CONFIG(0U);
602
- allocated_qubits = 0;
603
534
  }
604
535
  [[nodiscard]] auto GetNumQubits() const -> size_t override
605
536
  {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.8.2
3
+ Version: 0.8.5
4
4
  Summary: PennyLane plugin for Qrack.
5
5
  Home-page: http://github.com/vm6502q
6
6
  Maintainer: vm6502q
@@ -0,0 +1,15 @@
1
+ pennylane_qrack/CMakeCache.txt,sha256=Hk2q8CV4hWr_JPCSDTzkNusi_kg8_FRoQojK4WAs4Jc,16093
2
+ pennylane_qrack/Makefile,sha256=QqEh3k483lsToRxd2wfoJfVsTg3ZBXQFZTVezlwRZ6c,7789
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=hUEV-i6qTtdizyr8T_tTr6ztElgzJo4rJXOEZPjDnXo,691
6
+ pennylane_qrack/cmake_install.cmake,sha256=V_v3t0o7_0wjq0Fxyg_StmG6P2KihbZa6ZWxI1ghWiQ,3088
7
+ pennylane_qrack/libqrack_device.dylib,sha256=oraMDTdX3Bz4q6InRz3ZM66A1bdGMo2GOI5ZYnsRbEE,4157728
8
+ pennylane_qrack/qrack_device.cpp,sha256=S5FYE36vjKRoocoOLDDwm19Td_KinvcYQmorCmDVgFc,35950
9
+ pennylane_qrack/qrack_device.py,sha256=EO-qaf4jE0WWY8hfnewebETxUQEMJsi6bNASmW2mdUY,23670
10
+ pennylane_qrack-0.8.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ pennylane_qrack-0.8.5.dist-info/METADATA,sha256=ApaacNWPOZmXcM98eWXGlI3VKFVS5U-82tVlVp7cxIE,5524
12
+ pennylane_qrack-0.8.5.dist-info/WHEEL,sha256=60K7tYdw_epTk1Owqrb1rl7YiJk3d5C8Cz_Kl9_euRM,106
13
+ pennylane_qrack-0.8.5.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
+ pennylane_qrack-0.8.5.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
+ pennylane_qrack-0.8.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (73.0.1)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-macosx_13_0_x86_64
5
5
 
@@ -1,15 +0,0 @@
1
- pennylane_qrack/CMakeCache.txt,sha256=Hk2q8CV4hWr_JPCSDTzkNusi_kg8_FRoQojK4WAs4Jc,16093
2
- pennylane_qrack/Makefile,sha256=QqEh3k483lsToRxd2wfoJfVsTg3ZBXQFZTVezlwRZ6c,7789
3
- pennylane_qrack/QrackDeviceConfig.toml,sha256=fAJzw1da3tBCiKtsem3AeHN4q80E0Qsd-Ms4B9j6aQE,6226
4
- pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
5
- pennylane_qrack/_version.py,sha256=-uFEWDOiTBdUvgcs7I7Jqu8iLgx2Xuzn9ShYjA0WoI0,691
6
- pennylane_qrack/cmake_install.cmake,sha256=V_v3t0o7_0wjq0Fxyg_StmG6P2KihbZa6ZWxI1ghWiQ,3088
7
- pennylane_qrack/libqrack_device.dylib,sha256=ua7kWdlm_C_vQjYerHm1yPXzv7bbkUbzTf6wp1rCrzg,4085704
8
- pennylane_qrack/qrack_device.cpp,sha256=ndCM_If6ITi_9Yvv-nnJrlKqDrz8FARSja1xJKiXZLk,38539
9
- pennylane_qrack/qrack_device.py,sha256=EO-qaf4jE0WWY8hfnewebETxUQEMJsi6bNASmW2mdUY,23670
10
- pennylane_qrack-0.8.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- pennylane_qrack-0.8.2.dist-info/METADATA,sha256=y4X5_c0mob_EkUucDqLkgAE9fc08nSFq3EFrfwmTmJY,5524
12
- pennylane_qrack-0.8.2.dist-info/WHEEL,sha256=GV7PaxwIj77ZI4YqBA69JpFYyJkGQE054wC3BIATXm4,106
13
- pennylane_qrack-0.8.2.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
- pennylane_qrack-0.8.2.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
- pennylane_qrack-0.8.2.dist-info/RECORD,,