Calc Manager
CalcManager
- class mlacs.calc.CalcManager(calc, magmoms=None, folder='Calc', **kwargs)
Parent Class managing the true potential being simulated. This Calc class can support any
ase.calculatorcalculators from the ASE python package. Create, execute and read the output of any ASE supported calculators.- Parameters:
calc (
ase.calculator) – An ASE calculator objectmagmoms (
np.ndarray(optional)) – An array for the initial magnetic moments for each computation IfNone, no initial magnetization. (Non magnetic calculation) DefaultNone.folder (
str(optional)) – The root for the directory in which the computation are to be done Default ‘Calc’
- compute_true_potential(confs, subfolder=None, step=None)
Compute the energy/forces/stress of given input configurations with an ASE calculator.
- Parameters:
confs (
listofase.Atoms) – The input list of atom objects.subfolder (
listofstr(optional)) – Subfolder in which the properties are saved.step (
listofint(optional)) – The list of configuration indices.
- Returns:
result_confs – The output list of atom objects, with corresponding SinglePointCalculator resulting from true potential calculation.
- Return type:
listofase.Atoms
AbinitManager
- class mlacs.calc.AbinitManager(parameters, pseudos, abinit_cmd='abinit', mpi_runner='mpirun', magmoms=None, folder='DFT', logfile='abinit.log', errfile='abinit.err', nproc=1, nproc_per_task=None, **kwargs)
This Calc class is an extended object for Abinit calculators. The AbinitManager can handdle netCDF files, MPI processes and a better pseudopotentials files management.
- Parameters:
parameters (
dict) – Dictionnary of abinit inputpseudos (
dict) – Dictionnary for the pseudopotentials {‘O’: /path/to/pseudo}abinit_cmd (
str) – The command to execute the abinit binary.mpi_runner (
str) – The command to call MPI. I assume the number of processor is specified using -n argument Defaultmpirunmagmoms (
np.ndarray(optional)) – An array for the initial magnetic moments for each computation IfNone, no initial magnetization. (Non magnetic calculation) DefaultNone.folder (
str(optional)) – The root for the directory in which the computation are to be done Default ‘DFT’logfile (
str(optional)) – The name of the Abinit log file inside the workdir folder Default ‘abinit.log’errfile (
str(optional)) – The name of the Abinit error file inside the workdir folder Default ‘abinit.err’nproc (
int(optional)) – Number of processor available for all Abinit.nproc_per_task (
int(optional)) – Number of processor available for all Abinit. Default nproc
Examples
>>> from mlacs.calc import AbinitManager >>> variables = dict(ixc=-1012, ecut=12, tsmear=0.001, occopt=3, nband=82, >>> ngkpt=[2, 2, 2], shiftk=[0.5, 0.5, 0.5], >>> autoparall=1, nsym=1) # Cu, 8 atoms. >>> pseudos = {'Cu': "/path/to/pseudo/Cu.LDA_PW-JTH.xml"} >>> calc = AbinitManager(parameters=variables, pseudos=pseudos)
- compute_true_potential(*args, **kwargs)
Compute the energy/forces/stress of given input configurations with an ASE calculator.
- Parameters:
confs (
listofase.Atoms) – The input list of atom objects.subfolder (
listofstr(optional)) – Subfolder in which the properties are saved.step (
listofint(optional)) – The list of configuration indices.
- Returns:
result_confs – The output list of atom objects, with corresponding SinglePointCalculator resulting from true potential calculation.
- Return type:
listofase.Atoms
DlmCalcManager
- class mlacs.calc.DlmCalcManager(calc, unitcell, supercell, magnetic_sites, mu_b=1.0, cutoffs=[6.0, 4.0], n_steps=3000, **kwargs)
Class for Disorder Local Moment simulation.
Disorder Local Moment is a method to simulate an antiferromagnetic material by imposing periodically a random spin configuration by means of Special Quasirandom Structures.
- Parameters:
calc (
ase.calculator) – A ASE calculator object.unitcell (
ase.atoms) – The Atoms object for the unitcell, for which the symmetry will be used to create the magnetic sqs.supercell (
ase.atoms) – The supercell with ideal positionsmagnetic_sites (
list) – List of integers describing the unitcell sites where the magnetic atoms are locatedmu_b (
float) – The initial spin amplitude, imposed before the calculation, in Bohr magneton. Default1.0.cutoff (
listoffloat) – The cutoffs for the SQS generation. See icet documentation for more information. Default[6.0, 4.0].n_steps (
int(optional)) – Number of Monte-Carlo steps for the generation of the magnetic SQS. Default3000.
- compute_true_potential(confs, state=None, step=None)
Compute the energy of given configurations with an ASE calculator, using a random spin configuration from the SQS.
DatabaseCalc
- class mlacs.calc.DatabaseCalc(trajfile, trainfile, magmoms=None, **kwargs)
Calculators that sequentially reads a previously calculated traj files. Normal utilisator want to set OtfMlacs.nstep to len(traj). Can be used with restart to append trajfile to the current traj.
- Parameters:
calc (
ase.calculator) – A ASE calculator objecttrajfile (
strorpathlib.Path) – The trajectory file from which DatabaseCalc will readtrainfile (
str,pathlib.Path,) – The training.traj file, configuration used for fitting but not counted for thermodynamic propertiesmagmoms (
np.ndarray(optional)) – An array for the initial magnetic moments for each computation IfNone, no initial magnetization. (Non magnetic calculation) DefaultNone.
- compute_true_potential(mlip_confs, state=None, step=None)
Return the energy of given configurations contained in the Trajectory file. This is a way to replay a previously done MLACS simulations.