pennylane-qrack 0.8.1__py3-none-manylinux_2_39_x86_64.whl → 0.8.4__py3-none-manylinux_2_39_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.1"
19
+ __version__ = "0.8.4"
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,98 +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
-
429
- // Handle if integer
430
- pos = kwargs.find(",");
431
- bool isInt = true;
432
- for (size_t i = 0; i < pos; ++i) {
433
- if ((kwargs[i] != ' ') && !isdigit(kwargs[i])) {
434
- isInt = false;
435
- break;
436
- }
437
- }
438
- if (isInt) {
439
- mapped_qubits = stoi(trim(kwargs.substr(0, pos)));
440
- for (size_t i = 0U; i < mapped_qubits; ++i) {
441
- qubit_map[i] = i;
442
- }
443
- kwargs.erase(0, pos + 1U);
444
-
445
- continue;
446
- }
447
-
448
- // Handles if Wires object
449
- pos = kwargs.find("]>");
450
- std::string value = kwargs.substr(0, pos);
451
- kwargs.erase(0, pos + 3U);
452
- size_t p = value.find("[");
453
- value.erase(0, p + 1U);
454
- size_t q;
455
- while ((q = value.find(",")) != std::string::npos) {
456
- qubit_map[(QubitIdType)stoi(trim(value.substr(0, q)))] = mapped_qubits;
457
- ++mapped_qubits;
458
- value.erase(0, q + 1U);
459
- }
460
- qubit_map[stoi(trim(value))] = mapped_qubits;
461
- ++mapped_qubits;
462
-
463
- continue;
464
- }
465
-
466
415
  pos = kwargs.find(",");
467
416
  std::string value = trim(kwargs.substr(0, pos));
468
417
  kwargs.erase(0, pos + 1U);
469
418
  const bool val = (value == "True");
470
419
  switch (keyMap[key]) {
471
- case 2:
472
- if (value != "None") {
473
- shots = std::stoi(value);
474
- }
475
- break;
476
- case 3:
420
+ case 1:
477
421
  sh = val;
478
422
  break;
479
- case 4:
423
+ case 2:
480
424
  tn = val;
481
425
  break;
482
- case 5:
426
+ case 3:
483
427
  sd = val;
484
428
  break;
485
- case 6:
429
+ case 4:
486
430
  md = val;
487
431
  break;
488
- case 7:
432
+ case 5:
489
433
  bdt = val;
490
434
  break;
491
- case 8:
435
+ case 6:
492
436
  oc = val;
493
437
  break;
494
- case 9:
438
+ case 7:
495
439
  hp = val;
496
440
  break;
497
- case 10:
441
+ case 8:
498
442
  nw = val;
499
443
  break;
500
444
  default:
@@ -511,16 +455,8 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
511
455
  QrackDevice &operator=(QuantumDevice &&) = delete;
512
456
 
513
457
  auto AllocateQubit() -> QubitIdType override {
514
- if (allocated_qubits >= qubit_map.size()) {
515
- throw std::runtime_error("Catalyst has requested more qubits than exist in device, with "
516
- + std::to_string(allocated_qubits) + " allocated qubits. "
517
- + "(Set your wires count high enough, for the device.)");
518
- }
458
+ const QubitIdType label = qsim->GetQubitCount();
519
459
  qsim->Allocate(1U);
520
- auto it = qubit_map.begin();
521
- std::advance(it, allocated_qubits);
522
- const QubitIdType label = it->first;
523
- ++allocated_qubits;
524
460
  return label;
525
461
  }
526
462
  auto AllocateQubits(size_t num_qubits) -> std::vector<QubitIdType> override {
@@ -590,13 +526,11 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
590
526
  qsim->M(id);
591
527
  // Deallocate
592
528
  qsim->Dispose(id, 1U);
593
- --allocated_qubits;
594
529
  }
595
530
  void ReleaseAllQubits() override
596
531
  {
597
532
  // State vector is left empty
598
533
  qsim = QSIM_CONFIG(0U);
599
- allocated_qubits = 0;
600
534
  }
601
535
  [[nodiscard]] auto GetNumQubits() const -> size_t override
602
536
  {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pennylane-qrack
3
- Version: 0.8.1
3
+ Version: 0.8.4
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=KvhAdv1Blm2aZIxh4ABxZAyOazo3Nd1_Nia0C2Iom-A,15001
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=jyaEB4FUXRPnz3u24tnL27KBC1xDY14gR_Y9g3EasW8,691
6
+ pennylane_qrack/cmake_install.cmake,sha256=kW9d9vjuxI8PW08r6P09h7d6vmG74xsRzq1AuqYchh8,3336
7
+ pennylane_qrack/libqrack_device.so,sha256=mGPKA6l7WKnmi6QwWqM827V6Sg_csIkSF1ZBcu0td0k,5894664
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.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ pennylane_qrack-0.8.4.dist-info/METADATA,sha256=LuD_biZMeM2UV1MGizaFj8V_tvfqqkb9jbNegZz4bk0,5524
12
+ pennylane_qrack-0.8.4.dist-info/WHEEL,sha256=tdP73m6v2dYsbEtv0XWMXbvoG74I2r0wTGnywX7R0MU,109
13
+ pennylane_qrack-0.8.4.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
+ pennylane_qrack-0.8.4.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
+ pennylane_qrack-0.8.4.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- pennylane_qrack/CMakeCache.txt,sha256=KvhAdv1Blm2aZIxh4ABxZAyOazo3Nd1_Nia0C2Iom-A,15001
2
- pennylane_qrack/Makefile,sha256=S9Y76wF2BB8oc3vDHA8v5RY-cuUM9L1AYRtC0Uu8r60,7584
3
- pennylane_qrack/QrackDeviceConfig.toml,sha256=fAJzw1da3tBCiKtsem3AeHN4q80E0Qsd-Ms4B9j6aQE,6226
4
- pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
5
- pennylane_qrack/_version.py,sha256=NJxAK0HAzrdg_b3RWrNxt9xoISF2TdvWUq6rI1jqIZk,691
6
- pennylane_qrack/cmake_install.cmake,sha256=kW9d9vjuxI8PW08r6P09h7d6vmG74xsRzq1AuqYchh8,3336
7
- pennylane_qrack/libqrack_device.so,sha256=0-uoCcbGQ9MifiYR5-jhYv-ysYPDYWmAyU7Xd3-aUho,5851280
8
- pennylane_qrack/qrack_device.cpp,sha256=hW0VCdzlJ3Ucpyr1BWoYiRlwAm_cXTE-ZAbB4CzxR8s,38415
9
- pennylane_qrack/qrack_device.py,sha256=EO-qaf4jE0WWY8hfnewebETxUQEMJsi6bNASmW2mdUY,23670
10
- pennylane_qrack-0.8.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
- pennylane_qrack-0.8.1.dist-info/METADATA,sha256=bekoNi7euJ8aFq_o-YF5Gg5aBIJKco14PvGMVsqbeOU,5524
12
- pennylane_qrack-0.8.1.dist-info/WHEEL,sha256=tdP73m6v2dYsbEtv0XWMXbvoG74I2r0wTGnywX7R0MU,109
13
- pennylane_qrack-0.8.1.dist-info/entry_points.txt,sha256=V6f1sN6IZZZaEvxrI47A3K_kksp8fDUWjLWD0Met7Ww,79
14
- pennylane_qrack-0.8.1.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
15
- pennylane_qrack-0.8.1.dist-info/RECORD,,