tequilahub/tequila
A High-Level Abstraction Framework for Quantum Algorithms
Tequila – A Python framework for variational quantum algorithms
What it is
- An open‑source Python library that lets you build, differentiate, and optimise quantum circuits for tasks such as the Variational Quantum Eigensolver (VQE) and other hybrid quantum‑classical algorithms.
- It abstracts away the low‑level details of quantum back‑ends (simulators or real hardware) and provides a unified API for defining variables, gates, Hamiltonians, and expectation‑value objectives.
Key capabilities
- Abstract data structures – circuits, Hamiltonians, and optimisation objectives are represented independently of the execution backend.
- Automatic differentiation – gradients of expectation values can be obtained automatically, enabling gradient‑based optimisers like BFGS.
- Backend agnostic – works with many simulators/hardware providers (Qulacs, Qibo, Qiskit, Cirq, PyQuil, Atos QLM) and will pick the best one that is installed.
- Quantum chemistry integration – modules to translate molecular structures (via Psi4, PySCF, or the Madness library) into qubit Hamiltonians and generate chemistry‑specific ansätze (UCC, UpCCGSD, SPA, etc.).
- Research‑grade features – supports custom ansätze, interval‑guaranteed measurements, explicit‑correlation corrections, and other techniques described in a long list of associated papers.
Typical workflow (Hello‑World)
- Define a symbolic variable
a. - Build a circuit, e.g. a single‑qubit rotation
Ry. - Specify a Hamiltonian (here a Pauli‑X operator).
- Create an
ExpectationValueobject linking the circuit and Hamiltonian. - Call
tq.minimizewith an optimiser (e.g. BFGS) to find the variable values that minimise the energy. - Inspect the resulting wavefunction and optimisation history.
Chemistry example
- Load a molecule from a geometry string or an
.xyzfile. - Generate a qubit Hamiltonian via a chosen fermion‑to‑qubit mapping.
- Choose a chemistry‑specific ansatz (e.g. SPA, UpCCGSD).
- Optimise the energy with VQE and optionally compare to classical reference methods (CISD, FCI) using PySCF or Psi4.
Installation
- Recommended:
pip install tequila-basic(core library). - Add a fast simulator like Qulacs (
pip install qulacs). - For chemistry, install optional back‑ends (Psi4, PySCF, Madness) via conda or pip as described.
Documentation & learning resources
- Tutorials and API docs are hosted at https://tequilahub.github.io/tequila-tutorials/.
- A collection of research papers and example notebooks demonstrates advanced uses (basis‑set‑free VQE, meta‑VQE, robustness intervals, etc.).
Who might use it
- Quantum‑computing researchers developing new variational algorithms or chemistry applications.
- Students and developers who want a high‑level, backend‑agnostic way to prototype quantum circuits with automatic differentiation.
- Anyone needing a bridge between classical quantum‑chemistry packages and quantum‑hardware execution.
Community
- Open source on GitHub; contributions are welcomed via pull requests.
- Issues can be filed directly on the repository, and the maintainers provide contact details for direct help.
All information above is taken directly from the project's README; no additional features have been inferred.
Related
- Project
- Project