ampamp is a research library for building quantum amplification circuits,
inspecting their mathematical behavior, profiling compilation cost, and
validating ideal/noisy backend behavior from one compact API.
Docs · PyPI · Survey paper · Source
Authors
Mithilesh Kumar · Varun Daiya · Yusuf Tahir
Amplitude amplification is the shared engine behind Grover search, amplitude estimation, fixed-point schedules, oblivious amplification, variable-time algorithms, and QSVT-style workflows. In papers these often appear as separate constructions. In experiments and software, the recurring need is simpler:
- describe the search, oracle, block encoding, branch model, or polynomial;
- build an inspectable circuit or classical schedule;
- profile the circuit under a hardware model;
- validate the behavior under ideal or noisy simulation;
- keep the whole workflow reproducible.
ampamp is built for that practical loop.
Requires Python >=3.9.
python3 -m pip install ampampfrom ampamp import GroverEngine, TranspilationProfiler, TranspilationProfileConfig
engine = GroverEngine(n_qubits=6, marked_indices=[10, 25])
qc = engine.construct_circuit(iterations=engine.k_optimal)
metrics = TranspilationProfiler(
TranspilationProfileConfig(
coupling_map_edges=[[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]],
)
).profile_circuit(qc)
print(engine.k_optimal)
print(metrics["post_optimization_depth"])
print(metrics["final_cnots"])| Area | What it gives you | Main entry points |
|---|---|---|
| Grover search | Phase oracles, diffusion operators, optimal-iteration estimates, success probabilities, full circuits | GroverEngine |
| Oracle construction | Marked-state, Boolean-formula, bit-flip, phase, and direct unitary oracle circuits | OracleBuilder, build_phase_oracle, build_bit_flip_oracle, build_unitary_oracle |
| Fixed-point AA | Chebyshev-style phase schedules and monotone amplification circuits | FixedPointEngine |
| Oblivious / FOQA | Ancilla preparation, block-encoding scaffolds, reflections, damping schedules, recurrence simulation | ObliviousEngine, FOQAEngine |
| Distributed AA | Prefix/suffix target partitioning and local symbolic oracle synthesis | DQAAEngine, OracleSynthesizer |
| Variable-time AA | Branch models, stopping-time moments, success mass, asymptotic estimates | VTAAEngine, VariableTimeBranch |
| QSVT / QSP | SU(2) QSP sequence evaluation and Chebyshev polynomial helpers | SU2QSPEngine, QSVTSynthesizer |
| Diagnostics | Executable checks for rotations, schedules, partitions, branches, and polynomial parity | GroverAuditor, FPAAAuditor, QSVTAuditor, ... |
| Transpilation | Staged compile metrics, routing counts, timing models, batch profiling, hardware-cost scores | TranspilationProfiler, TranspilationBatchProfiler |
| Backend validation | Ideal/noisy simulator comparisons, total-variation distance, noise presets, JSONL logs | BackendValidationRunner |
| Entanglement count | Light and hard active-entangled-qubit profiling for Qiskit circuits | profile_entanglement_counts |
Use marked indices, Boolean formulas, or direct unitary matrices.
import numpy as np
from ampamp import (
OracleBuilder,
build_bit_flip_oracle,
build_phase_oracle,
build_unitary_oracle,
)
phase_from_indices = build_phase_oracle(
num_qubits=4,
marked_indices=[3, 11],
)
phase_from_formula = build_phase_oracle(
num_qubits=4,
formula_text="v0 & (~v1 | v3)",
)
bit_flip_from_formula = build_bit_flip_oracle(
num_qubits=4,
formula_text="v0 & v2",
)
builder_oracle = OracleBuilder.from_formula(
num_qubits=4,
formula_text="v0 & (v2 | v3)",
).phase_oracle()
unitary_matrix = np.diag([1, 1, -1, 1])
matrix_oracle = build_unitary_oracle(unitary_matrix)For distributed symbolic work, OracleSynthesizer substitutes fixed node
prefixes into a global Boolean formula and emits node-local phase oracles.
from ampamp import FixedPointEngine
fp = FixedPointEngine(L=5, delta=0.1)
qc = fp.build_fixed_point_circuit(num_qubits=4, marked_indices=[3, 11])
print(fp.alphas)
print(fp.betas)
print(qc.depth())from ampamp import VTAAEngine, VariableTimeBranch
branches = [
VariableTimeBranch(stop_time=1.0, weight=0.4, success_given_branch=0.8),
VariableTimeBranch(stop_time=3.0, weight=0.6, success_given_branch=0.5),
]
vtaa = VTAAEngine(branches)
print(vtaa.p_success)
print(vtaa.stopping_time_moments())
print(vtaa.vtaa_asymptotic_bound())from ampamp import GroverEngine
from ampamp import (
BackendValidationRunner,
BackendValidationConfig,
ValidationNoiseConfig,
ValidationLogConfig,
)
qc = GroverEngine(n_qubits=4, marked_indices=[3, 11]).construct_circuit(
iterations=1,
)
runner = BackendValidationRunner(
BackendValidationConfig(
shots=1024,
seed=42,
noise=ValidationNoiseConfig(noise_level="light"),
logging=ValidationLogConfig(enabled=True, log_dir="./validation_logs"),
)
)
result = runner.validate_circuit("grover_demo", qc)
print(result["status"], result["metrics"]["tvd"])from ampamp import EntanglementCountConfig, GroverEngine, profile_entanglement_counts
qc = GroverEngine(n_qubits=5, marked_indices=[0]).construct_circuit(
iterations=1,
)
light = profile_entanglement_counts(
qc,
EntanglementCountConfig.light(max_qubits=12),
)
print(light["peak_active_entangled_qubits"])from ampamp import (
GroverEngine,
FixedPointEngine,
ObliviousEngine,
FOQAEngine,
DQAAEngine,
OracleBuilder,
OracleSpec,
OracleSynthesizer,
build_phase_oracle,
build_bit_flip_oracle,
build_unitary_oracle,
marked_bitstrings_from_formula,
EntanglementCountConfig,
profile_entanglement_counts,
VTAAEngine,
VariableTimeBranch,
SU2QSPEngine,
QSVTSynthesizer,
IQAEEngine,
IQAEConfig,
IQAEResult,
GroverAuditor,
FPAAAuditor,
ObliviousAuditor,
FOQAAuditor,
DistributedAuditor,
VTAAAuditor,
FundamentalLimitsAuditor,
QSVTAuditor,
HardwareCostWeights,
TranspilationProfiler,
TranspilationBatchProfiler,
TranspilationProfileConfig,
BackendValidationRunner,
BackendValidationConfig,
ValidationNoiseConfig,
ValidationLogConfig,
)| Resource | Link |
|---|---|
| Documentation site | https://quantumamplification.github.io/ampamp/ |
| PyPI package | https://pypi.org/project/ampamp/ |
| Source repository | https://github.com/QuantumAmplification/ampamp |
| Implementation comparison workflows | https://github.com/QuantumAmplification/Implementation |
| License | MIT License |
Serve the docs locally:
mkdocs serveBuild the docs:
mkdocs build --strictampamp is a software layer over a long amplitude-amplification paper trail:
Grover search, polynomial lower bounds, amplitude estimation, arbitrary-phase
amplification, fixed-point search, controlled amplification, oblivious
amplification, LCU/block encodings, variable-time algorithms, Hamiltonian
simulation, QSP, and QSVT.
The companion survey for the project is:
M. Kumar, Y. Tahir, and V. Daiya,
"Amplitude Amplification Algorithms",
Zenodo, 2026.
https://doi.org/10.5281/zenodo.20054981
The SciPost manuscript in this repository contains the fuller bibliography, including Grover, Bennett-Bernstein-Brassard-Vazirani, Beals-Buhrman-Cleve- Mosca-de Wolf, Brassard-Hoyer-Mosca-Tapp, Yoder-Low-Chuang, Low-Chuang, Ambainis, Harrow-Hassidim-Lloyd, Gilyen-Su-Low-Wiebe, Martyn-Rossi-Tan-Chuang, and the distributed/FOQA papers used by the package.
src/ampamp/ installable library source
docs/ MkDocs documentation and API pages
tests/ unit tests and regression checks
dist/ local release artifacts, when built
fd.tex SciPost manuscript draft
main.tex alternate SciPost manuscript draft
CITATION.cff citation metadata
LICENSE MIT license text
Scenario scripts and implementation-comparison workflows live outside the package repository:
https://github.com/QuantumAmplification/Implementation
Install locally:
python3 -m pip install -e .Run the test suite:
PYTHONPATH=src pytestFocused checks:
PYTHONPATH=src pytest tests/test_oracles.py
PYTHONPATH=src pytest tests/test_transpilation_module.py tests/test_transpilation_validation.pyBuild a release artifact locally:
python3 -m build
python3 -m twine check dist/*For papers, notebooks, and benchmark runs, record:
ampampversion;- Python version;
- Qiskit and Qiskit Aer versions;
- backend or simulator settings;
- transpilation basis gates, coupling map, and optimization levels;
- random seeds and shot counts;
- validation noise preset or custom noise parameters.
Some simulator-heavy workflows can be environment-sensitive. If Matplotlib cache
warnings appear, set a writable MPLCONFIGDIR.
ampamp is distributed under the MIT License. See LICENSE for the
full license text.
Until an archival software DOI is attached to a release, cite the repository and the companion survey:
@software{Kumar2026QuantumAmplificationLibrary,
author = {Kumar, Mithilesh and Daiya, Varun and Tahir, Yusuf},
title = {Quantum Amplification Library},
year = {2026},
month = apr,
url = {https://github.com/QuantumAmplification/ampamp}
}
@misc{Kumar2026AmplitudeAmplification,
author = {Kumar, Mithilesh and Tahir, Yusuf and Daiya, Varun},
title = {Amplitude Amplification Algorithms},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.20054981},
url = {https://doi.org/10.5281/zenodo.20054981}
}