Helper Functions

Probably the most useful utility function is fill_defaults() which takes in a dictionary compatible with one of the *params() functions and recursively fills in the default values for non-mandatory functions.

The (incomplete) dictionaries may read from a JSON or YAML file. Creating these files with another programming language and then calling a short Julia script to read in and fit using these parameters is the expected way of interfacing with ACE1 from other languages.

params = load_dict("params.json")
# or 
params = load_dict("params.yaml")

Some of the ACE basis parameters dictionaries keys and values may be 2-tuples (specifically, the "multitransform" and "sparseM" degree specification) which are mainly represented as strings in JSON or YAML formats and may not be allowed in other languages used to write these dictionaries to file. The easiest way is to save tuples as "(1, C)" (different from string(tuple(1, "C"))) and use parse_ace_basis_keys() (also done within fill_defaults()) to parse that into (1, "C").


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").


db_params() returns only those parameters needed to construct the least-squares database.


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


  • 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.