pennylane-qrack 0.20.2__py3-none-manylinux_2_39_x86_64.whl → 0.21.0__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.
- pennylane_qrack/_version.py +1 -1
- pennylane_qrack/libqrack_device.so +0 -0
- pennylane_qrack/qrack_ace_device.py +10 -7
- pennylane_qrack/qrack_device.cpp +4 -22
- pennylane_qrack/qrack_device.py +4 -3
- {pennylane_qrack-0.20.2.dist-info → pennylane_qrack-0.21.0.dist-info}/METADATA +1 -1
- pennylane_qrack-0.21.0.dist-info/RECORD +17 -0
- pennylane_qrack-0.20.2.dist-info/RECORD +0 -17
- {pennylane_qrack-0.20.2.dist-info → pennylane_qrack-0.21.0.dist-info}/WHEEL +0 -0
- {pennylane_qrack-0.20.2.dist-info → pennylane_qrack-0.21.0.dist-info}/entry_points.txt +0 -0
- {pennylane_qrack-0.20.2.dist-info → pennylane_qrack-0.21.0.dist-info}/licenses/LICENSE +0 -0
- {pennylane_qrack-0.20.2.dist-info → pennylane_qrack-0.21.0.dist-info}/top_level.txt +0 -0
pennylane_qrack/_version.py
CHANGED
|
Binary file
|
|
@@ -134,11 +134,11 @@ class QrackAceDevice(QubitDevice):
|
|
|
134
134
|
# Noise parameter. (Default is "0"; depolarizing noise intensity can also be controlled by "QRACK_GATE_DEPOLARIZATION" environment variable)
|
|
135
135
|
noise = 0
|
|
136
136
|
# How many full simulation columns, between border columns
|
|
137
|
-
long_range_columns=4
|
|
137
|
+
long_range_columns = 4
|
|
138
138
|
# How many full simulation rows, between border rows
|
|
139
|
-
long_range_rows=4
|
|
139
|
+
long_range_rows = 4
|
|
140
140
|
# Whether to transpose rows and columns
|
|
141
|
-
is_transpose=False
|
|
141
|
+
is_transpose = False
|
|
142
142
|
|
|
143
143
|
def __init__(self, wires=0, shots=None, **kwargs):
|
|
144
144
|
options = dict(kwargs)
|
|
@@ -376,7 +376,9 @@ class QrackAceDevice(QubitDevice):
|
|
|
376
376
|
raise DeviceError(f"Operation {opname} is not supported on a {self.short_name} device.")
|
|
377
377
|
|
|
378
378
|
def analytic_probability(self, wires=None):
|
|
379
|
-
raise DeviceError(
|
|
379
|
+
raise DeviceError(
|
|
380
|
+
f"analytic_probability is not supported on a {self.short_name} device. (Specify a finite number of shots, instead.)"
|
|
381
|
+
)
|
|
380
382
|
|
|
381
383
|
def expval(self, observable, **kwargs):
|
|
382
384
|
if self.shots is None:
|
|
@@ -431,10 +433,11 @@ class QrackAceDevice(QubitDevice):
|
|
|
431
433
|
|
|
432
434
|
return self._samples
|
|
433
435
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
+
# QubitDevice.states_to_binary() doesn't work for >64qb. (Fix by Elara, the custom OpenAI GPT)
|
|
437
|
+
samples = self._state.measure_shots(list(range(self.num_wires - 1, -1, -1)), self.shots)
|
|
438
|
+
self._samples = np.array(
|
|
439
|
+
[list(format(b, f"0{self.num_wires}b")) for b in samples], dtype=np.int8
|
|
436
440
|
)
|
|
437
|
-
self._samples = QubitDevice.states_to_binary(samples, self.num_wires)
|
|
438
441
|
|
|
439
442
|
return self._samples
|
|
440
443
|
|
pennylane_qrack/qrack_device.cpp
CHANGED
|
@@ -483,8 +483,6 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
483
483
|
}
|
|
484
484
|
return ids;
|
|
485
485
|
}
|
|
486
|
-
[[nodiscard]] auto Zero() const -> Result override { return const_cast<Result>(&QRACK_RESULT_FALSE_CONST); }
|
|
487
|
-
[[nodiscard]] auto One() const -> Result override { return const_cast<Result>(&QRACK_RESULT_TRUE_CONST); }
|
|
488
486
|
auto Observable(ObsId id, const std::vector<std::complex<double>> &matrix,
|
|
489
487
|
const std::vector<QubitIdType> &wires) -> ObsIdType override
|
|
490
488
|
{
|
|
@@ -576,21 +574,6 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
576
574
|
[[nodiscard]] auto GetDeviceShots() const -> size_t override { return shots; }
|
|
577
575
|
void StartTapeRecording() override { tapeRecording = true; }
|
|
578
576
|
void StopTapeRecording() override { tapeRecording = false; }
|
|
579
|
-
void PrintState() override
|
|
580
|
-
{
|
|
581
|
-
const size_t numQubits = qsim->GetQubitCount();
|
|
582
|
-
const size_t maxQPower = (size_t)((uint64_t)qsim->GetMaxQPower());
|
|
583
|
-
const size_t maxLcv = maxQPower - 1U;
|
|
584
|
-
size_t idx = 0U;
|
|
585
|
-
std::cout << "*** State-Vector of Size " << maxQPower << " ***" << std::endl;
|
|
586
|
-
std::cout << "[";
|
|
587
|
-
std::unique_ptr<Qrack::complex> sv(new Qrack::complex[maxQPower]);
|
|
588
|
-
qsim->GetQuantumState(sv.get());
|
|
589
|
-
for (; idx < maxLcv; ++idx) {
|
|
590
|
-
std::cout << sv.get()[idx] << ", ";
|
|
591
|
-
}
|
|
592
|
-
std::cout << sv.get()[idx] << "]" << std::endl;
|
|
593
|
-
}
|
|
594
577
|
void NamedOperation(const std::string &name, const std::vector<double> ¶ms,
|
|
595
578
|
const std::vector<QubitIdType> &wires, bool inverse,
|
|
596
579
|
const std::vector<QubitIdType> &controlled_wires,
|
|
@@ -735,7 +718,7 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
735
718
|
}
|
|
736
719
|
}
|
|
737
720
|
}
|
|
738
|
-
void Sample(DataView<double, 2> &samples
|
|
721
|
+
void Sample(DataView<double, 2> &samples) override
|
|
739
722
|
{
|
|
740
723
|
RT_FAIL_IF(samples.size() != shots * qsim->GetQubitCount(), "Invalid size for the pre-allocated samples");
|
|
741
724
|
|
|
@@ -764,7 +747,7 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
764
747
|
const std::map<bitCapInt, int> q_samples = qsim->MultiShotMeasureMask(qPowers, shots);
|
|
765
748
|
_SampleBody(qPowers.size(), q_samples, samples);
|
|
766
749
|
}
|
|
767
|
-
void PartialSample(DataView<double, 2> &samples, const std::vector<QubitIdType> &wires
|
|
750
|
+
void PartialSample(DataView<double, 2> &samples, const std::vector<QubitIdType> &wires) override
|
|
768
751
|
{
|
|
769
752
|
RT_FAIL_IF(samples.size() != shots * wires.size(), "Invalid size for the pre-allocated samples");
|
|
770
753
|
|
|
@@ -809,8 +792,7 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
809
792
|
}
|
|
810
793
|
}
|
|
811
794
|
}
|
|
812
|
-
void Counts(DataView<double, 1> &eigvals, DataView<int64_t, 1> &counts
|
|
813
|
-
size_t shots) override
|
|
795
|
+
void Counts(DataView<double, 1> &eigvals, DataView<int64_t, 1> &counts) override
|
|
814
796
|
{
|
|
815
797
|
const size_t numQubits = qsim->GetQubitCount();
|
|
816
798
|
const size_t numElements = 1U << numQubits;
|
|
@@ -844,7 +826,7 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
|
|
|
844
826
|
}
|
|
845
827
|
|
|
846
828
|
void PartialCounts(DataView<double, 1> &eigvals, DataView<int64_t, 1> &counts,
|
|
847
|
-
const std::vector<QubitIdType> &wires
|
|
829
|
+
const std::vector<QubitIdType> &wires) override
|
|
848
830
|
{
|
|
849
831
|
const size_t numQubits = wires.size();
|
|
850
832
|
const size_t numElements = 1U << numQubits;
|
pennylane_qrack/qrack_device.py
CHANGED
|
@@ -718,10 +718,11 @@ class QrackDevice(QubitDevice):
|
|
|
718
718
|
|
|
719
719
|
return self._samples
|
|
720
720
|
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
# QubitDevice.states_to_binary() doesn't work for >64qb. (Fix by Elara, the custom OpenAI GPT)
|
|
722
|
+
samples = self._state.measure_shots(list(range(self.num_wires - 1, -1, -1)), self.shots)
|
|
723
|
+
self._samples = np.array(
|
|
724
|
+
[list(format(b, f"0{self.num_wires}b")) for b in samples], dtype=np.int8
|
|
723
725
|
)
|
|
724
|
-
self._samples = QubitDevice.states_to_binary(samples, self.num_wires)
|
|
725
726
|
|
|
726
727
|
return self._samples
|
|
727
728
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
pennylane_qrack/CMakeCache.txt,sha256=3v-xGxs5bLtfkdPBdAMG0jFuElEhuklvh6fwcSSRFY0,15177
|
|
2
|
+
pennylane_qrack/Makefile,sha256=Od_33AWv8Jgk8ZWvL7lklT2Awce38c1lIgMyys5-RuE,7584
|
|
3
|
+
pennylane_qrack/QrackAceDeviceConfig.toml,sha256=KmPPJEa6TMYpbQqQgMSAPfeGPQE8f1lriteyfGW8WeA,4517
|
|
4
|
+
pennylane_qrack/QrackDeviceConfig.toml,sha256=oR9-dIAP6BzP3e2QSLroacaloHZsx7iJiKE6w7LGxUo,5459
|
|
5
|
+
pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
|
|
6
|
+
pennylane_qrack/_version.py,sha256=FpKob9aBwOu01ij4m97Jn4wOeVBp-NTVBEtrXf24IYg,689
|
|
7
|
+
pennylane_qrack/cmake_install.cmake,sha256=jP3YWPs_F3JYlifubQTLq95RWHkadWyv_BNvMw3MzhU,3521
|
|
8
|
+
pennylane_qrack/libqrack_device.so,sha256=Www0mu9uCJaMyMysacxzwVu0aZRkPTza1PWGxQA1Xs4,5647720
|
|
9
|
+
pennylane_qrack/qrack_ace_device.py,sha256=XXm3_FSTZGzMyhafX0UnSEda9EVtC2x_Mm9nZxTMqJc,17089
|
|
10
|
+
pennylane_qrack/qrack_device.cpp,sha256=FFP1GLdgqOho9irwdaAF1Lo1T9KIsaVKMiiIglkrOmE,37194
|
|
11
|
+
pennylane_qrack/qrack_device.py,sha256=LkfoH_KHm8VcUNT6Xzo3NZE24iGUMcLz8f1Nk8Jp6Sk,28358
|
|
12
|
+
pennylane_qrack-0.21.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
+
pennylane_qrack-0.21.0.dist-info/METADATA,sha256=KQf0e0qnt83Q8xtytVZmD1D5rGnDwjhEkfREix6uZyk,6075
|
|
14
|
+
pennylane_qrack-0.21.0.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
|
|
15
|
+
pennylane_qrack-0.21.0.dist-info/entry_points.txt,sha256=OrkJ6JVk-yndlQjqc-8dm8PxE-jNoNQRFXFeUBxVuCg,139
|
|
16
|
+
pennylane_qrack-0.21.0.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
17
|
+
pennylane_qrack-0.21.0.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
pennylane_qrack/CMakeCache.txt,sha256=3v-xGxs5bLtfkdPBdAMG0jFuElEhuklvh6fwcSSRFY0,15177
|
|
2
|
-
pennylane_qrack/Makefile,sha256=Od_33AWv8Jgk8ZWvL7lklT2Awce38c1lIgMyys5-RuE,7584
|
|
3
|
-
pennylane_qrack/QrackAceDeviceConfig.toml,sha256=KmPPJEa6TMYpbQqQgMSAPfeGPQE8f1lriteyfGW8WeA,4517
|
|
4
|
-
pennylane_qrack/QrackDeviceConfig.toml,sha256=oR9-dIAP6BzP3e2QSLroacaloHZsx7iJiKE6w7LGxUo,5459
|
|
5
|
-
pennylane_qrack/__init__.py,sha256=_g4NKu07_pXqxvQaxjdAPe769S5tWwYjqyHi3z7YKHc,673
|
|
6
|
-
pennylane_qrack/_version.py,sha256=vMZQKNgr8Kyje0V3QA1HS3Mzl1JdVPl2aV2losVODZU,689
|
|
7
|
-
pennylane_qrack/cmake_install.cmake,sha256=jP3YWPs_F3JYlifubQTLq95RWHkadWyv_BNvMw3MzhU,3521
|
|
8
|
-
pennylane_qrack/libqrack_device.so,sha256=kr9hC9xAiEIFfT0CSxk1991zbhA4UiGwW-kmYNxTeKs,5642304
|
|
9
|
-
pennylane_qrack/qrack_ace_device.py,sha256=KFrUxJ4osPiq6w1n44ZO8_0AgQa7Y9XPC7NLhlzIiog,16939
|
|
10
|
-
pennylane_qrack/qrack_device.cpp,sha256=0Dbey1g3DQeWYrzS9622Y7QDhizISuII49XLuv9xFIY,38115
|
|
11
|
-
pennylane_qrack/qrack_device.py,sha256=kefy76z8z9EQ6Z4gkNUxZXzOXNaQKUBetKPUO2RGsig,28236
|
|
12
|
-
pennylane_qrack-0.20.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
-
pennylane_qrack-0.20.2.dist-info/METADATA,sha256=VjjV-uQNjboLEld-JjstXwfBtJBbCcFmPopVtHma-4Q,6075
|
|
14
|
-
pennylane_qrack-0.20.2.dist-info/WHEEL,sha256=k8EuOMBHdXsN9XSTE5LrpwS4FtdLkoSlyO_7W-lE_zg,109
|
|
15
|
-
pennylane_qrack-0.20.2.dist-info/entry_points.txt,sha256=OrkJ6JVk-yndlQjqc-8dm8PxE-jNoNQRFXFeUBxVuCg,139
|
|
16
|
-
pennylane_qrack-0.20.2.dist-info/top_level.txt,sha256=5NFMNHqCHtVLwNkLg66xz846uUJAlnOJ5VGa6ulW1ow,16
|
|
17
|
-
pennylane_qrack-0.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|