NumericalAccuracyParameters¶
- class NumericalAccuracyParameters(density_mesh_cutoff=None, k_point_sampling=None, radial_step_size=None, density_cutoff=None, interaction_max_range=None, number_of_reciprocal_points=None, reciprocal_energy_cutoff=None, bands_per_electron=None, occupation_method=None, exx_grid_cutoff=None, exact_exchange_parameters=None, paw_grid_tolerance=None, compensation_charge_mesh_cutoff=None, grid_mesh_cutoff=None, electron_temperature=None)¶
Class for representing the parameters for setting the numerical accuracy of a calculation.
Some parameter defaults are specific for each calculator, see
HuckelCalculator
,SlaterKosterCalculator
,SemiEmpiricalCalculator
,LCAOCalculator
,PlaneWaveCalculator
,DeviceHuckelCalculator
,DeviceSlaterKosterCalculator
,DeviceSemiEmpiricalCalculator
, orDeviceLCAOCalculator
.- Parameters:
density_mesh_cutoff (PhysicalQuantity of type energy |
GridSampling
|OptimizedFFTGridSampling
) – The mesh cutoff to be used to determine the density grid sampling. The mesh cutoff must be a positive energy or aGridSampling
object. Default: Specific for each calculator.k_point_sampling (sequence (size 3) of int |
MonkhorstPackGrid
|KpointDensity
) – The k-point sampling in reciprocal space given either as a grid (specifying the three Monkhorst-Pack indices or aMonkhorstPackGrid
object), or a density (specifying aMonkhorstPackGrid
object). Default: Specific for each calculator.radial_step_size (PhysicalQuantity of type length) – The maximum sampling step size in all the radial grids. Must be positive. Default: Specific for each calculator.
density_cutoff (float) – The density cutoff determines the limit where a density is considered to to be zero. Smaller values therefore leads to longer ranges and less sparsity of the models. Must be positive. Default:
1.0e-6
interaction_max_range (PhysicalQuantity of type length) – The maximum allowed interaction distance between two orbitals. Default: Specific for each calculator.
number_of_reciprocal_points (int) – The number of reciprocal points used for evaluating two-center integrals. Must be larger than 1. Default:
1024
reciprocal_energy_cutoff (PhysicalQuantity of type energy) – The energy cutoff in reciprocal space used for evaluating of the two-center integrals. Must be positive. Default:
1250 * Hartree
bands_per_electron (float) – The number of bands per electron. The number must be 1.0 or larger. Only used by the
PlaneWaveCalculator
. Thebands_per_electron
determines how many bands are included in thePlaneWaveCalculator
scf loop for calculating the electron density. A value of 1.0 implies that only occupied states are included, which would only be correct at zero temperature. The default value of 1.2 means that if there are 10 electrons in a configuration there will be 5 occupied bands (assuming spin degeneracy) and one unoccupied band included in the calculation. In case of slow or non-converging calculations, increasing thebands_per_electron
can in some cases help convergence. ForBandstructure
calculations, the default number of bands included for aPlaneWaveCalculator
is also determined by thebands_per_electron
. Default:1.2
occupation_method (
FermiDirac
|GaussianSmearing
|MethfesselPaxton
|ColdSmearing
) – The method to calculate state occupations. Default: Specific for each calculator.exx_grid_cutoff (PhysicalQuantity |
GridSampling
|OptimizedFFTGridSampling
) – The energy cutoff/grid sampling that determines the grid size used for representing the the local exact exchange potential in plane-wave hybrid functional calculations. For lossless calculations the grid sizes should be twice that needed to represent the wave functions. However, one may use a smaller grid for faster calculations. Default: The same value as used for ‘density_mesh_cutoff’exact_exchange_parameters (
ExactExchangeParameters
) – The parameters that control the accuracy of exact exchange.paw_grid_tolerance (float) – When using the real space grid for PAW, this parameters determines below what value the radial functions are considered to be zero when gridded.
electron_temperature (PhysicalQuantity of type temperature) – The electron temperature used in determining the shape of the Fermi function. Must be positive. Deprecated: from v2016.1, use
occupation_method=FermiDirac(electron_temperature)
instead.
- bandsPerElectron()¶
- Returns:
The bands per electron.
- Return type:
float
- compensationChargeMeshCutoff()¶
- Returns:
The energy cutoff/grid sampling used for the compensation charge.
- Return type:
- densityCutoff()¶
- Returns:
The density cutoff.
- Return type:
float
- densityMeshCutoff()¶
- Returns:
The density mesh cutoff.
- Return type:
PhysicalQuantity of type energy |
GridSampling
- electronTemperature()¶
- Returns:
The electron temperature.
- Return type:
PhysicalQuantity of type energy
- exactExchangeParameters()¶
- Returns:
parameters for setting the numerical accuracy of an exact exchange calculation.
- Return type:
- exxGridCutoff()¶
- Returns:
The energy cutoff/grid sampling used for the exact exchange potential.
- Return type:
- gridMeshCutoff()¶
Deprecated: Use
densityMeshCutoff()
instead.- Returns:
The density mesh cutoff.
- Return type:
PhysicalQuantity of type energy |
GridSampling
- interactionMaxRange()¶
- Returns:
The interaction max range.
- Return type:
PhysicalQuantity of type length
- kPointSampling()¶
- Returns:
The k-point sampling.
- Return type:
- numberOfReciprocalPoints()¶
- Returns:
The number of reciprocal points used in two-center integration.
- Return type:
int
- occupationMethod()¶
- Returns:
The occupation method.
- Return type:
FermiDirac
|GaussianSmearing
|MethfesselPaxton
|ColdSmearing
- pawGridTolerance()¶
- Returns:
When using the real space grid for PAW, this parameters determines below what value the radial functions are considered to be zero when gridded.
- Return type:
float
- radialStepSize()¶
- Returns:
The radial grid sampling.
- Return type:
PhysicalQuantity of type length
- reciprocalEnergyCutoff()¶
- Returns:
The reciprocal cutoff energy.
- Return type:
PhysicalQuantity of type energy
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Define the k-point sampling and real space grid mesh-cutoff.
numerical_accuracy_parameters = NumericalAccuracyParameters(
density_mesh_cutoff=12.0*Hartree,
k_point_sampling=MonkhorstPackGrid(2, 1, 1),
electron_temperature = 200*Kelvin
)
calculator = HuckelCalculator(
iteration_control_parameters=iteration_control_parameters,
)
Specify the electron temperature in units of eV instead of Kelvin
numerical_accuracy_parameters = NumericalAccuracyParameters(
electron_temperature=0.02 * electronVolt/boltzmann_constant
)
Notes¶
The distance between the points in the real space grid, \(\Delta x\), is related to the
density_mesh_cutoff
, \(E^\mathrm{grid}\), through\[\Delta x = \frac{\pi \hbar}{\sqrt{2 m E^{grid}}}.\]In atomic units \(m = \hbar = 1\) , thus for energies in Hartree and distances in Bohr, \(\Delta x = \pi/\sqrt{2 E^\mathrm{grid}}\).
When setting
interaction_max_range
some matrix elements are set to zero. For very long ranged basis sets this can make the overlap matrix ill defined at certain k-points (i.e. it is not positive definite), in such cases the matrix diagonalization routine will give a segmentation fault. The cure is to change theinteraction_max_range
, i.e. either make it very large to include all long range elements, or make it small so no long range elements are included.