mqt.core.bench.grover

Grover benchmark instances and options.

Module Contents

class Options(*, marked_bitstring: str, iterations: int | None = None)

Parameters for a Grover benchmark.

property marked_bitstring: str

The big-endian marked outcome.

property iterations: int | None

The iteration count, or None for automatic selection.

class Grover(options: Options)

A validated single-solution Grover benchmark.

property options: Options

The resolved benchmark parameters.

property output: Output

The logical output register.

property qubits: int

The number of search qubits.

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>') → Grover

Parse a strict benchmark instance specification.

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

Parse a strict benchmark manifest.