Forces and properties¤
Analytic nuclear gradients and the response-property layer. Properties run
their own SCF from (mol, xc) and take a grid=becke(...) spec.
dftax.ks.forces.forces(mol: Molecule, xc: XCFunctional, result: KSResult | tuple | Array, *, grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, dispersion=None) -> Float[Array, 'n_atom 3']
¤
Nuclear forces F = -dE/dR (Ha/Bohr), shape (n_atom, 3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol
|
Molecule
|
a native :class: |
required |
xc
|
XCFunctional
|
the exchange-correlation functional. |
required |
result
|
KSResult | tuple | Array
|
the converged :class: |
required |
grid
|
Becke | None
|
Becke-grid quality (a :func: |
None
|
coulomb
|
ExactSpec | DFSpec | None
|
a :func: |
None
|
dftax.ks.properties.dipole(mol, xc: XCFunctional, *, origin=(0.0, 0.0, 0.0), debye: bool = False, grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> Float[Array, 3]
¤
Permanent electric dipole moment μ (atomic units, or Debye if debye).
μ = Σ_A Z_A (R_A − origin) − Tr(P · r) from the converged density. For a
neutral molecule the result is independent of origin.
dftax.ks.properties.polarizability(mol, xc: XCFunctional, *, method: str = 'fd', field: float = 0.002, origin=(0.0, 0.0, 0.0), grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> Float[Array, '3 3']
¤
Static dipole polarizability tensor α_ij = ∂μ_i/∂E_j (atomic units).
method="fd" (default): central finite difference of the dipole under a uniform
field of strength field (robust; one SCF per ±component). method="analytic":
exact coupled-perturbed KS response via implicit differentiation of the SCF fixed
point (:func:~dftax.ks.implicit.implicit_density), a single jax.jacobian
through the converged density, no field stepping. Returned symmetrized.
dftax.ks.properties.hessian(mol, xc, *, method: str = 'fd', step: float = 0.001, origin=(0.0, 0.0, 0.0), grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, cg_iters: int = 64, **scf_kw) -> Float[Array, 'n n']
¤
Nuclear Hessian ∂²E/∂R_A∂R_B (Ha/Bohr², shape (3N, 3N)).
method="fd" (default): central finite difference of the analytic
Pulay-free forces (6N SCF solves). method="analytic": the exact
orbital-rotation Schur complement
H = E_RR − E_Rκ (E_κκ)⁻¹ E_κR at one tightly converged reference
(3N CG response solves; RKS and UKS, materialized Coulomb backends;
see :mod:dftax.ks.hessian). step applies to the FD path,
cg_iters to the analytic response solves.
dftax.ks.properties.vibrations(mol, xc, *, hess=None, step: float = 0.001, grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> Vibrations
¤
Harmonic vibrational analysis (see :class:Vibrations).
dftax.ks.properties.ir_spectrum(mol, xc, *, step: float = 0.001, origin=(0.0, 0.0, 0.0), grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> IRSpectrum
¤
Harmonic IR spectrum from A_k ∝ |dμ/dQ_k|² (see :class:IRSpectrum).
dftax.ks.properties.raman_spectrum(mol, xc, *, step: float = 0.01, field: float = 0.002, origin=(0.0, 0.0, 0.0), grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> RamanSpectrum
¤
Harmonic Raman activities (Å⁴/amu, up to the usual constant) from the
polarizability derivatives dα/dQ. Expensive: a polarizability (field FD)
at every ±Cartesian displacement (O(N) Hessians' worth of work).
dftax.ks.properties.alchemical_deriv(mol, xc: XCFunctional, *, grid: Becke | None = None, coulomb: ExactSpec | DFSpec | None = None, **scf_kw) -> Float[Array, n_atom]
¤
Alchemical gradient ∂E/∂Z_A at fixed electron count (Ha per unit charge).
Hellmann-Feynman: the converged density (every spin channel, held fixed via its solve-based projector) and the energy is differentiated w.r.t. the nuclear charges, which enter only the nuclear-attraction and nuclear-repulsion terms.
coulomb=None resolves to :func:~dftax.ks.terms.exact here (not the
DF default) for backward compatibility, but df(...) works: the
auxiliary basis is resolved eagerly against the molecule (its centers are
geometry-fixed here; only the charges vary), so the raw-:class:System
charge closure and the outer solve share the same fitted backend.
dftax.ks.properties.Vibrations
¤
Harmonic analysis: frequencies (cm⁻¹, negative = imaginary), mass-weighted modes (columns), Cartesian displacement modes (columns).
__annotations__
class-attribute
¤
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
__doc__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__firstlineno__
class-attribute
¤
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral.
int('0b100', base=0) 4
__match_args__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__module__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__orig_bases__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__slots__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__static_attributes__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
cart_modes
class-attribute
¤
Alias for field number 2
frequencies
class-attribute
¤
Alias for field number 0
modes
class-attribute
¤
Alias for field number 1
dftax.ks.properties.IRSpectrum
¤
Harmonic IR spectrum: frequencies (cm⁻¹) and intensities (km/mol).
__annotations__
class-attribute
¤
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
__doc__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__firstlineno__
class-attribute
¤
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral.
int('0b100', base=0) 4
__match_args__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__module__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__orig_bases__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__slots__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__static_attributes__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
frequencies
class-attribute
¤
Alias for field number 0
intensities
class-attribute
¤
Alias for field number 1
dftax.ks.properties.RamanSpectrum
¤
Harmonic Raman spectrum: frequencies (cm⁻¹) and activities (Å⁴/amu).
__annotations__
class-attribute
¤
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
__doc__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__firstlineno__
class-attribute
¤
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral.
int('0b100', base=0) 4
__match_args__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__module__
class-attribute
¤
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.
__orig_bases__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__slots__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
__static_attributes__
class-attribute
¤
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
activities
class-attribute
¤
Alias for field number 1
frequencies
class-attribute
¤
Alias for field number 0