uniqc.noise_bridge.exchange module¶
Consumer side of the versioned noise-model exchange (nlearn.noise-model.v1).
This module imports the offline noise-model exchange files produced by the
noise-learning product (schema nlearn.noise-model.v1, consumer binding
uniqc.noisy_simulator.v1) and wires them into UniQC’s frozen noisy
simulation stack — uniqc.simulator.NoisySimulator (density-operator
backend) and uniqc.backend_adapter.task.adapters.dummy_adapter.DummyAdapter.
The exchange is data-only: UniQC never imports the private nlearn
package; everything needed to rebuild the channels is inside the JSON file
(Pauli probabilities, readout pairs, topology, layout) and integrity is
guarded by the file’s canonical model_sha256. Model files declare
new_hardware_run: false — importing one performs no new hardware run.
Capabilities exposed on top of the imported model:
load_noise_model()— validate + parse an exchange file.ImportedNoiseModel.to_simulator()— a density-operatorNoisySimulatorwith the learned per-gate-instance Pauli channels and per-qubit readout error.ImportedNoiseModel.to_adapter()— aDummyAdapterwired the same way, so the unifiedsubmit_task-style flows keep working.ImportedNoiseModel.simulate_counts()— run a circuit and return noisy shot counts including the model’s post-measurement edge-flip mixture.
- exception uniqc.noise_bridge.exchange.ExchangeModelError[source]¶
Bases:
ValueErrorRaised when a noise-model exchange file fails validation.
- class uniqc.noise_bridge.exchange.ImportedNoiseModel(payload, path)[source]¶
Bases:
objectA validated
nlearn.noise-model.v1file wired for UniQC execution.Local qubit
iof the model maps to physical qubitphysical_chain[i]; error channels, topology, and readout rates are addressed in local indices so the simulator can run on a compact register.- apply_edge_flips(outcome, rng)[source]¶
Apply the post-measurement XOR mixture to one outcome integer.
- property data_class¶
- property generator¶
- property local_edges¶
- property model_sha256¶
- property num_qubits¶
- path¶
- payload¶
- property physical_chain¶
- simulate_counts(circuit, *, shots, seed, qram_data=None)[source]¶
Execute circuit on the learned noisy VM and sample shot counts.
- Parameters:
circuit –
Circuitobject or OriginIR string. Gates must live on local qubits0..n-1; useRPhi/CZto exercise the learned channels (RZ is virtual and noiseless per the model).shots – Number of shots.
seed – Seed for shot sampling and the edge-flip mixture.
qram_data – Optional
{qram_name: {address: value}}preloaded into the simulator’s QRAM objects before execution.
- Returns:
Counts keyed by bitstring with local qubit
i= charactern-1-i(c[i]rightmost, the UniQC endianness convention).