Coulomb backends¤
Two-electron strategies as values. Each knob lives on the backend it
configures; inert combinations raise at the factory. Density fitting is the
default (df() = def2-universal-jkfit with the chunk="auto",
device-aware memory policy, auxiliary functions up to i, and a spherical
auxiliary span on the materialized path; see df(spherical=...));
exact() is the O(N⁴) reference path. Range-separated hybrids run on every
DF backend, materialized, streamed, or mesh-sharded.
The Coulomb backends tutorial has the
backend-choice table.
dftax.ks.terms.exact(*, screen: float | None = None, stream: bool = False) -> ExactSpec
¤
Exact 4-center Coulomb and exchange integrals, for small systems.
Memory grows as O(N⁴); see :func:df for larger systems.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
screen
|
float | None
|
Cauchy-Schwarz threshold; integral quartets whose bound is
below it are skipped. |
None
|
stream
|
bool
|
contract Coulomb and exchange on the fly instead of storing the integrals: O(N²) memory, slower. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
dftax.ks.terms.df(auxbasis: str | BasisData = 'def2-universal-jkfit', *, chunk: int | str | None = 'auto', screen: float | str | None = 'auto', spherical: bool | None = None, whiten: bool | None = None, packed: bool | str = 'auto') -> DFSpec
¤
Density-fitted (RI) Coulomb and exact exchange, the default backend.
Memory grows as O(N³) instead of the O(N⁴) of :func:exact; with a
JK-fitting auxiliary basis the fitting error is well below 1 mHa.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auxbasis
|
str | BasisData
|
auxiliary basis name, or a built |
'def2-universal-jkfit'
|
chunk
|
int | str | None
|
memory strategy. |
'auto'
|
screen
|
float | str | None
|
relative Cauchy-Schwarz threshold below which AO pairs are
dropped from the fit. |
'auto'
|
spherical
|
bool | None
|
|
None
|
whiten
|
bool | None
|
store the tensor with the inverse metric folded in, which
saves one contraction per Fock build. |
None
|
packed
|
bool | str
|
store only the kept AO pairs, |
'auto'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
|
Example
KS(mol, xc) # same as coulomb=df()
KS(mol, xc, coulomb=df(chunk=None)) # always store the tensor
KS(mol, xc, coulomb=df(chunk=64)) # stream in chunks of 64