qrunch.chemistry.qrackle.scf.steppers.damped
A damped Roothaan-Hall SCF stepper.
At each step, the current Fock matrix is solved using a Lowdin orthogonalizer \(S^{-1/2}\). The occupied molecular orbitals give a trial density, which is mixed with the current density to moderate the SCF update:
Here \(\lambda\) is the damping factor: a value of one retains the current density, while smaller values give more weight to the trial density.
Classes
Options for the Damped SCF stepper. |
|
Can create a new density matrix based on a Damped Roothaan-Hall step. |
|
Wrapper for the DampedSCFStepper to provide a default damping factor. |
- class DampedSCFOptions
Bases:
DataclassPublicAPIOptions for the Damped SCF stepper.
- Parameters:
damping_factor – Damping factor for the new density matrix.
- __init__(*, damping_factor: float = 0.25) None
- Parameters:
damping_factor (float)
- Return type:
None
- damping_factor: float = 0.25
- class DampedSCFStepper
Bases:
SCFStepperProtocol[TSCFMatrix,TSCFVector,TMatrix,TVector]Can create a new density matrix based on a Damped Roothaan-Hall step.
- __init__(scf_matrix_module: SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], options: DampedSCFOptions) None
Initialise the Damped SCF stepper.
Creates a new density matrix by solving the Roothaan-Hall equation for the current Fock matrix and then damping the result with the current density matrix:
\[\mathrm{damped\_density} = (1 - \mathrm{damping\_factor}) \mathrm{new\_density} + \mathrm{damping\_factor} \mathrm{current\_density}\]- Parameters:
scf_matrix_module (SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – SCF matrix module (restricted or unrestricted).
options (DampedSCFOptions) – Options for the Damped SCF stepper.
- Return type:
None
- property can_update_scf_queue: bool
Damped stepping does not add extra Fock/density pairs to the SCF queue.
- create_new_density(scf_queue: SCFQueueProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], current_density: TSCFMatrix, current_fock: TSCFMatrix, core_hamiltonian: TSCFMatrix, overlap_matrix: TSCFMatrix, lowdin_orthogonalizer: TSCFMatrix, molecular_configuration: MolecularConfiguration, roothaan_hall_solver: RoothaanHallSolver[TSCFMatrix, TSCFVector, TMatrix, TVector], orbital_occupation: OrbitalOccupation) TSCFMatrix
Solve the Roothaan-Hall equation for the given Fock matrix.
- Parameters:
scf_queue (SCFQueueProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]) – The SCF queue containing Fock matrices and their associated error matrices.
current_density (TSCFMatrix) – The current density matrix.
current_fock (TSCFMatrix) – The current Fock (or Kohn-Sham) matrix.
core_hamiltonian (TSCFMatrix) – The core Hamiltonian \(h = T + V_{\mathrm{nuc}}\).
overlap_matrix (TSCFMatrix) – The overlap matrix \(S\).
lowdin_orthogonalizer (TSCFMatrix) – The Lowdin orthogonalizer \(S^{-1/2}\).
molecular_configuration (MolecularConfiguration) – The molecular configuration.
roothaan_hall_solver (RoothaanHallSolver[TSCFMatrix, TSCFVector, TMatrix, TVector]) – A solver to solve the Roothaan-Hall equation for the selected Fock matrix.
orbital_occupation (OrbitalOccupation) – Electron occupation specifying how many orbitals are occupied.
- Return type:
TSCFMatrix
- free() None
Free any retained matrices.
- Return type:
None
- init_scf_queue(max_length: int) SCFQueueProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]
Create a SCF queue.
- Parameters:
max_length (int)
- Return type:
SCFQueueProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector]
- property is_local_region_indicated: bool
Indicate the local region when the SCF gradient is sufficiently small.
- property options: DampedSCFOptions
Options used by the Damped SCF stepper.
- reset() None
Reset the internal state of the SCF stepper.
- Return type:
None
- class DampedSCFStepperBuilder
Bases:
SCFStepperBuilderProtocolWrapper for the DampedSCFStepper to provide a default damping factor.
- __init__(options: DampedSCFOptions | None = None) None
Initialise the Damped SCF stepper wrapper.
- Parameters:
options (DampedSCFOptions | None) – Options for the Damped SCF stepper. If None, default options are used.
- Return type:
None
- create_stepper(scf_matrix_module: SCFMatrixModuleProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], fock_builder: FockBuilderProtocol[TSCFMatrix, TSCFVector, TMatrix, TVector], fallback_scf_stepper_builder: SCFStepperBuilderProtocol | None = None) DampedSCFStepper[TSCFMatrix, TSCFVector, TMatrix, TVector]
Create a new DampedSCFStepper with the specified damping factor.
- 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.
fallback_scf_stepper_builder (SCFStepperBuilderProtocol | None) – Optional fallback SCF stepper builder. Not used in this implementation.
- Return type:
DampedSCFStepper[TSCFMatrix, TSCFVector, TMatrix, TVector]