mqt.core.bench.qft_adder¶
QFT adder benchmark instances and options.
Module Contents¶
- class Options(*, addend: str, accumulator: str, method: Method = Method.REGISTER, overflow: Overflow = Overflow.WRAP)¶
Parameters for a QFT adder.
- class QFTAdder(options: Options)¶
A validated QFT adder benchmark.
Register addition uses controlled phases and returns the addend followed by the sum. Constant addition compiles the addend into phases and returns only the sum. Wrap mode computes \((a + b) \bmod 2^n\); carry mode retains one extra sum bit. All strings are big-endian, and leading zeros determine the operand width.
Register addends may contain
+for independent \(|+\rangle\) qubits. The accumulator and constant addends must be binary. The circuit follows Draper’s register addition and its constant-input Fourier specialization.- evaluate(counts: Mapping[str, int]) Evaluation¶
Compare sampled counts with the ideal distribution.