mqt.core.bench.shor¶
Shor benchmark instances and options.
Module Contents¶
- class Evaluation¶
Verified factors recovered from measured phases.
- class Shor(options: Options)¶
A validated Shor order-finding benchmark.
The circuit uses a semiclassical inverse QFT and reuses one query qubit across its phase measurements. Modular-arithmetic registers remain allocated.
- evaluate(counts: Mapping[str, int]) Evaluation¶
Recover factors using exact continued fractions and verify them by division.
- class FactorStatus¶
Bases:
enum.EnumOutcome of a factoring workflow.
- SUCCESS = 0¶
- PRIME = 1¶
- ATTEMPTS_EXHAUSTED = 2¶
- class FactorResult¶
Result of a bounded factoring workflow.
- property status: FactorStatus¶
- factor(number: int, run: Callable[[Shor], Mapping[str, int]], *, max_attempts: int = 16, seed: int = 0) FactorResult¶
Find one nontrivial factor pair with a bounded number of attempted bases.
The callback accepts a
Shorinstance and returns counts. It owns device selection, shots, and execution seeds. Even numbers, primes, and perfect powers are handled classically. Callback failures and invalid counts propagate.