qrunch.chemistry.qrackle.scf.stability_checkers.stability_checker_protocol

Protocols for post-convergence orbital stability checkers used by the SCF solver.

Classes

StabilityCheckerBuilderProtocol

Build orbital stability checkers.

StabilityCheckerProtocol

Check a converged SCF density for orbital instabilities and displace it off a saddle.

class StabilityCheckerBuilderProtocol

Bases: Protocol

Build orbital stability checkers.

As for SCF stepper builders, the type variables are bound at the method level so one builder can serve both restricted and unrestricted matrix modules.

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

Create an orbital stability checker for the supplied matrix module.

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

  • fock_builder (FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – Builder for the Fock/Kohn-Sham matrix and its response.

Return type:

StabilityCheckerProtocol[TSCFMatrix]

class StabilityCheckerProtocol

Bases: HasMetadataDictMethod, Protocol[TSCFMatrix]

Check a converged SCF density for orbital instabilities and displace it off a saddle.

The SCF solver owns the iteration loop and its restart state: it counts the checks against maximum_number_of_checks, keeps the converged saddle as a fallback, and restarts its trajectory from a returned displaced density.

__init__(*args, **kwargs)
displace_along_instability(*, density: TSCFMatrix, fock: TSCFMatrix, core_hamiltonian: TSCFMatrix, overlap_matrix: TSCFMatrix, lowdin_orthogonalizer: TSCFMatrix, molecular_configuration: MolecularConfiguration, orbital_occupation: OrbitalOccupation) → TSCFMatrix | None

Return a newly allocated density displaced off an instability, or None when none is found.

The inputs are borrowed and the caller owns any returned density.

Parameters:
  • density (TSCFMatrix) – Converged AO density.

  • fock (TSCFMatrix) – Fock matrix at density.

  • core_hamiltonian (TSCFMatrix) – Core Hamiltonian, including any additional potential.

  • overlap_matrix (TSCFMatrix) – AO overlap matrix.

  • lowdin_orthogonalizer (TSCFMatrix) – Lowdin orthogonalizer.

  • molecular_configuration (MolecularConfiguration) – Molecular configuration.

  • orbital_occupation (OrbitalOccupation) – Electron occupation, preserved by the displacement.

Return type:

TSCFMatrix | None

property maximum_number_of_checks: int

Maximum number of checks per SCF solve. Each check consumes budget, even if no displacement is needed.

property post_displacement_local_region_gradient_factor: float

Multiplier on the SCF local-entry gradient threshold after a displacement.