mqt.core.bench.fan_out

Quantum fan-out benchmark instances and options.

Module Contents

class Options(*, controls: int)

Parameters for a quantum fan-out benchmark.

property controls: int

The number of control qubits, \(n\in[1, 1073]\).

class FanOut(options: Options)

A validated quantum fan-out benchmark.

The benchmark prepares uniform controls and a target in \(|+\rangle\). Fan-out distributes controlled phase gates \(P(\pi/2)\) across the target and clean ancillas, then uncomputes the ancillas. A final Hadamard on the target makes the phase observable.

For \(n\) controls, the circuit uses \(2n\) qubits. The logical output contains the controls followed by the target as its least-significant bit. For a control string of Hamming weight \(w\), the target is zero with conditional probability \(\cos^2(\pi w/4)\).

property options: Options

The resolved benchmark parameters.

property output: Output

The logical output register.

probability(outcome: str) → float

Return the ideal probability of an outcome.

evaluate(counts: Mapping[str, int]) → Evaluation

Compare sampled counts with the ideal distribution.

generate() → QCProgram

Generate the benchmark as a QC program.

property instance_specification_json: str

The canonical instance specification JSON.

property manifest_json: str

The canonical manifest JSON.

property case_id: str

The stable semantic case ID.

static from_instance_specification_json(json: str, *, source: str = '<instance-specification>') → FanOut

Parse a strict benchmark instance specification.

static from_manifest_json(json: str, *, source: str = '<manifest>') → FanOut

Parse a strict benchmark manifest.