uniqc.benchmark.throughput module¶
Local compile/execute throughput benchmark for the NISQ framework.
Measures how many quantum circuits per hour the local UniQC pipeline can compile and execute at a fixed shots-per-circuit budget (the acceptance configuration is 1000 shots per circuit on average, >= 30,000 circuits per hour).
Timed pipeline (the “compile/execute” boundary), per circuit:
Compile —
Circuit-> OriginIR text ->Simulator.simulate_preprocess(parse, opcode conversion, qubit/topology constraint validation).Execute — exact statevector simulation (
simulate_pmeasure) plus multinomial sampling of the configured number of shots from the outcome distribution.
Explicitly outside the timed window: interpreter/process startup, result
persistence (the SQLite task store), report serialisation and file I/O. The
backend_id selects the local simulator fixture; the measurement never
submits cloud tasks.
All circuit inputs are generated deterministically from one seed, so a reported number is tied to a reproducible input set.
- class uniqc.benchmark.throughput.ThroughputResult(circuits, n_qubits, depth, shots, seed, backend_id, generator_mode, compile_seconds, execute_seconds, total_seconds, circuits_per_hour, compile_circuits_per_hour, execute_circuits_per_hour, environment)[source]¶
Bases:
objectMeasured local compile/execute throughput over a seeded input set.
- backend_id¶
- circuits¶
- circuits_per_hour¶
- compile_circuits_per_hour¶
- compile_seconds¶
- depth¶
- environment¶
- execute_circuits_per_hour¶
- execute_seconds¶
- generator_mode¶
- property meets_30000_per_hour¶
- n_qubits¶
- seed¶
- shots¶
- total_seconds¶
- uniqc.benchmark.throughput.build_random_nisq_circuit(n_qubits, depth, seed, *, entangler_edges=None)[source]¶
Build one seeded random NISQ circuit (rotations + pairwise entanglers).
Layer structure: each qubit receives one random rotation gate with a random angle, then entanglers pair the qubits — either over a random permutation (all-to-all, the default) or over a random matching drawn from
entangler_edges(for topology-constrained line/grid fixtures). This is a representative variational-algorithm workload: no known structure, and full-width measurement.
- uniqc.benchmark.throughput.run_throughput_benchmark(*, circuits, n_qubits, depth, shots=1000, seed=0, backend_id='dummy:local:simulator', simulator_factory=None, progress=None)[source]¶
Time the local compile/execute pipeline over a seeded circuit set.
- Parameters:
circuits – Number of circuits in the input set.
n_qubits – Qubits per circuit.
depth – Entangling-layer depth per circuit.
shots – Shots sampled per circuit (default 1000, the acceptance configuration).
seed – Base seed; circuit i uses
seed + i.backend_id – Recorded backend identity (execution itself runs on the local simulator stack). Topology-constrained fixtures (
dummy:local:virtual-line-N/virtual-grid-RxC) switch the generator to nearest-neighbour entanglers automatically.simulator_factory – Override simulator construction (tests use this to inject fakes). Defaults to
uniqc.Simulatorwith the backend’s resolved qubit/topology constraints.progress – Optional callback invoked with the completed circuit count.
- Returns:
A
ThroughputResultwith the measured wall-clock times and derived circuits-per-hour rates.