Molecules
The molecules subpackage provides a registry of pre-configured molecular
systems and factory functions.
Registry
registry — Molecule registry and factory functions
Defines a registry of standard molecular benchmarks used in quantum
chemistry. Each entry provides a factory function that computes
molecular integrals and constructs a MolecularHamiltonian.
The registry covers a range of system sizes from H2 (4 qubits) to C2H4 (28 qubits), enabling systematic benchmarking of SQD/SKQD methods.
Constants
- MOLECULE_REGISTRY
Dictionary mapping lowercase molecule names to factory metadata.
Functions
- get_molecule
Instantiate a Hamiltonian for a named molecule.
- list_molecules
Return sorted list of registered molecule names.
- qvartools.molecules.registry.get_molecule(name, device='cpu')[source]
Create a Hamiltonian and info dict for a named molecule.
Looks up the molecule in
MOLECULE_REGISTRY, runs the PySCF integral computation, and constructs aMolecularHamiltonian.- Parameters:
- Returns:
hamiltonian (
MolecularHamiltonian) – The molecular Hamiltonian ready for diagonalisation.info (
dict) – Metadata dictionary with keysname,n_qubits,basis,geometry,charge,spin.
- Raises:
KeyError – If
nameis not found in the registry.- Return type:
Examples
>>> ham, info = get_molecule("H2") >>> info["n_qubits"] 4 >>> ham.num_sites 4
Functions
- qvartools.molecules.get_molecule(name, device='cpu')[source]
Create a Hamiltonian and info dict for a named molecule.
Looks up the molecule in
MOLECULE_REGISTRY, runs the PySCF integral computation, and constructs aMolecularHamiltonian.- Parameters:
- Returns:
hamiltonian (
MolecularHamiltonian) – The molecular Hamiltonian ready for diagonalisation.info (
dict) – Metadata dictionary with keysname,n_qubits,basis,geometry,charge,spin.
- Raises:
KeyError – If
nameis not found in the registry.- Return type:
Examples
>>> ham, info = get_molecule("H2") >>> info["n_qubits"] 4 >>> ham.num_sites 4
Available Molecules
Name |
Qubits |
Basis Set |
Description |
|---|---|---|---|
H2 |
4 |
sto-3g |
Hydrogen molecule (simplest benchmark) |
LiH |
12 |
sto-6g |
Lithium hydride |
BeH2 |
14 |
sto-6g |
Beryllium dihydride |
H2O |
14 |
sto-6g |
Water molecule |
NH3 |
16 |
sto-6g |
Ammonia |
CH4 |
18 |
sto-6g |
Methane |
N2 |
20 |
cc-pvdz |
Dinitrogen (strongly correlated) |
C2H4 |
28 |
sto-3g |
Ethylene (largest benchmark) |