4.7.1.3. SCC-DFTB repulsive potential¶
The DFTBSplineRepulsivePotentialParameters
class provides an interface to
reading and writing the two-body repulsive potential contained in the SCC-DFTB
Slater-Koster parameter files. An analytical form
of the repulsive function is represented, for example, by a
TaperedDoubleExponential
instance, or any other instance inheriting from
RepulsiveFunction
.
Note
Some DFTB parameter sets (e.g., QUASINANO2015) in the Amsterdam Modeling Suite are encrypted. The encrypted parameters cannot be reparameterized with ParAMS.
See also
Tutorial: DFTB repulsive potential
To use this interface, the Slater-Koster files must already contain the
electronic parameters, as well as some repulsive function represented by cubic
splines. When writing a parameter set, the
DFTBSplineRepulsivePotentialParameters
instance will write out all
Slater-Koster files, keeping the electronic parts but overwriting the repulsive
potentials.
The names of parameters are of the form Element1-Element2:p0
, e.g.,
O-Zn:p0
is the first parameter of the analytical repulsive function written
as splines to O-Zn.skf
, O-Zn:p1
is the second parameter, etc. For a
TaperedDoubleExponential
, there are four parameters per element pair.
Note: The element names must be sorted alphabetically. The function
defined for the element pair O-Zn
will also be written to Zn-O.skf
. The
parameters Zn-O:p0
etc. are ignored.
Slater-Koster files that have no active parameters associated with them will be copied, i.e., the original repulsive potential is used.
Example:
# Make an interface to the SCC-DFTB repulsive potential parametrization.
interface = DFTBSplineRepulsivePotentialParameters(
folder='/amshome/atomicdata/DFTB/DFTB.org/znorg-0-1', # use electronic parameters from znorg-0-1
repulsive_function=TaperedDoubleExponential(cutoff=5.67), #repulsive potential defined by four parameters
r_range=np.arange(0., 5.87, 0.1), # distances (in bohr) for which to center the cubic splines
other_settings=dftb_s # Settings object defining e.g. k-point sampling
)
# Refit only the O-Zn and Zn-O repulsive potential parameters
# All other repulsive potentials from znorg-0-1 (e.g. as defined in C-C.skf)
# will be kept in their original form
for p in interface:
p.is_active = p.name.startswith('O-Zn')
4.7.1.3.1. DFTBSplineRepulsivePotentialParameters API¶
-
class
DFTBSplineRepulsivePotentialParameters
(folder, repulsive_function, r_range, other_settings=None)¶ Interface to the parameterization of the SCC-DFTB two-body repulsive potential in the AMS DFTB engine.
-
__init__
(folder, repulsive_function, r_range, other_settings=None)¶ Create a new instance based on the parameterization in folder.
Parameters:
- folder : str
- The folder from which the original .skf files are read. They must include Spline repulsive potentials. The electronic parts of the .skf files will be copied to the new (reparametrized) .skf files. The repulsive potential part will be overwritten. Note: The repulsive function to be parametrized is not initialized from the .skf files.
- repulsive_function: RepulsiveFunction (e.g. TaperedDoubleExponential)
- An analytical repulsive function containing parmeters to be optimized.
- r_range : list of floats corresponding to distances for which to write cubic splines
- The unit must be bohr
- other_settings : Settings
- A settings instance with other settings to be used for the engine.
Should start at normal root level of Settings instances used with
the AMS driver, i.e. DFTB engine input should be in
other_settings.input.dftb
.
-
yaml_store
(*args, **kwargs)¶ Overrides the base class method to do nothing. This parameter interface cannot be written to YAML.
-
_get_spline_string_list
(repulsive_function, params, r_range)¶ return a list of strings that can be written as the Spline repulsive potential in a .skf file
-
write
(folder, parameters=None)¶ Writes the current parameterization to disk.
If folder does not exist, it will be created. If folder exists the files in it will be overwritten if necessary.
-
4.7.1.3.2. TaperedDoubleExponential API¶
-
class
TaperedDoubleExponential
(cutoff=7.0)¶ Tapered double exponential function of the form
0.5*[cos(pi*r/cutoff)+1]*[A*exp(-B*r)+C*exp(-D*r)]
where A, B, C, D are the parameters.
-
__init__
(cutoff=7.0)¶ Initialize self. See help(type(self)) for accurate signature.
-
__call__
(x, params)¶ x : a numpy array containing the values for which to evaluate the function params : a list or 1D numpy array with self.npar (=4) elements
Returns a numpy array with the same shape as
x
containing the function value for each evaluated point
-