qrunch.chemistry.qrackle.scf.self_consistent_field_solver_protocol

Protocol shared by self-consistent field solvers.

Classes

SelfConsistentFieldSolverBuilderProtocol

Build SCF solvers for an arbitrary Fock builder.

SelfConsistentFieldSolverOptionUpdates

SCF solver option updates; omitted options keep their current values.

SelfConsistentFieldSolverProtocol

Protocol for solvers that converge an SCF calculation from an optional density.

class SelfConsistentFieldSolverBuilderProtocol

Bases: Protocol[TMatrix, TVector]

Build SCF solvers for an arbitrary Fock builder.

The spin-wrapper type variables are bound at the method level so one builder can serve both restricted and unrestricted matrix modules.

__init__(*args, **kwargs)
create_solver(scf_matrix_module: SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], fock_builder: FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) → SelfConsistentFieldSolverProtocol[TSCFMatrix]

Create an SCF solver with fresh stepper state.

Parameters:
  • scf_matrix_module (SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – SCF matrix module (restricted or unrestricted).

  • fock_builder (FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – Fock builder that defines the SCF problem.

Return type:

SelfConsistentFieldSolverProtocol[TSCFMatrix]

class SelfConsistentFieldSolverOptionUpdates

Bases: TypedDict

SCF solver option updates; omitted options keep their current values.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
clear() → None.  Remove all items from D.
convergence_slope_threshold: float
convergence_tolerance: float
copy() → a shallow copy of D
energy_increase_threshold: float
classmethod fromkeys(iterable, value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items() → a set-like object providing a view on D's items
keys() → a set-like object providing a view on D's keys
lienient_convergence: bool
local_region_gradient_exit_threshold: float
local_region_gradient_threshold: float
max_iterations: int
minimum_number_of_global_iterations_after_fallback: int
minimum_number_of_iterations_for_stability_fit: int
number_of_iterations_for_stability_fit: int
occupation_tolerance: float
pop(k[, d]) → v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

scf_queue_max_length: int
setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) → None.  Update D from mapping/iterable E and F.

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → an object providing a view on D's values
class SelfConsistentFieldSolverProtocol

Bases: Protocol[TSCFMatrix_contra]

Protocol for solvers that converge an SCF calculation from an optional density.

__init__(*args, **kwargs)
solve(molecular_configuration: MolecularConfiguration, initial_density: TSCFMatrix_contra | None = None, additional_potential_matrix: TSCFMatrix_contra | None = None) → RestrictedMolecularOrbitalCalculatorResult | UnrestrictedMolecularOrbitalCalculatorResult

Run an SCF calculation.

Parameters:
  • molecular_configuration (MolecularConfiguration) – Molecular geometry and basis configuration.

  • initial_density (TSCFMatrix_contra | None) – Optional initial density matrix.

  • additional_potential_matrix (TSCFMatrix_contra | None) – Optional one-electron potential added to the core Hamiltonian.

Return type:

RestrictedMolecularOrbitalCalculatorResult | UnrestrictedMolecularOrbitalCalculatorResult

with_updated_options(**updates: Unpack[SelfConsistentFieldSolverOptionUpdates]) → Self

Return a copy of the solver with updated SCF solver options.

Parameters:

updates (Unpack[SelfConsistentFieldSolverOptionUpdates]) – Option values to change; omitted options keep their current values.

Return type:

Self