AlgorithmParameters¶
- class AlgorithmParameters(density_matrix_method=None, store_grids=None, store_basis_on_grid=None, store_energy_density_matrix=None, scf_restart_step_length=None, use_symmetries=None, reciprocal_space_paw_quantities=None)¶
Class for representing the parameters for setting solver parameters.
Some parameter defaults are specific for each calculator, see
HuckelCalculator
,SlaterKosterCalculator
,LCAOCalculator
, orPlaneWaveCalculator
.- Parameters:
density_matrix_method (
DiagonalizationSolver
|FeastSolver
|ChebyshevExpansionSolver
|PEXSISolver
|PlaneWaveResidualMinimizer
|GeneralizedDavidsonSolver
|PPCGSolver
) – The method used for obtaining the density matrix. Default:PPCGSolver
forPlaneWaveCalculator
.DiagonalizationSolver
for the other calculators.store_grids (bool) – Enable or disable the storage of grids that can be reused in the SCF process. True will increase the memory usage, but reduce the computation time. Default:
True
store_basis_on_grid (
Automatic
|True
|False
) – Control the storage of the basis functions on a real space grid. When enabled, increases the memory usage but reduces the computation time. Default:Automatic
store_energy_density_matrix (bool |
Automatic
) – Enable or disable the computation and storage of the energy density matrix while the density matrix is calculated. When enabled, can slow down the SCF loop but speeds up subsequent evaluations of forces and/or stress. Default: Disabled unless forces and/or stress will be evaluated immediately after the self-consistent calculation (Automatic
).scf_restart_step_length (PhysicalQuantity of type length) – The maximum distance by which an atom can move so that the calculation can be restarted from the previous initial state. Default:
0.1 * Ang
use_symmetries (
Automatic
|True
|False
) – Whether the symmetries of the configuration should be used to reduce the number of k-points. If set toAutomatic
the symmetries are disabled for a single k-point and enabled for multiple k-points. Default:True
reciprocal_space_paw_quantities (bool) – If this flag is set to true, the paw quantities will be calculated in reciprocal space, this can only be done when we use periodic boundary conditions. Default:
True
- densityMatrixMethod()¶
- Returns:
The advanced solver.
- Return type:
DiagonalizationSolver
|FeastSolver
|ChebyshevExpansionSolver
|PEXSISolver
|PlaneWaveResidualMinimizer
|GeneralizedDavidsonSolver
|PPCGSolver
- static enableSymmetries(is_paw, spin_type)¶
Plane-wave PAW spin-orbit does not yet support the use of symmetries. Enable or disable the option.
- WARNING: This emulate the behavior of PlaneWaveCalculator._useSymmetries()
Thus this should change if that change.
- Parameters:
is_paw (bool) – True, the PlaneWave-PAW is used.
spin_type (enum) – The spin type.
- Returns:
Truem the use symmetries.
- Return type:
bool
- static noSCFDensityMatrixMethod()¶
- Returns:
The solver to use for LCAO when no SCF iterations are done.
- Return type:
- scfRestartStepLength()¶
- Returns:
The SCF restart step length of this calculator.
- Return type:
PhysicalQuantity of type length
- storeBasisOnGrid()¶
- Returns:
True if the storage of the basis functions on a real space grids is enabled
- Return type:
bool
- storeEnergyDensityMatrix()¶
- Returns:
True if the simultaneous computation and storage of the energy density matrix during the calculation of the density matrix is enabled.
- Return type:
bool |
Automatic
- storeGrids()¶
- Returns:
True if the storage of grids is enabled
- Return type:
bool
- uniqueString()¶
Return a unique string representing the state of the object.
- useSymmetries()¶
- Returns:
Whether the symmetries of the configuration should be used to reduce the number of k-points.
- Return type:
bool
Usage Examples¶
Setup a calculation that uses the Diagonalization Solver.
density_matrix_method = DiagonalizationSolver()
algorithm_parameters = AlgorithmParameters(density_matrix_method)
calculator = LCAOCalculator(algorithm_parameters=algorithm_parameters)
Setup a calculation that uses the Feast Solver.
density_matrix_method = FeastSolver(lambda_min=-10*Hartree, lambda_max=10*Hartree, number_of_eigenvalues=10)
algorithm_parameters = AlgorithmParameters(density_matrix_method)
calculator = LCAOCalculator(algorithm_parameters=algorithm_parameters)