asr.c2db.relax¶
Summary¶
This is the documentation for asr.c2db.relax
-recipe.
This recipe is comprised of a single instruction, namely:
Run this recipe through the CLI interface
$ asr run asr.c2db.relax
or as a python module
$ python -m asr.c2db.relax
Detailed description¶
Relax atomic structures.
By defaults read from “unrelaxed.json” from disk and relaxes structures and saves the final relaxed structure in “structure.json”.
The relax recipe has a couple of note-worthy features:
It automatically handles structures of any dimensionality
It tries to enforce symmetries
It continously checks after each step that no symmetries are broken, and raises an error if this happens.
The recipe also supports relaxing structure with vdW forces using DFTD3. To install DFTD3 do
$ mkdir ~/DFTD3 && cd ~/DFTD3
$ wget chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dftd3.tgz
$ tar -zxf dftd3.tgz
$ make
$ echo 'export ASE_DFTD3_COMMAND=$HOME/DFTD3/dftd3' >> ~/.bashrc
$ source ~/.bashrc
Examples¶
Relax without using DFTD3
$ ase build -x diamond Si unrelaxed.json
$ asr run "relax --nod3"
Relax using the LDA exchange-correlation functional
$ ase build -x diamond Si unrelaxed.json
$ asr run "relax --calculator {'xc':'LDA',...}"
Steps¶
asr.c2db.relax¶
- asr.c2db.relax.main(atoms, calculator={'charge': 0, 'convergence': {'forces': 0.0001}, 'kpts': {'density': 6.0, 'gamma': True}, 'mode': {'ecut': 800, 'name': 'pw'}, 'name': 'gpaw', 'occupations': {'name': 'fermi-dirac', 'width': 0.05}, 'symmetry': {'symmorphic': False}, 'txt': 'relax.txt', 'xc': 'PBE'}, tmp_atoms=None, tmp_atoms_file='relax.traj', d3=False, fixcell=False, allow_symmetry_breaking=False, fmax=0.01, enforce_symmetry=True)[source]¶
Relax atomic positions and unit cell.
The relaxed structure is saved to structure.json which can be processed by other recipes.
- Parameters
atoms (ase.atoms.Atoms) – Atomic structure to relax.
calculator (dict) – Calculator dictionary description.
tmp_atoms (Optional[ase.atoms.Atoms]) – Atoms from a restarted calculation.
tmp_atoms_file (str) – Filename to save relaxed trajectory in.
d3 (bool) – Relax using DFTD3.
fixcell (bool) – Fix cell when relaxing, thus only relaxing atomic positions.
allow_symmetry_breaking (bool) – Allow structure to break symmetry.
fmax (float) – Maximum force tolerance.
enforce_symmetry (bool) – Enforce symmetries. When enabled, the atomic structure, forces and stresses will be symmetrized at each step of the relaxation.
- Return type
- class asr.c2db.relax.Result(a, symbols, gamma, c, images, beta, alpha, etot, forces, magmoms, spos, b, stress, atoms, edft)[source]¶
Result class for
asr.c2db.relax.main()
.- Parameters
- property atoms: ase.atoms.Atoms¶
Relaxed atomic structure.
- property forces: numpy.ndarray¶
Forces on atoms after relaxation.
- property images: List[ase.atoms.Atoms]¶
Path taken when relaxing structure.
- property spos: numpy.ndarray¶
Scaled positions
- Type
Array
- property stress: numpy.ndarray¶
Stress on cell after relaxation.