Skip to main content
NM-RFC-0010 · Experimental

Build a concrete circuit from a typed oracle

Choose compile-time parameters, inspect the compiler-produced oracle artifact and identity hash, then open the same monomorphized source in Playground.

Generic oracle compiler lab

This lab invokes the NM-RFC-0010 compiler with explicit negotiation. It does not create runtime-sized registers or dynamic oracle values.

Experimental

Type safety is the goal; this is not a scalability claim. DJ/BV are ready through N=99 on eligible stabilizer circuits. Grover is ready only for N=2..5 with the exact grover_primitives package.

Turnkey ready range
N=1..99
Local backend
Stabilizer
Concrete qubits
4
Verification tier
structural
Expanded gates
6

Oracle inspector

Canonical GF(2) algebraic normal form produced by Tier A verification.

fnv1a32:084e0afc
f[0] = x[0] ⊕ x[2]
Inspect monomorphized source
module generic_gallery_bv_3;
@target("browser-stabilizer");

xor_oracle selected_secret(x: QReg<3>, out: QReg<1>) {
  CNOT(x[0], out[0]);
  CNOT(x[2], out[0]);
}

fn main() {
  let x: QReg<3> = qreg[3];
  let out: QReg<1> = qreg[1];
  bernstein_vazirani<3>(x, out, oracle: selected_secret);
}
Open with generic oracles enabled

Visual Oracle / Constraint Builder

Select a bounded Boolean function, compile one or more affine output bits into a named typed oracle, and inspect the compiler's discrete verification artifact before opening the exact source in Playground.

Experimental 0.1

This builder supports canonical affine vector functions XorOracle<N,M> for N,M=1..8 and one-state PhaseOracle<N> equality for N=2..5. It does not synthesize arbitrary truth tables or matrices, allocate ancilla, or create runtime-sized registers.

Portable workbench context

Move strict local artifacts between N/M tools without registering a runtime backend or trusting URL contents.

Resource budget

None applied
None applied

Planning profile

None applied
None applied

Profiles remain static compatibility evidence. Calibration references are provenance only; neither can select hardware, scheduling, or noise behavior.

Each output bit has an independent canonical affine expression; input and output registers remain disjoint.

Affine output components

Select the output component to edit. The compiler emits X/CNOT gates targeting only that output bit.

Selected parity variables for f[0]

Each selected variable maps directly to one CNOT; no heuristic synthesis is used.

Closed grammar: 0, 1, and x[index] terms joined by xor. Repeated terms cancel in GF(2).

Editable truth table for f[0]

Edit any output row, then apply the table. An exact GF(2) transform accepts it only when the resulting canonical ANF has degree at most one.

xf[0]
000
001
010
011
100
101
110
111
Concrete oracle type
XorOracle<3,1>
Boolean predicate
f(x) = x[0] xor x[2]
Verification tier
structural
Constraint artifact
nmconstraint-3-084e0afc

Compiler verification evidence

Normative verification method
Tier A canonical ANF gate-shape proof
Numeric tolerance
Exact structural proof; no floating-point tolerance
Unitarity
Verified
Diagonality
Not applicable for this oracle kind
Ancilla restoration
No ancilla is declared; the restoration condition is satisfied vacuously
Source hash
a0833277c6a41758
Artifact integrity
e77c967367830930

Compiled resources and backends

Allocated qubits
4
Expanded gates
2
Expanded depth
2
Statevector
Eligible
Stabilizer
Eligible

Algorithm preconditions

Deutsch–Jozsa
Balanced promise
Bernstein–Vazirani
Eligible
Grover
Type mismatch

Adapter boundary stays closed

Contract 0.2 defines only a future one-way XorOracle<N,1> to PhaseOracle<N> adapter. Multi-output XOR and reverse phase-to-XOR conversion are outside that adapter domain; the valid single-output path still requires a static name, explicit MinusAncilla<1>, restoration proof, and Tier B verification.

XorOracle<N,1> -> PhaseOracle<N> · NM-RFC-0010 section 23.5

Compiler-verified discrete artifact

Canonical affine GF(2) normal form.

fnv1a32:084e0afc
f[0] = x[0] xor x[2]

Exact affine vector truth table

All 8 rows and every output bit are derived from the canonical affine expressions; this is not heuristic synthesis.

xf(x)
0000
0011
0100
0111
1001
1010
1101
1110
Inspect generated named-oracle source
module visual_affine_xor_3_1;
@target("browser-stabilizer");

xor_oracle visual_constraint(x: QReg<3>, out: QReg<1>) {
  CNOT(x[0], out[0]);
  CNOT(x[2], out[0]);
}

algorithm apply_visual<const N: Int, const M: Int>(
  x: QReg<N>,
  out: QReg<M>,
  oracle f: XorOracle<N, M>
) {
  f(x, out);
}

fn main() {
  let x: QReg<3> = qreg[3];
  let out: QReg<1> = qreg[1];
  apply_visual<3, 1>(x, out, oracle: visual_constraint);
}

This generic oracle source is transferred to Experiment Studio for review only. Saving it to a workspace does not add Studio execution support. Use the Playground link to run the source.

RFC roadmap for this surface

These cards expose planned programs. A proposed RFC is not an executable capability or implementation approval.

NM-RFC-0034ProposedImplementation locked

Static XOR-to-phase oracle adapters

Proposed activation
experimental.oracleAdapters=true