qrunch.chemistry.qrackle.scf.stability_checkers.exact_hessian_stability_checker
Post-convergence orbital stability checker based on the exact orbital-Hessian response.
Classes
Follow the lowest real orbital-Hessian eigenvector off a converged saddle. |
|
Builder for the |
|
Options for post-convergence orbital-instability following with the exact orbital Hessian. |
- class ExactHessianStabilityChecker
Bases:
MetadataFromFields,Generic[TSCFMatrix,TSCFVector,TMatrix,TVector],StabilityCheckerProtocol[TSCFMatrix]Follow the lowest real orbital-Hessian eigenvector off a converged saddle.
- __init__(scf_matrix_module: SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], fock_builder: FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], options: ExactHessianStabilityCheckerOptions | None = None) None
Initialise the stability checker.
- Parameters:
scf_matrix_module (SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – SCF matrix module (restricted or unrestricted).
fock_builder (FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – Builder providing the exact HF or Kohn-Sham density response.
options (ExactHessianStabilityCheckerOptions | None) – Options for the checker. If None, default options are used.
- Return type:
None
- 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 along the lowest negative-curvature mode, if any.
Log detected instability or stability within the searched real-rotation subspace at essential level. Inconclusive searches warn instead of reporting stability.
- 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 rotation.
- Return type:
TSCFMatrix | None
- property maximum_number_of_checks: int
Maximum number of checks per SCF solve.
- property post_displacement_local_region_gradient_factor: float
Multiplier on the SCF local-entry gradient threshold after a displacement.
- class ExactHessianStabilityCheckerBuilder
Bases:
StabilityCheckerBuilderProtocolBuilder for the
ExactHessianStabilityChecker.- __init__(options: ExactHessianStabilityCheckerOptions | None = None) None
Initialise the checker builder.
- Parameters:
options (ExactHessianStabilityCheckerOptions | None) – Options for the checker. If None, default options are used.
- Return type:
None
- create_checker(scf_matrix_module: SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], fock_builder: FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) StabilityCheckerProtocol[TSCFMatrix]
Create an exact-Hessian stability checker.
- Parameters:
scf_matrix_module (SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – SCF matrix module (restricted or unrestricted).
fock_builder (FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – Builder providing the exact HF or Kohn-Sham density response.
- Return type:
StabilityCheckerProtocol[TSCFMatrix]
- class ExactHessianStabilityCheckerOptions
Bases:
DataclassPublicAPIOptions for post-convergence orbital-instability following with the exact orbital Hessian.
Following an instability can improve the energetic quality of a solution trapped at a saddle, but does not tighten the SCF convergence tolerance, increase numerical precision, or guarantee the lowest-energy solution. It adds potentially expensive exact-response Hessian analyses and further SCF iterations, which count against the SCF iteration budget.
The full occupied-virtual Hessian analysis covers real rotations within the selected spin treatment; restricted calculations remain restricted, and complex instabilities are not tested. Cost grows with the number of occupied-virtual pairs.
- Parameters:
maximum_number_of_checks – Maximum number of post-convergence orbital-instability checks and displacements per SCF solve. Each check consumes budget even if no displacement is needed. Budget exhaustion still permits ordinary gradient convergence but does not certify orbital stability. The default allows ten checks, run sequentially without retaining previous search subspaces.
eigenvalue_threshold – A Hessian eigenvalue strictly below the negative of this positive threshold triggers a displacement.
step_size – Frobenius norm of the orbital-rotation generator used to leave the converged saddle before continuing the SCF optimization.
post_displacement_local_region_gradient_factor – Multiplier for the SCF local-entry gradient threshold after an actual instability displacement. Smaller values delay local stepping in soft basins; one leaves the threshold unchanged and zero disables local entry after a displacement.
maximum_subspace_size – Maximum number of Davidson directions retained per stability search, at least two. Directions and responses are stored as compact occupied-virtual blocks; full matrices are only held for the batch being evaluated. The default cap is 100, not a required number of directions. SCF history is released before the search.
random_seed – Non-negative seed for reproducible inverse-gap random starts. Each retry uses fresh random directions.
maximum_number_of_search_retries – Maximum number of extra Davidson searches after an inconclusive stability search. Each retry starts from the requested Ritz vectors, each mixed with a fresh random direction, reusing the same converged density and preconditioner. The default allows ten retries after the initial search, without retaining previous subspaces; zero disables retries. An unconverged Ritz value below the negative threshold ends the search and is followed, because it bounds the lowest Hessian eigenvalue from above. Exhaustion without one logs a warning and does not certify stability.
- __init__(*, maximum_number_of_checks: int = 10, eigenvalue_threshold: float = 0.001, step_size: float = 0.5, post_displacement_local_region_gradient_factor: float = 0.001, maximum_subspace_size: int = 100, random_seed: int = 0, maximum_number_of_search_retries: int = 10) None
- Parameters:
maximum_number_of_checks (int)
eigenvalue_threshold (float)
step_size (float)
post_displacement_local_region_gradient_factor (float)
maximum_subspace_size (int)
random_seed (int)
maximum_number_of_search_retries (int)
- Return type:
None
- eigenvalue_threshold: float = 0.001
- maximum_number_of_checks: int = 10
- maximum_number_of_search_retries: int = 10
- maximum_subspace_size: int = 100
- post_displacement_local_region_gradient_factor: float = 0.001
- random_seed: int = 0
- step_size: float = 0.5