wai-quantum 0.6.4: Pauli frames, the GPU state vector, the density matrix to 16 qubits, an OpenQASM writer that keeps every gate; the service for agents and browsers #320
ctrl @, ctrl(n) @, negctrl @ and negctrl(n) @ on x y z h s sdg t tdg p and on
cx cy cz ch cp ccx ccz. A gate the standard names is read as that gate, so a
Clifford program keeps the stabilizer method. A phase on m qubits is written
from x1...xm = 2^(1-m) sum over nonempty S of (-1)^(|S|+1) parity(S): each
subset's parity gathered on its highest qubit by cx in Gray-code order and
turned by p(+-theta/2^(m-1)), 2^m - 1 of each, exact with no global phase.
x, y and h become a phase by a change of basis on the target. Checked on a
6-qubit state against the 2x2 gate applied directly where the controls hold,
every amplitude within 1e-12; the test fails when the expansion's signs or its
releases are broken. Grover as the IDE exports it finds its item on the exact
and statevector methods.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A gate with three or more controls (Grover's oracle and diffusion past three
qubits) was written as a comment, so the exported program was not the
circuit. to_qasm now writes ctrl(n) @ g for every controlled gate without a
standard name (ch included), and from_qasm reads ctrl, ctrl(n), negctrl and
negctrl(n). Gates exact here only up to a global phase (rz, rx, ry, sx, u) are
refused under a modifier, since a control makes that phase observable.
Checked: each base gate under zero to five controls reads back op for op;
Grover on five and seven qubits keeps its state.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A browser's JSON.parse and JSON.stringify turn 1.0 into 1, so a receipt over
serde_json's own text could not be checked from JavaScript (the console, or
any JS agent). The digest now covers the canonical text of the request and
the result: keys sorted by UTF-16 code units, no whitespace, every number as
ECMAScript's Number::toString writes the double, ties between equally near
shortest digits going to the even one, as the standard asks. The receipt
names the form ("canon": "rfc8785"); receipts issued before it still
verify. serde_json reads numbers correctly rounded (float_roundtrip), and a
request whose whole numbers a double cannot hold is refused. Checked against
a JavaScript engine: RFC 8785's appendix B and 3,385 vectors in the tests,
and 2 million random doubles in an opt-in test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>