Skip to content

Releases: unitaryfund/qrack

Debug QUnit ALU

02 Apr 20:51
Compare
Choose a tag to compare

QUnit optimizes arithmetic logic operations in a custom way; this optimization failed to map qubits properly under QUnit, leading to out-of-bounds exceptions and operations on qubits that weren't intended. This has been fixed.

Full Changelog: vm6502q.v8.3.0...vm6502q.v8.3.1

File SHA-1 sums:

3e987982d721efc410370fa72f39f8393857db4d Qrack-8.3.1-Darwin_x86-64.sh
85cb40d64fd3ba6bd6f07d1316db86501b1096b5 Qrack-8.3.1-Emscripten.sh
fc4c2dde1dc204287ffb933300ca92597bbc4587 Qrack-8.3.1-Linux_arm64.sh
f5d0f1b40ed9acfd34ff06c43db8e2b583dec1c7 Qrack-8.3.1-Linux_armv7.sh
ade8eb278fb832839c88612ea77ec91f912acd57 Qrack-8.3.1-Ubuntu_20.04_LTS_x86-64.sh
c6013c11fa449f66ecb44b8842cffe3eacbb1c8c Qrack-8.3.1-Ubuntu_22.04_LTS_x86-64.sh
282073a719e9c30209208791c2a63723c65405b0 Qrack-8.3.1-win32.exe
febe4d1be7dd37037e1fcbfe3979248511417ff1 Qrack-8.3.1-win64.exe

4ca6410a4543ab187fc1f95ffe8bc313b3435e1d qrack_linux_arm64_benchmarks
bf26393eab3c027dd6c8042efd2657d532b1c194 qrack_linux_armv7_benchmarks
538772f4845600bd293b23fc983cb8f85ca36cf3 qrack_mac_x86-64_benchmarks
932e6d0a2f91aaa036850bddfafdbefe7ae4c6ab qrack_Ubuntu_20.04_LTS_benchmarks
f59949a23f28f0640d468d1d6cac0741830f72c9 qrack_Ubuntu_22.04_LTS_benchmarks
9c92ab06cdc939c95301d6e63a919f5541a98a15 qrack_windows_x86-64_benchmarks.exe
cce5bde27fa05580543fe82b8455711b16a56523 qrack_windows_x86_benchmarks.exe

High-accuracy fidelity estimation

30 Mar 16:51
Compare
Choose a tag to compare

This release adds GetUnitaryFidelity() and ResetUnitaryFidelity() to the QInterface API.

It was noted by Andrea Mari of Unitary Fund that, from first principles, for a discarded probability "ɛ" in any rounding event, the worst case limit for fidelity loss from "Schmidt decomposition rounding parameter" ("SDRP") methods in QUnit should go like

F = Π (1-ɛ_j) (for j events where ɛ less than SDRP threshold).

Implementing this model, Daniel Strano found it to be very pessimistic, but through trial and error it was noticed that

F = Π (1-ɛ_j / 2)^(1/2) (for j events where ɛ less than SDRP threshold)

was very close to "gold standard" results. Collecting tens of thousands of data points on different circuit widths, depths, and SDRP levels, the second model was found to explain >99% of variance among gold standard results, (without a theoretical argument, for now, explaining why this should be close to or exactly the average case behavior).

More than 99% of variance was explained for random circuits that are basically a "nearest-neighbor quantum volume" variant; other cases might not be as well described. This calculation is done automatically by QUnit, and the result can be accessed through GetUnitaryFidelity(), or the calculation might be reset to identically 1 fidelity by ResetUnitaryFidelity().

Full Changelog: vm6502q.v8.2.2...vm6502q.v8.3.0

File SHA-1 hashes:
3c156a6f078eb48017e6b0b813ccbd5bcf53c8f3 Qrack-8.3.0-Darwin.sh
e3fc2514ad4b70e002774eb1ba185d9514ebf54e Qrack-8.3.0-Emscripten.sh
903971c80979c86a42e5d02f75caf5d43fc97e44 Qrack-8.3.0-Linux_arm64.sh
093f93bd1660b8fd27c4bad08a65e4dbeb8fec0b Qrack-8.3.0-Linux_armv7.sh
07e05abee9079bc70a284263837014c2e6e7bbf4 Qrack-8.3.0-Ubuntu_20.04_LTS_x86-64.sh
1e4c5d1c69cd0af72a27a44d8fa594054a4a2ee3 Qrack-8.3.0-Ubuntu_22.04_LTS_x86-64.sh
609afe84cdf9d3cf9df956ff767e2978883e1432 Qrack-8.3.0-win32.exe
76171d00408976ea8bdbf3768c4c2276e1acfa33 Qrack-8.3.0-win64.exe

3cf35a3889d64aeba37a5b8229298040fe770c8f qrack_linux_arm64_benchmarks
48052fff2d7f9144253b20b8e4191f2861b57b9d qrack_linux_armv7_benchmarks
57d44f761a03c3b9bf9c6f30b422c441a3287194 qrack_mac_x86-64_benchmarks
932e6d0a2f91aaa036850bddfafdbefe7ae4c6ab qrack_Ubuntu_20.04_LTS_benchmarks
23c7715399d857ba53341a421d79ff6e405e8953 qrack_Ubuntu_22.04_LTS_benchmarks
7a567d63d5c8f4f1a0c38a95c03badea196de10b qrack_windows_x86-64_benchmarks.exe
c2cdbbb264bb671f2b93bb415714e9497449e1ff qrack_windows_x86_benchmarks.exe

SIMD improvements

19 Mar 13:31
Compare
Choose a tag to compare

Use of SIMD has been optimized, giving CPU-based simulation a modest performance increase when SIMD instructions are available.

Additionally, it was noticed that QEngine simulation under QBdt is still bugged. Hence, it is turned off by default, but it's possible to experiment with the feature by setting the QRACK_QBDT_THRESHOLD_QB environment variable to a nonzero value.

What's Changed

Full Changelog: vm6502q.v8.2.1...vm6502q.v8.2.2

File SHA-1:
2012928e2aafa607e186425db66f2884ac148192 Qrack-8.2.2-Darwin.sh
6ed9910943ef5cb926786ef32b2af630c070f387 Qrack-8.2.2-Emscripten.sh
b9927d61dde957f5d87e060f6ade63d11c1275fd Qrack-8.2.2-Linux_arm64.sh
bee42af5775a527c1e1ab7396b6d8817c8cd6e38 Qrack-8.2.2-Linux_armv7.sh
9dc214e518e138882875ccdc39ab9c9622e069d2 Qrack-8.2.2-Ubuntu_20.04_LTS_x86-64.sh
8c45340ea5147a1628dd6ada85c86e334441b951 Qrack-8.2.2-Ubuntu_22.04_LTS_x86-64.sh
04a311cd0b208890d93377c816d17b16ecf94f72 Qrack-8.2.2-win32.exe
f7c6e2cd819628053f70331d51fa1ef97335af6c Qrack-8.2.2-win64.exe
932e6d0a2f91aaa036850bddfafdbefe7ae4c6ab qrack_Ubuntu_20.04_LTS_benchmarks
132feccba0d464638dd9b62587b0bdff272bee41 qrack_Ubuntu_22.04_LTS_benchmarks
7fe91648440fe298d7e906e85f86aeab5be023f0 qrack_mac_x86-64_benchmarks
fcba2f989fa079cc2a91db8edd1df531c7dc0a76 qrack_linux_armv7_benchmarks
d736d58e144e3632440602f3505f82e7aa472771 qrack_linux_arm64_benchmarks
b09ff14b07da6c83166ee5765c1b2406d558134d qrack_windows_x86_benchmarks.exe
0900c67d81a729ec91cece0df374b2091bcf1069 qrack_windows_x86-64_benchmarks.exe
15439feb93cb5663e57ca33a056930f3e23d0b80 qrack_ios_any.zip
12869f7a8db8199837aa8956ab4a380e31653f1f qrack_android_any.zip

Add missing header to installers

09 Mar 18:54
Compare
Choose a tag to compare

A header was missing in the installers; this has been fixed.

Full Changelog: vm6502q.v8.2.0...vm6502q.v8.2.1

File SHA-1 hashes:
b202c79695547aa5ee1d52320daf8148035401ec Qrack-8.2.1-Darwin.sh
9cc200cff4196d656f3a5df19aee20ac95ee5b37 Qrack-8.2.1-Emscripten.sh
ae9c9e41ef443fcefaa6ed849fadd8e93212d37f Qrack-8.2.1-Linux_arm64.sh
7e670381d79757d869e16c14ccd3b3b202990d20 Qrack-8.2.1-Linux_armv7.sh
b8784e06b967738e30b96042e4e2487fe5625988 Qrack-8.2.1-Ubuntu_20.04_LTS_x86-64.sh
e78f2448c8d536c9008838af57297b482e3bdf75 Qrack-8.2.1-Ubuntu_22.04_LTS_x86-64.sh
1d51d5a1df11e6e2cad28703ed385bf126ec6e8e Qrack-8.2.1-win32.exe
d42b6de3954b4a79d1aa8a7d8814f58fe086ad26 Qrack-8.2.1-win64.exe
812a7f2ab4d3aeb8c2d268e98792e35b11b2b7ec qrack_linux_arm64_benchmarks
69631799e547da3272c1d554cdb09551090ed050 qrack_linux_armv7_benchmarks
2f0f85a5c0529f764829947898100cee126d117f qrack_mac_x86-64_benchmarks
932e6d0a2f91aaa036850bddfafdbefe7ae4c6ab qrack_Ubuntu_20.04_LTS_benchmarks
efe9786092e8c00b183069fff8c1c01729fb070b qrack_Ubuntu_22.04_LTS_benchmarks
61ec2e95a70a781d7f7e186a726dcd010896ae39 qrack_windows_x86-64_benchmarks.exe
efd8696e736a51a77811140bff2c561e1da17e32 qrack_windows_x86_benchmarks.exe

PermutationProb() in shared library

23 Feb 14:53
Compare
Choose a tag to compare

In deciding to remove in_ket() and out_ket() from the Rust "Qook" wrapper for Qrack, it became apparent that mirror circuit fidelity testing could still greatly benefit, in terms of reduced simulation overhead, from a method capable of returning single permutation basis eigenstate probabilities.

This release adds support for PermutationProb() in the shared library API, to allow single permutation basis eigenstate probability checks, (as well as probability checks of permutations of arbitrary qubit lists).

File SHA1 hashes:
83c7059a1d8e64bda249176f54124c579a25cd4b Qrack-8.2.0-Darwin.sh
161a67fd0c27c7259f4d0037317052d371c18c5d Qrack-8.2.0-Linux_arm64.sh
3393b34bac32769c52cb7e287db31556a0b58e88 Qrack-8.2.0-Linux_armv7.sh
5edc20d814ebe6a9c61a8ddd57bffa5e09972350 Qrack-8.2.0-Ubuntu_20.04_LTS_x86-64.sh
29a4d587db43405f87e7bd9e36e1e710c0825a79 Qrack-8.2.0-Ubuntu_22.04_LTS_x86-64.sh
64d8e17452105bb43fe5b0ce92e5624271356502 Qrack-8.2.0-win32.exe
016c9cebfecfbf5ba636a45b64f0ab9d7271a109 Qrack-8.2.0-win64.exe

6a3843f84b8ade09b019a880957a0545f0c69c3a qrack_linux_arm64_benchmarks
4531c53c0efc9135fda99826373dd7f12bd5bf97 qrack_linux_armv7_benchmarks
dff111ad2b2a2395316cf4f7b1114473e793b47c qrack_Ubuntu_20.04_LTS_benchmarks
efe9786092e8c00b183069fff8c1c01729fb070b qrack_Ubuntu_22.04_LTS_benchmarks
54f4a4267dc12a0c097aa6fc3c44910627e856b4 qrack_mac_x86-64_benchmarks
e08de9c1894b68635fac3914714c37df83a8c6de qrack_windows_x86_benchmarks.exe
9dcc59b2b2f8b2fb790a207b76321706a852e4af qrack_windows_x86-64_benchmarks.exe

First official standalone binary distribution

21 Feb 19:05
Compare
Choose a tag to compare

Many incremental changes have been made (and ignored by semantic versioning) in Qrack since v8.0, but the purpose of this v8.1.0 release is to make the first official standalone binary distribution available (via this release page) and update the DOI.

File SHA1 hashes:
75dcfa22cf75e6225983ae803a3a1bb9f310ac91 Qrack-8.1.0-Darwin_x86-64.sh
df19ac5a61bf42f129548a5ea5c1147e960513ef Qrack-8.1.0-Linux_arm64.sh
da586b050d63644d8ed4162e94ddd2cd1427774b Qrack-8.1.0-Linux_armv7.sh
1c695250733fbf046f66c254a836efca9cdce22a Qrack-8.1.0-Ubuntu_20.04_LTS_x86-64.sh
24b7eb4c922e5bedc48ec55967c17eb090d92bfc Qrack-8.1.0-Ubuntu_22.04_LTS_x86-64.sh
2b9ee3ca2ed67264aeae36ee8da3389925a734b5 Qrack-8.1.0-win32.exe
85e2698117a310d60e21c1ae15e1dd35633a2c60 Qrack-8.1.0-win64.exe

Full Changelog: vm6502q.v8.0.0...vm6502q.v8.1.0

Qrack v8: public parameter safety

13 Oct 14:55
ca5ee8c
Compare
Choose a tag to compare

Qrack v8 makes two major changes to the API:

  • Qubit index parameters are checked for validity against simulators' allocated qubit bounds, to prevent OpenCL segmentation fault errors from explicitly invalid arguments.
  • The public API parameter pattern "pointer, pointerLength" has been replaced with with std::vector.

After 5 years of holding out for the more C-like version of the interface, there's very little to be said in favor of "pointer, pointerLength" over std::vector, which effectively enforces bounds safety. To use a contiguous subset of a std::vector from user code space, one can still use the appropriate iterator-based std::vector constructor. This probably requires the system to create a copy of the subset, but at most this is likely fewer than 50 elements copied, typically more like 1 or 2 elements. The benefits of bounds-enforcement have been assessed to be far more important than the additional execution time overhead, if that overhead can even be detected.

If you need support in converting your user code to API v8, please don't hesitate to reach out with a GitHub issue on this repository!

QUnit bug fix, for (v7.1)

29 Jun 18:43
Compare
Choose a tag to compare

I was excited yesterday to tag an extremely stable point for accuracy and precision across the full "layer stack" of Qrack, but excitement with Qrack's stability lead to more exhaustive testing, which indicated one more bug intrinsic to QUnit. The point of v7.1.1 is only to create a tag as a reference point for this even more stable version, after a couple of critical commits were added to main branch.

QUnit uses a system of constrained 2 qubit gate buffers to try to attain better Schmidt decomposition. These buffers only allow phase and "inversion" (Pauli X-like or Y-like) singly-controlled gate target "payloads." We are able in cases to commute Hadamard gates through the controlled gate buffers, when symmetry permits an exact logical equivalence after simple transformation of the gate buffers, to move the Hadamard gate to the first-to-be-applied side of the circuit. Specifically, besides cases of Hadamard gates applied on buffer control qubits, Hadamard gates can be moved to the opposite side of the gate buffer target qubits when applied to a target qubit with exactly equal or exactly opposite phases on phase or inversion gate components pairs. Starting from singly-controlled phase and inversion gates, same phase produces a new singly-controlled phase gate, and opposite phase produces a new singly-controlled inversion gate. However, while all phase gates generally commute, the buffering of controlled inversion gates requires an explicit order of application of buffers. Since the buffer system is designed to assume general commutation of buffers, with limited exception to handle one-off inversion gate "fusion" and control qubit commutation, we can't generally commute Hadamard gates around opposite-phase buffers without accounting for the order in which inversion buffers will be applied.

The bottom line is that the previous implementation of this buffer system optimistically assumed that arbitrary commutation of opposite-phase buffers would preserve exact observable state, but this seems proven wrong. The fix in this version, v7.1.1, opts to omit opposite-phase target qubit commutation with Hadamard gates entirely, since this passes hundreds of thousands of random mirror circuit assertions in contiguous sequence with ~0 bit-flip errors, (or less than about 1 per hundred thousand assertions, on my development machine). More aggressive optimization can be done, (and probably will be soon,) but I'm trying to tag the most accurate and precise version of Qrack I can attain, particularly for QUnit layer. (We're aiming for a "100% bug-free" tag of QUnit in v7.1.x, if this isn't a Sisyphean goal in software development in general.)

Generally stable QUnit layer interoperation

28 Jun 22:56
Compare
Choose a tag to compare

Work done last year debugged QUnit and Qrack in general against mirror circuits, (also known basically as the "Loschmidt echo"). Over a month was spent achieving the most accurate (and "bug-free") version of QUnit up to the time, including bugs patched to improve accuracy in other simulation layers. Nagging edge cases remained, but the causes couldn't be readily identified.

Recent developer attention was pointed to QStabilizerHybrid to implement reverse t-injection gadgets. Consideration of non-Clifford measurement over stabilizer simulation with non-Clifford one qubit buffers revealed a few bugs, which were patched. To ("semi-casual") testing by the lead developer, QUnit layered over QStabilizerHybrid might have zero mirror circuit logical bit flip edge cases to within about at least 10 or 20 thousand randomized circuit result assertions. No bit flip errors have been detected at all so far, in fact, for more than that number of assertions in repeated executions of test_mirror_circuit.

(Reasonably, this a transitional point in the development cycle of very high accuracy, to tag.)

(EDIT: Bit flip errors have already been detected since, depending upon parameters and layers, but at a very noticeably lower frequency, maybe 1 in 10 to 20 thousand assertions for default optimal stack, nonetheless.)

v7 API update

01 Jan 05:01
Compare
Choose a tag to compare

Major release v7.0.0 takes lessons learned from the PyQrack API and basically inducts them back into the underlying C++11 library. The public API now follows a general "POCO" principle, letting primitive parameters be simply primitives, while all array pointers that are treated as const are explicitly const. Large but infrequently used method groups of the API can be switched on or off for inclusion in builds with the CMake options ENABLE_ALU, ENABLE_REG_GATES, ENABLE_ROT_API, and (pre-existing) ENABLE_BCD, where ENABLE_ALU for the "arithmetic logic unit" methods is the only option of these left on by default.

Primary generic gate method names have been shortened, to Mtrx for general 2x2 matrix gates, Phase for general 2-component phase gates, and Invert for general 2-component "inversion" (or "Pauli-X-like") gates. Controlled variants are MCMtrx, MCPhase, and MCInvert, (for "multiply-controlled,") and "anti-controlled" variants are MACMtrx, MACPhase, and MACInvert, (which activate the gate "payload" if all control qubits are reset off, as opposed to set on).

This overhaul of the API in itself makes for signficantly smaller binaries and appreciable speed increases, potentially due to better cache utilization, though, of course, many other small, targeted optimizations of specific methods add to this overall performance improvement, like overhauled measurement distribution sampling with MultiShotMeasureMask.

(Happy 2022! You rock!)