atomli.calculators
Generated from the public Python surface of Atomli 0.1.18.
LennardJones(epsilon=1.0, sigma=1.0, rc=None, shift=False)
Section titled “LennardJones(epsilon=1.0, sigma=1.0, rc=None, shift=False)”DFTD3(method='PBE', version=None, *, device='cpu', adapter=None)
Section titled “DFTD3(method='PBE', version=None, *, device='cpu', adapter=None)”DFTD4(method='PBE', atm=True, *, cutoffs=None, cutoff_widths=..., device='cpu', adapter=None)
Section titled “DFTD4(method='PBE', atm=True, *, cutoffs=None, cutoff_widths=..., device='cpu', adapter=None)”Native EEQ-D4(BJ)-ATM dispersion for PBE and r2SCAN.
DFTD4(method="PBE", atm=True, cutoffs=None, cutoff_widths=[0., 0.], device="cpu") uses native Rust kernels.
No external D4 package is required. Cutoffs contain pair, ATM, and D4
coordination radii in angstrom. Defaults are 50, 25, and 30 Bohr.
The EEQ coordination radius remains 25 Bohr, as defined by EEQ2019.
Cutoff widths contain the pair and ATM switching widths in angstrom.
Zero widths preserve hard cutoffs. Positive widths apply a quintic switch.
The default device=“cpu” supports molecules and full 3D periodic cells.
device=“gpu” (alias “wgpu”) selects the native
WebGPU EEQ-D4 pass, with 3D periodic coordination, pair/ATM image sums,
EEQ2019 charge-response forces and affine cell stress. Supported inputs
include finite molecules and fully 3D periodic solids. 1D/2D chain/slab
PBC is rejected until its automatic-charge electrostatic boundary
condition is verified. There is never a silent CPU fallback.
Pin one adapter with device=“gpu:get_charges(atoms) returns geometry-dependent EEQ charges.
atm=False removes ATM while retaining the ATM-fit pair parameters.
Charge-response derivatives use the native analytical EEQ adjoint.
get_charges(self, /, atoms)
Section titled “get_charges(self, /, atoms)”Return the geometry-dependent EEQ2019 charges in electron units.
SumCalculator(calcs)
Section titled “SumCalculator(calcs)”calculate(self, /, atoms=None, properties=None, system_changes=None)
Section titled “calculate(self, /, atoms=None, properties=None, system_changes=None)”get_basis_spaces(self, /)
Section titled “get_basis_spaces(self, /)”Preserve electronic component metadata for relaxation and phonon checks.
get_forces(self, /, atoms=None)
Section titled “get_forces(self, /, atoms=None)”get_potential_energy(self, /, atoms=None, force_consistent=False)
Section titled “get_potential_energy(self, /, atoms=None, force_consistent=False)”get_property(self, /, name, atoms=None, allow_calculation=True)
Section titled “get_property(self, /, name, atoms=None, allow_calculation=True)”get_stress(self, /, atoms=None)
Section titled “get_stress(self, /, atoms=None)”reset(self, /)
Section titled “reset(self, /)”XTB(method='gfn2', charge=None, unpaired=None, device=None, adapter=None, *, gamma_exchange_radii=None, scf=None, solvent=None, solvation=None, wgxtb=None, require_convergence=True, root_protection=False, root_recovery_cycles=250, root_energy_threshold=1e-11, root_fock_threshold=1e-12, root_max_iterations=250)
Section titled “XTB(method='gfn2', charge=None, unpaired=None, device=None, adapter=None, *, gamma_exchange_radii=None, scf=None, solvent=None, solvation=None, wgxtb=None, require_convergence=True, root_protection=False, root_recovery_cycles=250, root_energy_threshold=1e-11, root_fock_threshold=1e-12, root_max_iterations=250)”Construct an XTB calculator.
An explicit device or process device setting takes precedence.
Otherwise, g-xTB selects an available hardware GPU.
GFN2-xTB and protected roots use their CPU paths.
Supplying device= explicitly keeps the native strict validation.
Periodic g-xTB requires gamma_exchange_radii=(Rd, Rc) in angstrom.
The radii stay fixed during geometry changes. Each cell must have a shortest
lattice translation greater than 2 * Rc. Converge both radii and the
explicit Gamma supercell size. Restricted bulk cells support CPU and GPU execution.
root_protection=True selects the fixed-geometry CPU, zero-electronic-
temperature g-xTB root path. Its defaults reproduce the strict Li/graphite
qualification controls: 1e-11 Ha energy, 1e-12 Ha Fock, and a maximum of
250 primary and 250 completion/restart cycles. With recovery enabled, initial
acquisition first uses at most 32 SCF cycles, then bounded orbital recovery
when necessary. Hessian products and physical Fock work are counted separately.
A displaced continuation always restores its selected reference; it never
runs cold-root competition. The get_gxtb_root_diagnostics() result retains
initial history/work in reference_acquisition across independent restores.
Both the core and TB engine must support exact native geometry transport.
GFN2 solvation accepts solvent="water", solvation="alpb" (also
gbsa/cpcm and the corresponding *_cds models). A solvation dict uses
{"model": ..., "solvent": ...}. Unsupported methods raise.
The scf dict also accepts electronic_temperature_kelvin,
temperature_schedule_kelvin, mixer_damping, and initial_guess
(zero/sad/eeq/ceh), in addition to the existing stopping controls.
get_atomic_polarizabilities(self, /, atoms=None, *, method='d4_reference')
Section titled “get_atomic_polarizabilities(self, /, atoms=None, *, method='d4_reference')”Native D4-reference atomic polarizabilities in angstrom**3. These model values are not a molecular finite-field response tensor.
get_dipole_derivatives(self, /, atoms=None)
Section titled “get_dipole_derivatives(self, /, atoms=None)”Analytical Cartesian nuclear dipole derivatives (natoms, 3, 3) in electron (e),
where result[atom, cart_axis, dipole_component] = d mu_component / d R_{atom, cart_axis},
solved via Z-vector orbital response (3 linear solves, no nuclear displacements).
get_excitations(self, /, atoms=None, *, nstates=10, include_transition_vectors=True)
Section titled “get_excitations(self, /, atoms=None, *, nstates=10, include_transition_vectors=True)”Native sTDA excitation energies (eV), strengths, and transition dipoles (electron*angstrom). This is a molecular algebraic excited-state solve, not a finite-field polarizability or an excited-state nuclear gradient.
get_gxtb_root_diagnostics(self, /, atoms=None)
Section titled “get_gxtb_root_diagnostics(self, /, atoms=None)”Retained fixed-geometry CPU g-xTB root certificate and selection work. Returns None before a protected calculation or for a mismatched geometry.
get_gxtb_scf_diagnostics(self, /, atoms=None)
Section titled “get_gxtb_scf_diagnostics(self, /, atoms=None)”Retained g-xTB GPU stopping evidence; never runs SCF. Returns None before calculation or for a different geometry/backend. Fock RMS is in Hartree and is not a returned-state accuracy bound. Missing terminal checks are None; evaluated checks include their norm and limit.
get_polarizability(self, /, atoms=None)
Section titled “get_polarizability(self, /, atoms=None)”Analytical static molecular dipole polarizability tensor (3, 3) in angstrom**3,
solved via coupled-perturbed / Z-vector orbital response (3 linear solves, no finite fields).
CCSD(basis='cc-pvdz', *, triples=False, kpts=(1, 1, 1), charge=None, unpaired=None, device=None, adapter=None, settings=None, frozen=None)
Section titled “CCSD(basis='cc-pvdz', *, triples=False, kpts=(1, 1, 1), charge=None, unpaired=None, device=None, adapter=None, settings=None, frozen=None)”Construct a CCSD or CCSD(T) calculator.
Periodic atoms use k-point CCSD. Molecular atoms use restricted or unrestricted CCSD according to the unpaired electron count. Density fitting and factorized integral contractions are enabled by default. The default orbital basis is cc-pVDZ. Basis data ships with the engine. An omitted device uses Atomli device selection and hardware GPU discovery.
Forces and Hessians use exact analytical CPU or GPU response.
Periodic forces, stress, and Hessians require settings={“density_fitting”: False}
so the FFT integral source can provide exact derivative inputs. Precomputed
periodic GDF derivative jets are not exposed by this calculator.
Molecular HF density guesses are reused across compatible geometries.
GPU execution keeps post-HF CC, triples, and coupled response on the device;
Gaussian integral preparation and the HF reference remain on the CPU.
Singular orbital response and unsupported density-fitting rank reductions
raise explicit errors.
Partial PBC is unavailable. All public energies use eV.
frozen accepts a core-orbital count, explicit zero-based MO indices,
or separate alpha/beta index lists. Selection is currently molecular-only.
Additional settings: mesh, density_fitting, auxiliary_basis, max_cycles, energy_tolerance_ev, amplitude_tolerance, hf_tolerance_ev, and precision. An omitted mesh uses the upstream basis and precision estimate.
kernel(self, /, atoms=None)
Section titled “kernel(self, /, atoms=None)”Run a native CC calculation and return its energy in eV.
HF(basis='def2-SVP', *, method='auto', density_fitting=False, auxiliary_basis=None, charge=None, unpaired=None, scf=None, device='cpu')
Section titled “HF(basis='def2-SVP', *, method='auto', density_fitting=False, auxiliary_basis=None, charge=None, unpaired=None, scf=None, device='cpu')”Construct native molecular RHF, UHF, or ROHF.
method='auto' selects RHF for singlets and UHF otherwise. Explicit
method='uhf' also supports unrestricted singlets. RHF and UHF expose
analytical forces, Hessians, and Hessian-vector products. ROHF exposes
energies and electronic analysis; analytical ROHF derivatives are unavailable.
The current standalone route uses CPU. An explicit GPU request raises. Public energies use eV, coordinates use angstrom, and dipoles use electron*angstrom. No finite-difference fallback is permitted.
kernel(self, /, atoms=None)
Section titled “kernel(self, /, atoms=None)”Run a native HF calculation and return its energy in eV.
MLIP(model: Union[str, Any], runtime: str = 'nequix', device: Optional[Any] = None, *, adapter: Optional[Any] = None, download: bool = True, charge: Optional[float] = None, unpaired: Optional[int] = None, multiplicity: Optional[int] = None)
Section titled “MLIP(model: Union[str, Any], runtime: str = 'nequix', device: Optional[Any] = None, *, adapter: Optional[Any] = None, download: bool = True, charge: Optional[float] = None, unpaired: Optional[int] = None, multiplicity: Optional[int] = None)”Construct an MLIP calculator.
model: Catalog id ("nequix-mp-1","nequip-s","equiformer", …) or filesystem path to weights.runtime:"nequix"(default),"nequip","equiformer", or"hyff". Whenmodelis a catalog id, the catalog runtime is used unlessruntimeis set explicitly to a non-default value for path models.device: Optional calculator override. When omitted, an explicit process device override is inherited; otherwise MLIP uses a real GPU exposed by Atomli’s production WGPU backend and falls back to native CPU when no hardware adapter is usable. Accepted strings are"cpu"and"gpu"("wgpu"alias). A hardwareatomli.gpu.Adaptermay be passed directly.adapter: Optional physical WGPU adapter. Use an adapter returned byatomli.gpu.adapters(), itsselectorstring, an enumeration index, or a unique case-insensitive name substring. PCI selectors such as"pci:0000:61:00.0"are preferred on multi-GPU hosts.download: When True, fetch missing catalog models (tako → GitHub).charge: Total charge override for HyFF models (hyff-presto,hyff-vivace,hyff-moderato).Nonereadsatoms.info["charge"], then the summed initial charges, then 0. Other runtimes raise.unpaired: Unpaired-electron override for HyFF models; the spin multiplicity isunpaired + 1.Nonereadsatoms.info["unpaired"], then the summed initial magnetic moments, then 0.multiplicity: Alternative tounpaired(unpaired = multiplicity - 1). Returns: The Rust MLIP calculator instance.
batch_stats
Section titled “batch_stats”Work completed through native batch requests. Single calls are excluded.
QC(xc='PBE', basis='def2-SVP', density_fitting=None, charge=None, unpaired=None, settings=None, skala_checkpoint=None, device='cpu', adapter=None, require_convergence=True, scf=None, kpts=None, auxiliary_basis=None, *, pseudopotential=None, smearing=None, convergence=None, maxiter=None, download: bool = True)
Section titled “QC(xc='PBE', basis='def2-SVP', density_fitting=None, charge=None, unpaired=None, settings=None, skala_checkpoint=None, device='cpu', adapter=None, require_convergence=True, scf=None, kpts=None, auxiliary_basis=None, *, pseudopotential=None, smearing=None, convergence=None, maxiter=None, download: bool = True)”Construct the native QC calculator.
Device selection additionally uses Atomli’s shared resolver, so
device= or adapter= accepts atomli.gpu.Adapter objects and QC inherits
atomli.set_default_device(...) exactly like XTB/MLIP. This wrapper also
adds automatic SKALA 1.1 checkpoint delivery. With xc="SKALA-1.1"
and no skala_checkpoint, the pinned checkpoint is fetched once from
the model release and cached locally.
download: Whether a missing checkpoint may be fetched. PassFalseto require a cache hit. Ignored unless the checkpoint is being resolved, so it never affects a non-SKALA functional or an explicitly suppliedskala_checkpoint.
Native molecular and three-dimensionally periodic DFT calculator.
QC follows the normal ASE calculator protocol and accepts both atomli
Atoms and ASE-provided Atoms objects. With settings=None it constructs
a molecular calculation. Select periodic calculation explicitly with
settings={"periodic": True}; periodic mode requires a cell and PBC enabled
on all three axes.
Parameters
Section titled “Parameters”xc : str, default “PBE”
Exchange-correlation functional. PBE, r2SCAN and SKALA-1.1 run on
molecules and periodic cells; wB97X-V, wB97M-V, PBEsol and revPBE are
molecular (PBEsol and revPBE on the CPU only); LDA,VWN is periodic with
its matched GTH-PADE pseudopotential.
basis : str, default “def2-SVP”
Molecular orbital basis. In periodic mode set settings["basis"]
instead and leave this top-level argument at its default.
density_fitting : {“none”, “default”}, optional
Molecular density-fitting selection. Molecular calculations default to
"default" (RI-J density fitting). B97-V hybrids also use RI-K exchange. Pass
"none" for conventional Coulomb builds. Periodic mode requires
"none" and defaults to it.
pseudopotential : str or None
Molecular GTH pseudopotential. For a molecular gth-* basis, None
resolves to "gth-pade" for LDA/VWN and "gth-pbe" for PBE, r2SCAN,
and SKALA. It is molecular-only; periodic pseudopotentials belong in
settings["pseudopotential"].
charge : float or None
Optional total-charge override. It must be finite and integer-valued
when the native QC calculation is built.
unpaired : int or None
Number of unpaired electrons. The electron count and this number must
have the same parity, so an odd-electron system needs an odd value: a
radical such as CH3 (9 electrons) is QC(..., unpaired=1). Leaving
it at the default None on an odd-electron system raises
electron/spin parity mismatch: 9 electrons and 0 unpaired electrons;
pass unpaired=1 to fix it. Per-site moments are declared separately;
see “Magnetic structure” below.
skala_checkpoint : str or None
Path to the pinned SKALA 1.1 model file (skala-1.1.fun). Required
with, and only valid for, xc="SKALA-1.1". Both molecular and periodic
SKALA use it.
device : {“cpu”, “gpu”}, optional
Exchange-correlation compute device. "cpu" is the default. "gpu" is
available only on the QC routes implemented by the native Gpu runtime;
unsupported combinations fail closed. "wgpu" remains accepted as a
compatibility alias.
adapter : atomli.gpu.Adapter, int, str, or None
Optional physical GPU selected from the process-global atomli.gpu
inventory. PCI selectors are preferred on multi-GPU hosts. It is valid
only with device="gpu"/"wgpu"; supported periodic SKALA GPU routes
bind their Atomli QC Gpu context to this adapter, while unsupported QC GPU
routes continue to raise rather than ignoring the selector.
require_convergence : bool, default True
Whether an SCF that ran out of cycles without meeting its thresholds
raises instead of returning its energy. The default refuses it: that
energy is a point on an oscillating trajectory, not an observable, and
a returned float carries no marker distinguishing it from a correct
one. Pass False to take the last iterate deliberately; the call then
warns, and calc.converged / results["converged"] report False.
The opt-out covers the energy only. Forces and stress are
differentiated from the converged state itself, so they are refused on
an unconverged SCF either way. Convergence is readable on any
calculator: calc.converged (also results["converged"]) and
calc.scf_iterations (also results["scf_iterations"]).
calc.converged is None until something has been calculated, which
is distinct from False. A converged SCF is also necessary but not
sufficient: a periodic run can converge cleanly on an under-resolved
mesh and still settle on the wrong physical state, so converged=True
is not a licence to skip convergence testing against mesh, basis
and k-point sampling.
scf : Scf, dict, str, or None
SCF numerical controls, molecular and periodic alike: an
atomli.calculators.qc.Scf, an equivalent dict, or a preset name ("default",
"robust"). Scf.fields() lists every field with its documentation,
and an unknown key raises naming them. None keeps the engine
default. The resolved block reads back from calc.parameters["scf"].
kpts : tuple, dict, KMesh, array, or None
ASE-conventional k-point sampling. kpts=(2, 2, 2) is a gamma-centered
mesh, kpts={"size": (2, 2, 2), "gamma": False} the shifted
Monkhorst-Pack one, and kpts=KMesh((4, 4, 4), symmetry="time_reversal")
the full mesh identity. kpts={"density": d} targets d k-points per
inverse angstrom along each reciprocal vector. Passing kpts implies
periodic mode. An N-by-3 array specifies fractional reciprocal coordinates
with equal weights, resolved against the current cell.
This keyword is an alias for settings["kpoints"] /
settings["kpoint_density"]: exactly one spelling may declare the
sampling, and declaring both raises naming the two. Unsupported ASE
forms (even, unequal point weights) are rejected with an error
naming what is supported, and KMesh.fields() lists every mesh field
with its documentation.
auxiliary_basis : str or None
Explicit RI fitting basis for the molecular density-fitted Coulomb
build, e.g. "def2-universal-jfit". The default None lets the engine
choose the auxiliary set matching the functional. It is molecular-only,
and it is the fitting set itself: passing it with
density_fitting="none" or with periodic settings raises, because
neither of those runs a fitted Coulomb build. It reads back from
calc.parameters["auxiliary_basis"].
smearing : dict or None
GPAW-conventional occupation broadening,
smearing={"name": "fermi-dirac", "width": 0.1}, with the width in eV
and "gaussian" the other accepted name. It is sugar for
settings["smearing"], whose sigma is in Hartree: the width divides
by 27.211386245988 on the way in, and the resolved block reads back
from calc.parameters["settings"]["smearing"]. Exactly one spelling
may declare the broadening, and declaring both raises naming the two.
Broadening needs a periodic mode to act on, selected by
settings["periodic"] or by kpts; without one this raises. The
native key’s chemical_potential and fixed_spin have no ASE
spelling and stay in settings["smearing"].
convergence : dict or None
ASE-conventional SCF thresholds, convergence={"energy": 1e-6} with
the tolerance in eV. It is sugar for scf["energy_tolerance"], which
is in Hartree, and any other key raises naming energy as the one
this engine’s SCF converges on. Exactly one spelling may declare the
tolerance: an scf dict naming energy_tolerance, or an Scf
instance or preset name (which specifies the whole block), conflicts
with it and raises naming both.
maxiter : int or None
ASE-conventional SCF cycle limit, sugar for scf["max_cycles"], and
subject to the same one-spelling rule as convergence. It must be at
least 1; scf={"max_cycles": 0} is the spelling for evaluating the
initial density without an SCF. Disjoint scf keys compose:
maxiter=99, scf={"level_shift": 0.25} sets both.
settings : dict or None
Periodic settings schema:
periodic: required boolean selector.Trueenables periodic mode.basis: orbital basis, default"gth-dzvp-molopt-sr".pseudopotential: default"gth-pbe", or"gth-pade"for LDA/VWN.energy_cutoff: FFT-grid cutoff in Hartree, default100.0.mesh: optional positive[nx, ny, nz]FFT mesh override.kpoint_density: minimumkpt * lengthproduct in angstrom, default15.0. Each automatic dimension ismax(1, ceil(kpoint_density / lattice_length_angstrom)).kpoints: optional explicit mesh. Either positive[kx, ky, kz]dimensions (gamma-centered) or a mesh mapping /KMeshcarryingsize,centering,symmetry,wrap_aroundandao_symmetry. It is echoed as the full mesh identity either way.precision: integral and grid target, default1e-8.derivative_mode:"analytical"(default) or"automatic"(an alias of analytical). Forces and stress are always analytical; there is no finite-difference route.smearing: optional occupation broadening, as a nested mapping. See “Occupation broadening” below.dft_u: optional Hubbard+Ucorrections. See “DFT+U” below.
mesh overrides the mesh derived from energy_cutoff; kpoints overrides
the sampling derived from kpoint_density. Unknown keys, invalid dimensions,
non-positive numerical settings, non-3D PBC, and missing or degenerate cells
raise errors rather than selecting fallback values. The resolved values read
back from calc.parameters["settings"].
Atoms with pbc=True need these settings; without them the calculation
raises periodic atoms require explicit QcPeriodicSettings. The fix is to
pass settings={"periodic": True, ...}, naming at least a periodic basis
and pseudopotential.
Magnetic structure
Section titled “Magnetic structure”Charge and spin resolve independently for native and ASE atoms. Calculator arguments take precedence over explicit native Atoms constructor arguments, then atoms.info entries, then initial-array sums. Omitted native arguments permit inference. Explicit zero values remain declarations.
Per-site initial magnetic moments follow the ASE convention:
atoms.set_initial_magnetic_moments([...]) (or initial_magmoms in an
extxyz file) declares the starting magnetic state, and the calculator
reads it automatically. The declared moments seed the unrestricted SCF’s
initial density with the matching per-site alpha/beta split — the only
way to reach a ferrimagnetic or antiferromagnetic solution — and any
nonzero declaration selects spin-polarized treatment even at zero net
moment. When both unpaired and per-site moments are given, the summed
moments must equal the unpaired count or the calculation raises an error
naming both numbers; when only moments are given, the net spin is derived
from their sum, which must then be an integer.
In a k-point-sampled unrestricted cell the declared per-cell moment is
enforced at every kpoints mesh. This deliberately diverges from PySCF
through 2.14, whose KUHF.nelec leaves cell.spin unscaled and so holds
only unpaired / nkpts per cell.
Occupation broadening
Section titled “Occupation broadening”settings["smearing"] is a nested mapping broadening the occupations. A
metal has no gap for integer occupations to fill against, so its SCF
oscillates between degenerate states and never converges; broadening is
what makes such a cell solvable. It is absent by default, because integer
occupations are the correct description of an insulator.
atoms.calc = QC(xc="PBE", settings={ "periodic": True, "basis": "gth-szv-molopt-sr", "pseudopotential": "gth-pbe", "mesh": [18, 18, 18], "kpoints": [1, 1, 1], "smearing": {"sigma": 0.01, "method": "fermi"},})sigma is the width in Hartree and is required: it must be positive and
finite. method is "fermi" (default) or "gaussian".
chemical_potential fixes the Hartree chemical potential instead of
optimizing it against the electron count each cycle. fixed_spin=True
holds the alpha and beta electron counts apart, keeping the requested
moment rather than letting one common chemical potential relax it. With
smearing on, the reported energy is the Mermin free energy E - sigma*S,
the quantity the returned forces and stress differentiate. The smearing
keyword above is the ASE-conventional spelling of the same block.
settings["dft_u"] adds Hubbard +U corrections, named the way the
literature quotes them: element, then shell, then U in eV.
atoms.calc = QC(xc="PBE", settings={ "periodic": True, "basis": "gth-dzvp-molopt-sr", "pseudopotential": "gth-pbe", "dft_u": {"Fe": {"3d": 4.0}},})Every iron site in the cell gets the same 4 eV correction on its 3d shell.
Several elements and several shells per element are allowed:
{"Ni": {"3d": 6.0}, "O": {"2p": 1.0}}. The mapping echoes back from
calc.parameters["settings"]["dft_u"] exactly as written, and an
atomli.calculators.qc.DftU instance is the typed spelling of the same mapping,
accepted wherever the dict is.
The projectors are built against PySCF’s MINAO reference basis, not the
periodic basis the SCF runs in, so the shell name has to exist in MINAO for
that element. A shell that selects nothing there is refused at energy time,
naming the pattern it tried (DFT+U selection "Fe 3q" matched no AOs in the "MINAO" reference) rather than quietly running plain DFT and reporting it
as +U. Construction cannot check this: it takes the cell’s own elements to
know which AOs exist.
dft_u runs on MultiGrid for spin-polarized (KUKS+U) cells. Atomli QC rejects
restricted MultiGrid DFT+U.
Results and stress
Section titled “Results and stress”Energy and free energy are in eV. Forces are in eV/angstrom. Periodic stress
is in eV/angstrom**3 and defaults to ASE Voigt order
[xx, yy, zz, yz, xz, xy]; get_stress(voigt=False) returns a symmetric
3 by 3 tensor. Molecular QC does not advertise stress and raises ASE’s
PropertyNotImplementedError when stress is requested.
Caching
Section titled “Caching”The native backend and results are retained across ASE optimizer, molecular
dynamics, and repeated property calls. Exact state comparison includes
atomic numbers, positions, cell, PBC, charge, and unpaired-electron
overrides. An unchanged state reuses available results; a changed state
invalidates them. reset() also discards the retained backend.
Examples
Section titled “Examples”Molecular ASE geometry:
from ase import Atomsfrom atomli.calculators.qc import QC
atoms = Atoms("H2", positions=[[0, 0, 0], [0, 0, 0.74]])atoms.calc = QC(xc="PBE", basis="def2-SVP")energy = atoms.get_potential_energy()forces = atoms.get_forces()Periodic ASE geometry with automatic kpt * length >= 15 sampling:
from ase.build import bulkfrom atomli.calculators.qc import QC
atoms = bulk("Si", "diamond", a=5.43)atoms.calc = QC(settings={"periodic": True})stress = atoms.get_stress()stress_tensor = atoms.calc.get_stress(atoms, voigt=False)kernel(self, /, atoms=None, *, dm0=None)
Section titled “kernel(self, /, atoms=None, *, dm0=None)”Explicit SCF entry point, returning energy in eV. dm0 uses real AO density blocks, with one restricted or two unrestricted spin channels.
set(self, /, **kwargs)
Section titled “set(self, /, **kwargs)”Transactionally apply settings and invalidate cached electronic results. SCF/periodic dictionaries merge with the existing resolved controls.
with_settings(self, /, **kwargs)
Section titled “with_settings(self, /, **kwargs)”Return a new calculator with nested SCF/periodic overrides; no state is shared.
Shared calculator interface
Section titled “Shared calculator interface”Common ASE-compatible evaluation, property, state-cache, and memory-estimation methods exposed by Atomli calculators (QC, XTB, CCSD, HF, MLIP, DFTD3, DFTD4, LennardJones). Availability of get_stress and analytical derivatives depends on the calculator and periodicity.
calculate(self, /, atoms, properties=None, system_changes=None)
Section titled “calculate(self, /, atoms, properties=None, system_changes=None)”Calculate requested properties for an ASE or atomli Atoms object.
properties defaults to ["energy"]. system_changes is
accepted for ASE protocol compatibility; invalidation uses an
exact native state key that includes geometry, cell, PBC, and
electronic overrides.
calculation_required(self, /, atoms, properties)
Section titled “calculation_required(self, /, atoms, properties)”Report whether any requested property needs calculation.
The comparison uses the exact native state rather than ASE’s
caller-supplied system_changes list.
estimate_memory(self, /, atoms=None, properties=None)
Section titled “estimate_memory(self, /, atoms=None, properties=None)”Estimate peak host RAM and device VRAM before running a calculation.
get_capabilities(self, /, atoms=None)
Section titled “get_capabilities(self, /, atoms=None)”Analytical capabilities for this geometry; never performs SCF.
get_forces(self, /, atoms=None, apply_constraint=None)
Section titled “get_forces(self, /, atoms=None, apply_constraint=None)”Return forces in eV/angstrom as a copied (n_atoms, 3) array.
When atoms is omitted, the last retained atomic state is used.
apply_constraint is accepted for ASE protocol compatibility;
ASE Atoms applies positional constraints around calculator calls.
get_potential_energy(self, /, atoms=None, force_consistent=None)
Section titled “get_potential_energy(self, /, atoms=None, force_consistent=None)”Return potential energy in eV.
When atoms is omitted, the last retained atomic state is used.
force_consistent=True requests the ASE free_energy result.
get_property(self, /, name, atoms=None, allow_calculation=None)
Section titled “get_property(self, /, name, atoms=None, allow_calculation=None)”Return one named property, calculating it when necessary.
allow_calculation=False returns None when the current state
has no cached value. Unsupported names raise ASE’s
PropertyNotImplementedError when ASE is installed.
get_stress(self, /, atoms=None, apply_constraint=None, voigt=None)
Section titled “get_stress(self, /, atoms=None, apply_constraint=None, voigt=None)”Return stress in eV/angstrom**3.
The default is ASE Voigt order [xx, yy, zz, yz, xz, xy].
Pass voigt=False for a copied symmetric (3, 3) array. When
atoms is omitted, the last retained atomic state is used.
apply_constraint is accepted for ASE protocol compatibility;
ASE Atoms applies cell constraints around calculator calls.
reset(self, /)
Section titled “reset(self, /)”Clear cached results, retained atoms, and the native backend.
todict(self, /)
Section titled “todict(self, /)”Return normalized constructor parameters as a new dictionary.
Shared electronic-structure methods
Section titled “Shared electronic-structure methods”Retained orbital, density, Hessian, DFPT, field, DOS/PDOS, checkpoint, and wavefunction methods shared across electronic calculators (QC, XTB, CCSD, HF). See atomli.calculators.qc and the analytical electronic API for exact shapes and units.
analyze_fields(self, /, kinds, *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, density_floor=1e-12, kinetic_density=None, charges=False, atoms=None)
Section titled “analyze_fields(self, /, kinds, *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, density_floor=1e-12, kinetic_density=None, charges=False, atoms=None)”Evaluate related fields from one retained state and one density grid. Kinds include electron_density, spin_density, orbital_amplitude, electrostatic_potential, gradient_norm, laplacian, rdg, sign_lambda2_rho, and elf. Analytic producers also supply kinetic_energy_density, gradient_x, gradient_y, gradient_z, hessian_xx, hessian_xy, hessian_xz, hessian_yy, hessian_yz, and hessian_zz. rdg is the reduced density gradient. elf is the electron localization function. sign_lambda2_rho is density times the sign of the middle Hessian eigenvalue. density_floor uses electron/angstrom^3; kinetic_density is a flat C-order array in electron/angstrom^5. It overrides the producer’s positive kinetic density.
analyze_fields_at_points(self, /, kinds, points, *, density_floor=1e-12, atoms=None)
Section titled “analyze_fields_at_points(self, /, kinds, points, *, density_floor=1e-12, atoms=None)”Evaluate analytic density jets at coordinates in angstrom.
begin_independent_evaluations(self, /, atoms=None)
Section titled “begin_independent_evaluations(self, /, atoms=None)”Save one electronic reference for independent geometry evaluations.
end_independent_evaluations(self, /)
Section titled “end_independent_evaluations(self, /)”Release the independent electronic reference.
flip_atom_spins(self, /, atom_indices, atoms=None)
Section titled “flip_atom_spins(self, /, atom_indices, atoms=None)”Flip local spin polarization on atom_indices in-place in the retained state to seed a broken-symmetry (BS) calculation.
get_atomic_charges(self, /, atoms=None)
Section titled “get_atomic_charges(self, /, atoms=None)”Net atomic charges from the retained state, without a real-space grid.
get_basis_diagnostics(self, /, atoms=None)
Section titled “get_basis_diagnostics(self, /, atoms=None)”Inspect periodic basis conditioning on the CPU without running SCF.
get_basis_spaces(self, /)
Section titled “get_basis_spaces(self, /)”Actual retained overlap metadata. This method does not run SCF.
get_density(self, /, points, *, spin_density=False, atoms=None)
Section titled “get_density(self, /, points, *, spin_density=False, atoms=None)”Evaluate electron or spin density at coordinates in angstrom.
get_dfpt_force_constants(self, /, supercell, atoms=None)
Section titled “get_dfpt_force_constants(self, /, supercell, atoms=None)”Image-resolved force constants in eV/angstrom**2 from primitive-cell monochromatic DFPT. Shape: (n_images, n_atoms, 3, n_atoms, 3).
get_dipole_moment(self, /, atoms=None)
Section titled “get_dipole_moment(self, /, atoms=None)”Molecular dipole in electron*angstrom, about the laboratory origin.
get_dos(self, /, width=0.1, window=None, npts=401, atoms=None)
Section titled “get_dos(self, /, width=0.1, window=None, npts=401, atoms=None)”Gaussian DOS from retained orbitals. Energies and window are relative to the Fermi level, in eV, matching ASE DOS.
get_eigenvalues(self, /, kpt=0, spin=0, atoms=None)
Section titled “get_eigenvalues(self, /, kpt=0, spin=0, atoms=None)”Orbital eigenvalues in eV for one spin and retained SCF k-point.
get_electronic_state(self, /, atoms=None, *, matrices=True)
Section titled “get_electronic_state(self, /, atoms=None, *, matrices=True)”Independent arrays with explicit spin/k/band axes; energies in eV.
get_energy_components(self, /, atoms=None)
Section titled “get_energy_components(self, /, atoms=None)”Named total, free, electronic, and nuclear energies in eV.
get_fermi_level(self, /, atoms=None)
Section titled “get_fermi_level(self, /, atoms=None)”Chemical potential or molecular frontier reference, in eV.
get_field(self, /, kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)
Section titled “get_field(self, /, kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)”Evaluate a field on a grid. Coordinates use angstrom.
get_field_at_points(self, /, points, kind='electron_density', *, spin=0, band=0, atoms=None)
Section titled “get_field_at_points(self, /, points, kind='electron_density', *, spin=0, band=0, atoms=None)”Evaluate electron_density, spin_density, electrostatic_potential, orbital_amplitude, or kinetic_energy_density at coordinates in angstrom.
get_hessian(self, /, atoms=None)
Section titled “get_hessian(self, /, atoms=None)”Return the analytical Hessian in eV/angstrom**2.
The array is ASE-shaped (n_atoms, 3, n_atoms, 3). When
atoms is omitted, the last retained atomic state is used.
Configurations without analytical second derivatives raise an unsupported-operation error.
get_hessian_vector(self, /, direction, atoms=None)
Section titled “get_hessian_vector(self, /, direction, atoms=None)”Apply the analytical Hessian to a dimensionless (natoms, 3) direction. Returns eV/angstrom**2. No finite-difference fallback is permitted.
get_k_point_weights(self, /, atoms=None)
Section titled “get_k_point_weights(self, /, atoms=None)”get_magnetic_moments(self, /, atoms=None)
Section titled “get_magnetic_moments(self, /, atoms=None)”Atom-resolved physical magnetic moments (n_alpha - n_beta) from the retained state.
get_number_of_bands(self, /, atoms=None)
Section titled “get_number_of_bands(self, /, atoms=None)”get_number_of_spins(self, /, atoms=None)
Section titled “get_number_of_spins(self, /, atoms=None)”get_occupation_numbers(self, /, kpt=0, spin=0, atoms=None)
Section titled “get_occupation_numbers(self, /, kpt=0, spin=0, atoms=None)”get_overlap(self, /, atoms=None)
Section titled “get_overlap(self, /, atoms=None)”Copied overlap matrices with axes (kpoint, ao, ao), dimensionless.
get_pdos(self, /, grouping='atom', width=0.1, window=None, npts=401, atoms=None)
Section titled “get_pdos(self, /, grouping='atom', width=0.1, window=None, npts=401, atoms=None)”AO Mulliken-projected DOS grouped by atom or shell.
get_scf_diagnostics(self, /, atoms=None)
Section titled “get_scf_diagnostics(self, /, atoms=None)”Scalar convergence evidence. The orbital residual uses eV and the backend’s normalization; it is not an atomic force.
get_spin_contamination(self, /, atoms=None)
Section titled “get_spin_contamination(self, /, atoms=None)”Spin-expectation and broken-symmetry diagnostics (<S^2>, exact S(S+1), spin_contamination, nalpha, nbeta, sz).
get_wavefunction(self, /, format='hdf5', atoms=None)
Section titled “get_wavefunction(self, /, format='hdf5', atoms=None)”Wavefunction file bytes. HDF5 supports molecules and PBC; Molden and WFN require a supported molecular orbital state.
make_rdm1(self, /, atoms=None)
Section titled “make_rdm1(self, /, atoms=None)”Copied AO density with axes (spin, kpoint, ao, ao). Restricted density is spin summed; CC uses its correlated analysis density.
read_checkpoint(self, /, path, atoms=None)
Section titled “read_checkpoint(self, /, path, atoms=None)”Load a compatible electronic seed and return its atoms.
read_wavefunction(self, /, path, atoms=None)
Section titled “read_wavefunction(self, /, path, atoms=None)”Import a compatible HDF5 SCF density as an initial guess.
restore_independent_evaluation_state(self, /)
Section titled “restore_independent_evaluation_state(self, /)”Restore the common seed and invalidate observable caches.
write_checkpoint(self, /, path, atoms=None)
Section titled “write_checkpoint(self, /, path, atoms=None)”Save an atomic native checkpoint with its model identity.
write_cube(self, /, path=..., kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)
Section titled “write_cube(self, /, path=..., kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)”Write a standard Cube file directly from the native state.
write_field(self, /, path=..., kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)
Section titled “write_field(self, /, path=..., kind='electron_density', *, shape=None, origin=None, axes=None, margin=2.0, spin=0, band=0, atoms=None)”Write Cube by default. An explicit .h5 path selects a standalone HDF5 field.