uniqc.noise_bridge.qram_cases module

Noisy-VM functional cases: 3-layer QRAM, QPU addressing, and mitigation.

These cases exercise QRAM lookup, quantum addressing and mitigation using an imported noise-model exchange file (uniqc.noise_bridge.exchange) — or on the plain noiseless simulator as an ideal reference:

  • QRAM lookup (3 layers) — a basis-state address register queries a QRAMDECL memory with 3 address bits (8 entries); the returned value is sampled through the noisy VM (gate channels + readout + edge flips).

  • QPU addressing — the address register is prepared in a superposition (an entangling RPhi/CZ fanout makes the query exercise the learned 2-qubit channels); the data-register distribution reflects the quantum-addressed memory contents.

  • Readout mitigation — the noisy counts are mitigated through the frozen uniqc.qem.ReadoutEM unified interface, calibrated on the same noisy VM adapter.

All inputs are fixed (no randomness beyond seeded shot sampling), so a case run is reproducible. This is a local simulation capability — it is not a real-hardware QRAM validation, and it never submits cloud tasks.

uniqc.noise_bridge.qram_cases.build_qpu_addressing_circuit()[source]

QPU-addressed query: entangled superposition over the address register.

uniqc.noise_bridge.qram_cases.build_qram_lookup_circuit(address)[source]

Basis-state QRAM lookup: prepare |address> via RPhi(pi,0) and query.

uniqc.noise_bridge.qram_cases.distribution_fidelity(counts, ideal)[source]

Classical fidelity <sqrt(p q)> between sampled counts and ideal probs.

uniqc.noise_bridge.qram_cases.ideal_data_distribution(circuit)[source]

Ideal distribution over data-register values for a QRAM case circuit.

uniqc.noise_bridge.qram_cases.run_qpu_addressing_case(model, *, shots=1000, seed=0, workdir=None)[source]

Run the QPU-superposition-addressing case on a noisy VM.

The data-register distribution of the entangled-address query is compared against the ideal (noiseless) distribution, before and after readout EM.

uniqc.noise_bridge.qram_cases.run_qram_lookup_case(model, *, address, shots=1000, seed=0, workdir=None)[source]

Run the 3-layer QRAM basis-lookup case on a noisy VM.

Returns a JSON-able report: expected value, noisy top outcome, mitigated top outcome, raw/mitigated accuracy and fidelity, and evidence metadata.