A Quantum Phase Estimation Toolbox
Project description
qpe-toolbox is an open-source
Python package for compiling and simulating Quantum Phase Estimation (QPE)
circuits, combining quantum chemistry with tensor-network methods.
The code is hosted on github,
and docs are available on GitHub Pages.
See our overview presentation for the motivation and philosophy behind the toolbox.
Built on the tensor-network library quimb, it provides:
- Classical preprocessing: quantum chemistry with PySCF and fermionic encodings via OpenFermion
- Quantum simulation: QPE circuit construction and circuit-level simulator with tensor networks
- Postprocessing: energy retrieval from phase measurement outcomes
Installation
Requirements
Our package is built above numpy/scipy/matplotlib, openfermion, pyscf and quimb as core dependencies. We use jax for variational circuit optimization. jupyterlab and jupytext are needed to run the examples as notebooks. The complete list of dependencies is in pyproject.toml.
Installation from pypi
qpe-toolbox is available on pypi. Install it with
pip install qpe-toolbox
Installation from sources
Installing from sources gives access to our tutorials which contains detailed explanations on the Quantum Phase Estimation algorithm.
with pip
# clone the project
git clone git@github.com:quobly-sw/qpe-toolbox.git && cd qpe-toolbox
# Create a virtual environment
python3 -m venv .venv --prompt qpe-toolbox
# activate it
source .venv/bin/activate
# install the package and its dependencies
pip install -e .[dev]
with uv
# clone the project
git clone git@github.com:quobly-sw/qpe-toolbox.git && cd qpe-toolbox
# Create a virtual environment and synchronize it with lock
uv sync --locked
# activate it
source .venv/bin/activate
Contents
The package is divided in four modules:
circuit: creation and manipulation ofquimbcircuits.hamiltonian: class for defining Hamiltonians and interface withpyscffor chemistry.estimation: perform different flavors of Quantum Phase Estimation.tensor: manipulation of Matrix Product Operators (MPO) and Matrix Product States (MPS).
Examples
We provide a list of notebooks that introduce the basics of the package and contain detailed explanations on the Quantum Phase Estimation algorithm. They are available in the examples directory as plain .py files using the py:percent format. We use Jupytext to convert them and pair them with a twin .ipynb notebook.
To convert a given example and execute it as a notebook, open jupyterlab, right-click on the .py file and select "Open with > Notebook" or "Jupytext Notebook": this allows you to save the notebook's outputs in your local repository. We also include the executed notebooks in our documentation.
-
building_circuitsexplains how to create, plot, record and load quantum circuits inquimbandqiskit. -
chemistry_to_qubitdescribes how to build the qubit Hamiltonian and perform the Density Matrix Renormalization Group (DMRG) algorithm for a given molecule. -
textbook_qpeintroduces the textbook Quantum Phase Estimation algorithm assuming time evolution is implemented exactly. -
trotter_decompositionintroduces the Trotter-Suzuki decomposition to implement a time evolution operator $U$. -
qpe_with_trotterstudies the Quantum Phase Estimation algorithm using Trotterization of the evolution operator, and provides resource estimates. -
qpe_with_lcugives an introduction to Block Encoding via Linear Combination of Unitaries. -
robust_phase_estimationintroduces the Robust Phase Estimation algorithm, based on the Hadamard test circuit. -
performance_mpscompares the performance ofquimbandqiskitwhen contracting and sampling circuits with Matrix Product States. -
hyperoptimizationpresents advanced contraction schemes provided byquimb. -
variational_circuit_preparationfinds an initial guess state with variational circuit optimization.
Basic workflow
To perform Quantum Phase Estimation with the toolbox, take the following steps:
-
The
Hamiltonianclass describes the qubit Hamiltonian. Choose a system:- Spin model with e.g.
heisenberg_hamiltonianor a customHamiltonianinstance. - Molecule with
chemistry_hamiltonian; see thechemistry_to_qubitexample.
- Spin model with e.g.
-
Prepare an initial state as a Matrix Product State. Two methods are available:
- Density Matrix Renormalization Group (DMRG) - see the
chemistry_to_qubittutorial. - Parametrized circuit optimization - see the tutorial on
variational_circuit_preparation.
- Density Matrix Renormalization Group (DMRG) - see the
-
Encode the Hamiltonian into a unitary via either:
- Exact time evolution or Trotterization, available as methods of the
Hamiltonianclass - see the tutorial ontrotter_decomposition. - Block encoding functions from the
estimationmodule - see the tutorial on Linear Combination of Unitaries:qpe_with_lcu.
- Exact time evolution or Trotterization, available as methods of the
-
Initialize a circuit with a physical register and a phase register. From the
circuitmodule, chose between:make_circto create a Tensor Network representation of the circuit.make_circMPSto store the state as an MPS and iteratively apply the gates.
See the tutorials on
building_circuits,performance_mpsandhyperoptimizationfor an introduction on circuit simulation withquimb. -
Run QPE: in the
estimationmodule, choose between- Textbook QPE: see the corresponding tutorial
textbook_qpe. - Robust Phase Estimation, a version of QPE with a single ancilla and circuit repetitions - see the
robust_phase_estimationtutorial.
- Textbook QPE: see the corresponding tutorial
Contributing
Contributions are welcome and highly appreciated. To get started, check out the contributing guidelines.
License
Apache 2.0
Credits
2026 Foxconn, Quobly
Authors:
- Thibaud Louvet (thibaud.louvet@quobly.io)
- Calvin Ku (calvin.ku@foxconn.com)
- Yu-Cheng Chen (kesson.yc.chen@foxconn.com)
- Carlos Ramos Marimón (carlos.marimon@quobly.io)
- Olivier Gauthé (olivier.gauthe@quobly.io)
- Tristan Meunier (tristan.meunier@quobly.io)
- Min-Hsiu Hsieh (min-hsiu.hsieh@foxconn.com)
- Benoit Vermersch (benoit.vermersch@quobly.io)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qpe_toolbox-1.1.0.tar.gz.
File metadata
- Download URL: qpe_toolbox-1.1.0.tar.gz
- Upload date:
- Size: 19.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60b6a5db826cfc36fa2c42a7f52e816e5a093ebc9ea42fef1c404a0489b6caf9
|
|
| MD5 |
15ec9a1035d0002514a08542414dcd47
|
|
| BLAKE2b-256 |
d3317222fb179e0ac22b53b8410052519b250b5ac366c3f3eafa66b4b8748651
|
File details
Details for the file qpe_toolbox-1.1.0-py3-none-any.whl.
File metadata
- Download URL: qpe_toolbox-1.1.0-py3-none-any.whl
- Upload date:
- Size: 63.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
025b44bd31b52dda31787453259823c6be5c4d077556123f10283e630a25494a
|
|
| MD5 |
2079e709ad58cc434ee539b1f42bc2f7
|
|
| BLAKE2b-256 |
9784a026d99228c92e4caebc8c5017c8653157a3a17e9d6ad9f108ce51a8bb60
|