forte2.system.build_basis#
Module Contents#
- forte2.system.build_basis.BSE_AVAILABLE = True#
- forte2.system.build_basis.build_basis_from_dict(basis_data)#
Build a Basis object from a dictionary containing the basis set data.
The basis_data is expected to have the following format for each shell: {“schema_version”: 1,
“nshells”: int, “shells”: [
- {“nprim”: int,
“l”: int, “exponents”: list[float], “coefficients”: list[float], “center”: list[float]}, “is_pure”: bool
…
]}
- Parameters:
- basis_datadict
A dictionary containing the basis set data for all shells.
- Returns:
- basisforte2.ints.Basis
The constructed Basis object.
- forte2.system.build_basis.build_basis(basis_assignment: str | dict, geometry, embed_normalization_into_coefficients: bool = True, decontract: bool = False) forte2.Basis#
Assemble the basis set from JSON data or Basis Set Exchange, depending on availability.
- Parameters:
- basis_assignmentstr or dict
The basis set name or a dictionary with per-atom basis assignments. It is possible to assign different basis sets to specific atomic indices (e.g. “O2” for the second oxygen atom). It is also possible to assign basis set for a different element than the atom itself using the syntax “basis::element”, e.g. “O”: “sto-6g::N” to assign nitrogen sto-6g basis functions to oxygen. There are three sources for basis set data:
If the basis set name ends with
.json, it is treated as a local JSON file path.If a JSON file with the basis set name exists in the
forte2/data/basisdirectory, it is used.If neither of the above is found, Basis Set Exchange is used (if available).
For example, a basis set assignment dictionary can look like:
{ "H": "cc-pvtz-truncated.json::Li", "O2": "decon-cc-pvqz::N", "default": "cc-pvdz" }
where
"default"is used for atoms not explicitly listed.- geometryforte2.system.geom_utils.GeometryHelper
The molecular geometry.
- embed_normalization_into_coefficientsbool, optional, default=True
Whether to embed normalization factors into the contraction coefficients.
- decontractbool, optional, default=False
If True, all basis functions will be decontracted regardless of the basis set assignment.
- Returns:
- basisforte2.ints.Basis
The basis set.
- forte2.system.build_basis.decontract_basis(basis: forte2.Basis, embed_normalization_into_coefficients: bool = True)#
Decontract a Basis object and return a new Basis object.
For generally contracted basis sets where multiple shells share the same primitives (same l, center, and exponents), this function avoids duplicates so that each unique primitive appears only once.
- Parameters:
- basisforte2.ints.Basis
The Basis object to be decontracted.
- embed_normalization_into_coefficientsbool, optional, default=True
Whether to embed normalization factors into the contraction coefficients.
- Returns:
- basis_deconforte2.ints.Basis
The decontracted Basis object.