qmcblip.flare.quicksim module

Quickly run FLARE simulations.

class qmcblip.flare.quicksim.OTFSettings(*, theory: qmcblip.flare.quicksim.OTFSettings.Theory = FLARE(kernels=['twobody', 'threebody'], cutoffs=[5.0, 3.5], random=True, hyp_labels=['sig2', 'ls2', 'sig3', 'ls3', 'noise'], opt_algorithm='L-BFGS-B', n_cpu=1, update_style='add_n', update_threshold=None, gp_model=None, flare_calc=None), output_name: str = 'OTF', std_tolerance_factor: float = - 0.01, min_steps_with_model: int = 0, freeze_hyps: int = 10, write_model: int = 0, **extra_data: Any)[source]

Bases: pydantic.main.BaseModel

Dataclass containing FLARE(++) configuration.

class Theory(**extra_data: Any)[source]

Bases: pydantic.main.BaseModel

Abstract baseclass.

class FLARE(*, kernels: List[str] = ['twobody', 'threebody'], cutoffs: List[float] = [5.0, 3.5], random: bool = True, hyp_labels: List[str] = ['sig2', 'ls2', 'sig3', 'ls3', 'noise'], opt_algorithm: str = 'L-BFGS-B', n_cpu: int = 1, update_style: str = 'add_n', update_threshold: float = None, gp_model: Any = None, flare_calc: Any = None, **extra_data: Any)[source]

Bases: qmcblip.flare.quicksim.OTFSettings.Theory

FLARE dataclass.

kernels: List[str]

n-body functions to use.

Type

List[str], optional

cutoffs: List[float]

cutoff for the n-body functions.

Type

List[float], optional

random: bool

randomize hyperparameters.

Type

bool, optional

hyp_labels: List[str]

hyperparameter labels.

Type

List[str], optional

opt_algorithm: str

hyperparamter optimization algorithm.

Type

str, optional

n_cpu: int

amount of CPU cores to run FLARE on.

Type

int, optional

update_style: str

update algorithm for GP.

Type

str, optional

update_threshold: float

update threshold for GP, in eV/Ang.

Type

str, optional

gp_model: Any
flare_calc: Any
get_calc(atoms)[source]

Make a FLARE calculator object.

Parameters

atoms (Atoms) – atoms object.

Returns

FLARE calculator object.

Return type

FLARE_Calculator

class FLAREPP(*, update_style: str = 'threshold', update_threshold: float = 0.005, opt_algorithm: str = 'L-BFGS-B', max_iterations: int = 10, variance_type: str = 'local', sigma_e: float = 0.12, sigma_f: float = 0.115, sigma_s: float = 0.014, cutoff: float = 5.0, sigma: float = 2.0, power: int = 2, cutoff_function: str = 'quadratic', radial_basis: str = 'chebyshev', N: int = 12, lmax: int = 3, kernel: Any = None, descriptor_calculator: Any = None, gp_model: Any = None, flare_calc: Any = None, **extra_data: Any)[source]

Bases: qmcblip.flare.quicksim.OTFSettings.Theory

FLARE++ dataclass.

update_style: str

update algorithm for GP.

Type

str, optional

update_threshold: float

update threshold for GP, in eV/Ang.

Type

str, optional

opt_algorithm: str

hyperparamter optimization algorithm.

Type

str, optional

max_iterations: int

maximum number of hyperparameter optimization steps per MD step.

Type

int, optional

variance_type: str

uncertainty type on energy.

Type

str, optional

sigma_e: float

energy noise per atom, in kcal/mol.

Type

float, optional

sigma_f: float

force noise, in kcal/mol/Ang.

Type

float, optional

sigma_s: float

stress noise, in kcal/Ang^3.

Type

float, optional

cutoff: float

cutoff of kernel in Ang.

Type

float, optional

sigma: float

kernel thing in eV.

Type

float, optional

power: int

power of the kernel.

Type

int, optional

cutoff_function: str

cutoff function.

Type

str, optional

radial_basis: str

radial basis.

Type

str, optional

N: int

number of radial basis functions.

Type

int, optional

lmax: int

largest L included in spherical harmonics.

Type

int, optional

kernel: Any
descriptor_calculator: Any
gp_model: Any
flare_calc: Any
get_calc(atoms)[source]

Make a FLARE++ calculator object.

Parameters

atoms (Atoms) – atoms object.

Returns

FLARE++ calculator object.

Return type

SGP_Calculator

theory: qmcblip.flare.quicksim.OTFSettings.Theory

FLARE or FLAREPP.

Type

Theory

output_name: str

name of the files to write to.

Type

str, optional

std_tolerance_factor: float

standard tolerance with respect to noise. Negative for absolute (in eV/Ang).

Type

float, optional

min_steps_with_model: int

minimum steps with model in between ab-initio calls.

Type

int, optional

freeze_hyps: int

freeze hyperparameters after this many ab-initio calls.

Type

int, optional

write_model: int

keep at 0 for FLARE++.

Type

int, optional

qmcblip.flare.quicksim.quicksim(atoms, timestep, steps, calc, otfsettings=OTFSettings(theory=FLARE(kernels=['twobody', 'threebody'], cutoffs=[5.0, 3.5], random=True, hyp_labels=['sig2', 'ls2', 'sig3', 'ls3', 'noise'], opt_algorithm='L-BFGS-B', n_cpu=1, update_style='add_n', update_threshold=None, gp_model=None, flare_calc=None), output_name='OTF', std_tolerance_factor=- 0.01, min_steps_with_model=0, freeze_hyps=10, write_model=0), changes=[])[source]

A quick-to-setup simulation using FLARE or FLARE++.

This function allows the user to do a quick simulation using ab-initio calculations and FLARE(++), but at the cost of less flexibility.

Parameters
  • atoms (Atoms) – atoms object.

  • timestep (float) – timestep of MD in fs.

  • steps (int) – amount of MD steps.

  • otfsettings (OTFSettings, optional) – OTF settings object, using defaults if not given.

  • changes (optional) – array containing settings to update for CHAMP (advanced).