mqt.bench.benchmarks.draper_qft_adder¶
Draper QFT Adder.
Module Contents¶
- create_circuit(num_qubits: int, kind: str = 'fixed') QuantumCircuit[source]¶
Build a Draper adder using the quantum Fourier transform.
- Parameters:
num_qubits – Total width. A half adder requires an odd width of at least 3. A fixed-width adder requires an even width of at least 2.
kind –
"half"includes carry-out."fixed"retains only the low bits that fit in one operand.
- Returns:
A circuit that measures only the sum into
result, least-significant bit first. For half addition, the highest result bit is the carry-out.