(Experimental) Quantum Hardware Compilation Support
The new features of this release are purely at the experimental stage and have not been integrated into a full pipeline, but it is theoretically possible to use the Clifford+RZ improvements of v8.12 to compile for hardware.
In v8.13, it is now possible to output QStabilizerHybrid
state to file, (not while using QUnit
). The files have the following format, by line:
[Logical qubit count]
[Stabilizer qubit count, including ancillae]
[Stabilizer x/z/r generators, one row per line, "tableau" format, repeated for logical qubit count of rows x2]
[Per-qubit MPS buffers, 2x2 complex matrices, row-major order, one matrix per line, repeated for stabilizer qubit count of rows]
For example:
3
3
1 1 0 0 1 0 2
0 1 0 1 0 0 0
0 0 0 0 0 1 0
0 0 0 1 0 1 2
0 0 0 1 1 0 0
1 1 1 0 1 0 0
(1,0) (0,0) (0,0) (1,0)
(1,0) (0,0) (0,0) (1,0)
(0,0) (0.707107,-0.707107) (0,1) (0,0)
is a valid file, with 0 ancillae. It is theoretically relatively easy to prepare this result of unitary circuit simulation on a quantum hardware device: first prepare the stabilizer state, (with purely Clifford gates,) then apply the (potentially non-Clifford) 2x2 matrices over the same sequential qubit index order. This can represent a universal quantum state of the logical qubits.
QInterface
now has a method void SetStabilizerHardwareEncoded(bool)
. The default value of this setting is false
, which causes ancilla "magic state" qubit "channels" to be encoded depending on post-selection. If this setting is false
, hardware decoding depends on the ancilla qubits all measuring as |0>, for the correct overall state preparation. However, if this setting is true
, then every other ancilla qubit (starting with the second-occurring ancilla) is an "open channel" that starts out coding an identity gate, (or "no operation,") but can be re-encoded to avoid the post-selection requirement. To do so, after preparing the state as described in the file, perform H
gate on all auxiliary, identity-encoding ancilla channels, act CZ
from each "coding" ancilla to its "identity" partner, then act H
again on the auxiliary, identity-encoding ancilla. Now, terminal measurement can occur without post-selection, and all logical qubits are deterministically in the intended state, in the ideal.
(EDIT: Dan was mistaken about CZ
on the extra ancilla channels "completely" fixing the post-selection errors; rather, per additional ancillary channel, it should reduce the failure rate by 50%, compounded.)
File SHA-1 sums:
c26152394cfdf5921a71303bbdea94f85f64b2f9 Qrack-8.13.0-Darwin_x86-64.sh
4ec2f1eb0068b6ddfdf5ca021d8017ab3bcd3762 Qrack-8.13.0-Emscripten.sh
add15fc39a41b7047271a00622ec4424e7b074cc Qrack-8.13.0-Linux_arm64.sh
cefd758d42eaa1bd620a0ac676c774fdc51a425e Qrack-8.13.0-Linux_armv7.sh
96b7ab1308522c115fda282b9f9c4a9d650e3a11 Qrack-8.13.0-Linux_Ubuntu_20.04_LTS_x86-64.sh
3bdf5d69eb49777b15b708814893de765e954678 Qrack-8.13.0-Linux_Ubuntu_22.04_LTS_x86-64.sh
dbecccb935bbe4be2310fc385fd08b97a51438aa Qrack-8.13.0-win32.exe
bc077c0fd1316b937ea19162efafe11ff348e891 Qrack-8.13.0-win64.exe
6632674f1fa19399610b5fca887bb8cdf64caf1e Qrack-8.13.0-WSL_Ubuntu_22.04_LTS_RTX_3080.sh
1a4523a42a6274d5cd4b3305b4e2bf2b1664c2cb qrack_linux_arm64_benchmarks
21c1a54572198ec0137c43be17329b8775a2ee64 qrack_linux_armv7_benchmarks
f7011b474318d81c6fda5c1f288a3502a092455d qrack_mac_x86-64_benchmarks
4aa289f07f246529dae6a4954f8e28cd928ce887 qrack_Ubuntu_20.04_LTS_benchmarks
d7c09fec8311d76bd8efe693303bf37da44aec95 qrack_Ubuntu_22.04_LTS_benchmarks
0a460db2e63ac4dcfeb0303913d19f1a7e65e334 qrack_windows_x86-64_benchmarks.exe
c2c9938678e237c27eec0f230fc5c5b17b8514e0 qrack_windows_x86_benchmarks.exe
9f0aa488c6a510939e065872983915f8a8068003 qrack_WSL_Ubuntu_22.04_LTS_benchmarks