open-standards/wai/quantum-conformance/formats/qasm/teleport.qasm
Transaction Science 5fe6f317c1 quantum-conformance: other formats, natively and under wasm32-wasip2
wai/quantum-conformance/formats/ holds a module for each construct, each
with the program it must read to (a reference held by the equivalence
ladder), the outcomes it gives, a round trip back to its format, the
formats it writes to, and every refusal with its code and its place: the
QIR specification's two example programs, every intrinsic, a QIR 1 module
with typed pointers, the profiles' refusals; jeff modules built field by
field from the schema; the jeff project's own structured benchmarks and
examples, unchanged; and OpenQASM sources written to each format, the QIR
written pinned by its BLAKE3. CI runs it in wai-quantum-formats.yml, with
the readers' and writers' unit tests.

The jeff reader now converts integers to floats and floats to integers,
and a QIR conversion is checked against the type it gives.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 07:16:32 -04:00

20 lines
384 B
Text

// Teleportation of |1>, corrected on what was measured: written to QIR under
// the adaptive profile, every shot reads 1 on c[2]. jeff writes no branch.
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
bit[3] c;
x q[0];
h q[1];
cx q[1], q[2];
cx q[0], q[1];
h q[0];
c[0] = measure q[0];
c[1] = measure q[1];
if (c[1]) {
x q[2];
}
if (c[0] == 1) {
z q[2];
}
c[2] = measure q[2];