Algorithm Library Overview
unitarylab.library provides common algorithms, matrix utilities, and application frameworks on top of the quantum-circuit interface. This section is organized by task; examples use small CPU configurations.
Top-level algorithm entries
The following ten names can be imported directly from unitarylab.library:
from unitarylab.library import (
QFT, IQFT, QPE, LCU,
block_encode, hamiltonian_simulation, solve,
QSVT, QSP, QSP_hamiltonian_simulation,
)These entries cover circuit construction, algorithm execution, and result objects. Other capabilities must be imported from their corresponding submodules; they are not automatically exposed in the top-level namespace.
Choose by task
| Task | Recommended entry | Return form | Documentation |
|---|---|---|---|
| Construct a Fourier-transform circuit | QFT(), IQFT() | Circuit | QFT, QPE, and LCU |
| Estimate an eigenphase of a unitary | QPE() | Circuit or tuple | QFT, QPE, and LCU |
| Construct a linear combination of unitaries | LCU() | Circuit | QFT, QPE, and LCU |
| Simulate | hamiltonian_simulation() | Result object | Hamiltonian Simulation |
| Block encoding and polynomial transforms | block_encode(), QSP(), QSVT() | Circuit, tuple, or result object | QSP, QSVT, and Block Encoding |
| Solve | solve() | LinearSolverResult | Linear System Solvers |
| Decompose and combine Pauli operators | unitarylab.library.pauli_operator | List, matrix, or circuit | Pauli Utilities |
| Construct Fermi–Hubbard Hamiltonians | unitarylab.library.fermi_hubbard | String, dictionary, or result object | Fermi–Hubbard Utilities |
| Solve Ising/QUBO optimization problems | unitarylab.library.qubocore | Dictionary | QUBO and Ising Solvers |
| Solve PDEs | unitarylab.library.equation | Dictionary and generated files | PDE Solver Framework |
| Build and train quantum machine-learning models | unitarylab.library.qml | Tensors, models, and training records | QML Overview and Backends |
Return values and execution cost
- Circuit constructors only create a
Circuit; the caller decides whether to execute it. - High-level algorithms can return result objects whose circuits or numerical results are computed on demand.
- PDE, QUBO, and some QML workflows return dictionaries or tensors; read fields documented for the corresponding interface.
- Qubit count, approximation order, shots, and training epochs affect runtime and memory. Validate calls with a small example before increasing problem size.
Quantum chemistry is provided by a separate extension package; see Chemistry Extension.
Related pages
Last updated on