All ACE1pack functions

ACE1pack.PolyTransform_paramsMethod

PolyTransform_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct ACE1.Transforms.PolyTransform. All parameters are passed as keyword argument. Also see?PolyTransform`

Implements the distance transform

\[ x(r) = \Big(\frac{1 + r_0}{1 + r}\Big)^p\]

Parameters

  • p = 2
  • r0 = 2.5
source
ACE1pack.ace_basis_paramsMethod

ace_basis_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct an ACE basis (RPIBasis). All parameters are passed as keyword argument. If no default is given then the argument is required.

Parameters

  • species : single species or list of species (mandatory)
  • N : correlation order, positive integer (mandatory)
  • maxdeg : maximum degree, positive real number (note the precise notion of degree is specified by further parameters) (mandatory)
  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • radial = radial_basis_params(; r0 = r0) : one-particle basis parameters; cf ?radial_basis_params for details
  • transform = transform_params(; r0 = r0) : distance transform parameters; cf ?transform_params() for details
  • degree = degree_params() : class of sparse polynomial degree to select the basis; see ?degree_params for details
source
ACE1pack.ard_paramsMethod

ard_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a scikit-learn Automatic Relevance Detemrination solver. All parameters are passed as keyword argument.

Parameters

  • ard_n_iter = 300
  • ard_tol = 1e-3
  • ard_threshold_lambda = 1e4
source
ACE1pack.basis_paramsMethod

basis_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct one of the basis. All parameters are passed as keyword argument and the kind of parameters required depend on "type".

ACE (RPI) basis

Returns a dictionary containing the complete set of parameters required to construct an ACE basis (RPIBasis). All parameters are passed as keyword argument. If no default is given then the argument is required.

Parameters

  • type = "ace"
  • species : single species or list of species (mandatory)
  • N : correlation order, positive integer (mandatory)
  • maxdeg : maximum degree, positive real number (note the precise

notion of degree is specified by further parameters) (mandatory)

  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • radial = radial_basis_params(; r0 = r0) : one-particle basis

parameters; cf ?basis_params of type "radial" for details

  • transform = transform_params(; r0 = r0) : distance transform

parameters; cf ?transform_params() for details

  • degree = degree_params() : class of sparse polynomial degree

to select the basis; see ?degree_params for details

Pair basis

Returns a dictionary containing the complete set of parameters required to construct an pair basis (PolyPairBasis). All parameters are passed as keyword argument.

Parameters

  • type = "pair"
  • species : single species or list of species (mandatory)
  • maxdeg : maximum degree, positive real number (note the precise

notion of degree is specified by further parameters) (mandatory)

  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • rcut = 5.0: outer cutoff, Å
  • rin = 0.0: inner cutoff, Å
  • pcut = 2: outer cutoff parameter; * pcut=2: function and first derivative go to zero at the outer cutoff * pcut=1: function forced to go through zero at the outer cutoff * pcut=0: no constraint at the outer cutoff
  • pin = 0: inner cutoff parameter * pin=2: function and first derivative go to zero at the inner cutoff * pin=1: function forced to go through zero at the inner cutoff * pin=0: no constraint at the inner cutoff
  • transform = transform_params(; r0 = r0) : distance transform

parameters; cf ?transform_params() for details

Radial basis of ACE

Returns a dictionary containing the complete set of parameters required to construct radial basis for ACE. All parameters are passed as keyword argument.

Parameters

  • type = "radial"
  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • rcut = 5.0: outer cutoff, Å
  • rin = 0.5 * r0: inner cutoff, Å
  • pcut = 2: outer cutoff parameter; * pcut=2: function and first derivative go to zero at the outer cutoff * pcut=1: function forced to go through zero at the outer cutoff * pcut=0: no constraint at the outer cutoff
  • pin = 2: inner cutoff parameter * pin=2: function and first derivative go to zero at the inner cutoff * pin=1: function forced to go through zero at the inner cutoff * pin=0: no constraint at the inner cutoff
source
ACE1pack.brr_paramsMethod

brr_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a scikit-learn Bayesian ridge regression solver. All parameters are passed as keyword argument.

Parameters

  • n_iter = 300
  • tol = 1e-3
source
ACE1pack.data_paramsMethod

data_params(; kwargs...)` : returns a dictionary containing the complete set of parameters required to read data from an .xyz file. j All parameters are passed as keyword arguments.

Parameters

  • fname : a "*.xyz" file with atomistic data (mandatory).
  • energy_key = "dft_energy : ASE's Atoms.info key to read energy

for fitting.

  • force_key = "dft_force : ASE's Atoms.arrays key to read forces

for fitting.

  • virial_key = "dft_virial : ASE's Atoms.info key to read virial

for fitting.

source
ACE1pack.db_paramsMethod

db_params(; kwargs...)` : returns a dictionary containing all of the parameters needed for making a LsqDB. All parameters are passed as keyword argumts.

Parameters

  • data : data parameters, see ?data_params for details (mandatory)

  • basis : dictionary containing dictionaries that specify the basis used in fitting. For example

    julia basis = Dict( "pair_short" => Dict( "type" => "pair", ...), "pair_long" => Dict("type" => "pair", ...), "manybody" => Dict("type" => "ace", ...), "nospecies" => Dict("type" => "ace", species = ["X",], ...)

keys of basis are ignored, so that multiple basis with different specifications (e.g. smaller and larger cutoffs) can be combined. See ?basis_params for more detail.

  • LSQ_DB_fname_stem = "" : stem to save LsqDB to. Doesn't get saved if set to an empty string (""). If LSQ_DB_fname_stem * "_kron.h5" file is not present it gets renamed, a new LsqDB is constructed and saved.
source
ACE1pack.degree_paramsMethod

degree_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a specification for polynomial degree. All parameters are passed as keyword argument and the kind of parameters required depend on "type".

SparsePSHDegree

Returns a dictionary containing the complete set of parameters required to construct ACE1.RPI.SparsePSHDegree. See ?SparsePSHDegree.

Parameters

  • type = "sparse"
  • wL = 1.5
  • csp = 1.0
  • chc = 0.0
  • chc = 0.0
  • ahc = 0.0
  • bhc = 0.0
  • p = 1.0

##SparsePSHDegreeM Returns a dictionary containing the complete set of parameters required to construct ACE1.RPI.SparsePSHDegree. Also see ?SparsePSHDegreeM.

NB maxdeg of ACE basis (RPIBasis) has to be set to 1.0.

Parameters

  • Dd : Dictionary specifying max degrees (mandatory)
  • Dn = Dict("default" => 1.0) : Dictionary specifying weights for degree

of radial basis functions (n)

  • Dl = Dict("default" => 1.5) : Dictionary specifying weights for degree

of angular basis functions (l)

Each dictionary should have a "default" entry. In addition, different degrees or weights can be specified for each correlation order and/or correlation order-species combination. For example

"Dd" => Dict(
      "default" => 10,
      3 => 9,
      (4, "C") => 8,
      (4, "H") => 0)

in combination with N=4 and maxdeg=1.0, will set maximum polyonmial degree on N=1 and N=2 functions to 10, to 9 for N=3 functions and will only allow N=4 basis functions on carbon atoms, up to polynomial degree 8.

source
ACE1pack.fill_defaultsMethod

fill_defaults(params::Dict; param_key = "fit_params") -> params

Recursively updates any missing entries with default parameters. Accepted param_key values and corresponding functions:

    "fit_params" => ACE1pack.fit_params,
    "data" => ACE1pack.data_params,
    "solver" => ACE1pack.solver_params,
    "basis" => ACE1pack.basis_params,
    "ace" => ACE1pack.ace_basis_params,  
    "pair" => ACE1pack.pair_basis_params,
    "radial" => ACE1pack.radial_basis_params,
    "transform" => ACE1pack.transform_params, 
    "degree" => ACE1pack.degree_params,
    "P" => ACE1pack.regularizer_params
source
ACE1pack.fit_aceFunction

fit_ace(params::Dict) -> IP, lsqinfo

Function to set up and fit the least-squares problem of "atoms' positions" -> "energy, forces, virials". Takes in a dictionary with all the parameters. See ?fit_params for details.

source
ACE1pack.fit_paramsMethod

fit_params(; kwargs...)

Returns a dictionary containing all of the parameters needed to make an ACE potential. All parameters are passed as keyword argumts.

Parameters

  • data : data parameters, see ?data_params for details (mandatory)
  • basis : dictionary containing dictionaries that specify the basis used in fitting. For example
basis = Dict(
    "pair_short" => Dict( "type" => "pair", ...), 
    "pair_long" => Dict("type" => "pair", ...), 
    "manybody" => Dict("type" => "ace", ...), 
    "nospecies" => Dict("type" => "ace", species = ["X",], ...)

keys of basis are ignored, so that multiple basis with different specifications (e.g. smaller and larger cutoffs) can be combined. See ?basis_params for more detail.

  • solver : dictionary containing parameters that specify the solver for least squares problem (mandatory). See ?solver_params.
  • e0 : Dict{String, Float} containing reference values for isolated atoms' energies (mandatory).
  • weights : dictionary of Dict("config_type" => Dict("E" => Float, "F => Float))entries specifying fitting weights. "default" is set to1.0` for all of "E", "F", and "V" weights.
  • P : regularizer parameters (optional), see ?regularizer_params.
  • ACE_fname = "ACE_fit.json" : filename to save ACE to. Potential & info do not get saved if ACE_fname isnothing() or is set to "". Files already parseentry are renamed and not overwritten.
  • LSQ_DB_fname_stem = "" : stem to save LsqDB to. Doesn't get saved if set to an empty string (""). If the file is already present, but fit_from_LSQ_DB is set to false, the old database is renamed, a new one constructed and saved under the given name.
  • fit_from_LSQ_DB = false: whether to fit from a least squares database specified with LSQ_DB_fname_stem. If LSQ_DB_fname_stem * "_kron.h5" file is not present, LsqDB is constructed from scratch and saved.
source
ACE1pack.laplacian_regularizer_paramsMethod

laplacian_regularizer_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a laplacian regularizer. All parameters are passed as keyword argument.

Parameters

  • rlap_scal = 3.0
source
ACE1pack.lsqr_paramsMethod

lsqr_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a lsqr solver. All parameters are passed as keyword argument.

Parameters

  • damp = 5e-3
  • atol = 1e-6
  • colim = 1e8
  • maxiter = 1e5
  • verbose = false
source
ACE1pack.make_ace_dbMethod

make_ace_db(params::Dict) -> LsqDB

Makes a LsqDB from given parameters' dictionary. For params see ?db_params; parameters from fit_params also work, except unnecessary entries will be ignored. Returns IPFitting.LsqDB

source
ACE1pack.multitransform_paramsMethod

multitransform_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct ACE.Transform.multitransform. All parameters are passed as keyword argument.

Parameters

  • transforms : dictionary specifying transforms for each species pair. Can be

given per-pair (i.e. only for ("element1", "element2") and not for ("element2", "element1")) or can be different for ("element1", "element2") and ("element2", "element1"). For example

transforms = Dict(
      ("C", "C") => Dict("type"=> "polynomial"),
      ("C", "H") => Dict("type"=> "polynomial"),
      ("H", "H") => Dict("type" => "polynomial"))
  • rin, rcut: values for inner and outer cutoffs, alternative to cutoffs
  • cutoffs : dictionary specifying inner and outer cutoffs for each element pair

(either symmetrically or non-symmetrically). Alternative to rin & rcut. For example

cutoffs => Dict(
      ("C", "C") => (1.1, 4.5),
      ("C", "H") => (0.9, 4.5),
      ("H", "H") => (1.23, 4.5)),
source
ACE1pack.pair_basis_paramsMethod

pair_basis_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct an pair basis (PolyPairBasis). All parameters are passed as keyword argument.

Parameters

  • species : single species or list of species (mandatory)
  • maxdeg : maximum degree, positive real number (note the precise notion of degree

is specified by further parameters) (mandatory)

  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • rcut = 5.0: outer cutoff, Å
  • rin = 0.0: inner cutoff, Å
  • pcut = 2: outer cutoff parameter; * pcut=2: function and first derivative go to zero at the outer cutoff * pcut=1: function forced to go through zero at the outer cutoff * pcut=0: no constraint at the outer cutoff
  • pin = 0: inner cutoff parameter * pin=2: function and first derivative go to zero at the inner cutoff * pin=1: function forced to go through zero at the inner cutoff * pin=0: no constraint at the inner cutoff
  • transform = transform_params(; r0 = r0) : distance transform parameters;

cf ?transform_params() for details

source
ACE1pack.parse_ace_basis_keysMethod

parse_ace_basis_keys(ace_basis::Dict) -> ace_basis

("C", "C")-type tuples are saved to and read back in from JSON as "("C", "C")" .json. It's slightly easier to save these to JSON or YAM as "(C, C)". This function converts "(C, C)"-type strings back to parameter-friendly ("C", "C").

source
ACE1pack.qr_paramsMethod

qr_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a qr solver. All parameters are passed as keyword argument.

source
ACE1pack.radial_basis_paramsMethod

radial_basis_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct radial basis for ACE. All parameters are passed as keyword argument.

Parameters

  • r0 = 2.5 : rough estimate for nearest neighbour distance
  • rcut = 5.0: outer cutoff, Å
  • rin = 0.5 * r0: inner cutoff, Å
  • pcut = 2: outer cutoff parameter; * pcut=2: function and first derivative go to zero at the outer cutoff * pcut=1: function forced to go through zero at the outer cutoff * pcut=0: no constraint at the outer cutoff
  • pin = 2: inner cutoff parameter * pin=2: function and first derivative go to zero at the inner cutoff * pin=1: function forced to go through zero at the inner cutoff * pin=0: no constraint at the inner cutoff
source
ACE1pack.regularizer_paramsMethod

regularizer_params(; type = "laplacian", kwargs...) : returns a dictionary containing the complete set of parameters required to construct one of the solvers. All parameters are passed as keyword argument and the kind of parameters required depend on "type".

LSQR Parameters (default)

  • type = "laplacian"
  • rlap_scal = 3.0
source
ACE1pack.rrqr_paramsMethod

rrqr_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct a rrqr solver. All parameters are passed as keyword argument.

Parameters

  • rtol = 1e-5
source
ACE1pack.save_fitMethod

save_fit(fname, IP, lsqinfo)

Saves Dict("IP" => IP, "info" => lsqinfo) to fname. If fname is already present, it is renamed and dictionary saved to fname.

source
ACE1pack.solver_paramsMethod

solver_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct one of the solvers. All parameters are passed as keyword argument and the kind of parameters required depend on "type".

QR Parameters

  • 'type = "qr"`

LSQR Parameters

  • type = "lsqr"
  • damp = 5e-3
  • atol = 1e-6
  • colim = 1e8
  • maxiter = 1e5
  • verbose = false

RRQR Parameters

  • type = "rrqr"
  • rtol = 1e-5

BBR

  • type = "bbr"
  • n_iter = 300
  • tol = 1e-3

ARD

  • type = "ard"
  • n_iter = 300
  • tol = 1e-3
  • threshold_lambda = 1e4
source
ACE1pack.sparse_degree_M_paramsMethod

sparse_degree_M_params(;kwargs...): Returns a dictionary containing the complete set of parameters required to construct ACE1.RPI.SparsePSHDegree. Also see ?SparsePSHDegreeM.

NB maxdeg of ACE basis (RPIBasis) has to be set to 1.0.

Parameters

  • Dd : Dictionary specifying max degrees (mandatory)
  • Dn = Dict("default" => 1.0) : Dictionary specifying weights for degree

of radial basis functions (n)

  • Dl = Dict("default" => 1.5) : Dictionary specifying weights for degree

of angular basis functions (l)

Each dictionary should have a "default" entry. In addition, different degrees or weights can be specified for each correlation order and/or correlation order-species combination. For example

"Dd" => Dict(
      "default" => 10,
      3 => 9,
      (4, "C") => 8,
      (4, "H") => 0)

in combination with N=4 and maxdeg=1.0, will set maximum polyonmial degree on N=1 and N=2 functions to 10, to 9 for N=3 functions and will only allow N=4 basis functions on carbon atoms, up to polynomial degree 8.

source
ACE1pack.sparse_degree_paramsMethod

sparse_degree_params(; kwargs...): returns a dictionary containing the complete set of parameters required to construct ACE1.RPI.SparsePSHDegree. See ?SparsePSHDegree.

Parameters

  • wL = 1.5
  • csp = 1.0
  • chc = 0.0
  • chc = 0.0
  • ahc = 0.0
  • bhc = 0.0
  • p = 1.0

NB p = 1 is current ignored, but we put it in so we can experiment later with p = 2, p = inf.

source
ACE1pack.transform_paramsMethod

transform_params(; kwargs...) : returns a dictionary containing the complete set of parameters required to construct one of the transforms. All parameters are passed as keyword argument and the kind of parameters required depend on "type".

Polynomial transform

Returns a dictionary containing the complete set of parameters required to construct ACE1.Transforms.PolyTransform. All parameters are passed as keyword argument. Also see?PolyTransform`

Implements the distance transform

\[ x(r) = \Big(\frac{1 + r_0}{1 + r}\Big)^p\]

Parameters

  • type = "polynomial"
  • p = 2
  • r0 = 2.5

Multitransform

Returns a dictionary containing the complete set of parameters required to construct ACE.Transform.multitransform. All parameters are passed as keyword argument.

Parameters

  • transforms : dictionary specifying transforms for each species pair. Can be

given per-pair (i.e. only for ("element1", "element2") and not for ("element2", "element1")) or can be different for ("element1", "element2") and ("element2", "element1"). For example

transforms = Dict(
      ("C", "C") => Dict("type"=> "polynomial"),
      ("C", "H") => Dict("type"=> "polynomial"),
      ("H", "H") => Dict("type" => "polynomial"))
  • rin, rcut: values for inner and outer cutoffs, alternative to cutoffs
  • cutoffs : dictionary specifying inner and outer cutoffs for each element pair

(either symmetrically or non-symmetrically). Alternative to rin & rcut. For example

cutoffs => Dict(
      ("C", "C") => (1.1, 4.5),
      ("C", "H") => (0.9, 4.5),
      ("H", "H") => (1.23, 4.5)),

identity

IdTransform_params(;) : returns Dict("type" => "identity"), needed to construct ACE1.Transforms.IdTransform.

source