Geometry optimization block

class pylada.dftcrystal.optgeom.OptGeom(breaksym=None, keepsymm=None)[source]

Bases: pylada.dftcrystal.optgeom.ExclAttrBlock

Geometry Optimization block.

Defines the input block for geometry optimization. Geometry optimization must be explicitely enabled:

>>> functional.optgeom.enabled = True

It is disabled by default. When enabled, other sub-blocks within CRYSTAL‘s first input block are automatically disabled (e.g. freqcalc [*]). The full set of geometry optimization parameters can be accessed by the user within the optgeom attribute of an Functional instance:

>>> functional.optgeom.fulloptg = True
>>> functional.optgeom.maxcycle = 300
>>> functional.optgeom.enabled  = True

The above would set the optimization method to FULLOPTG and the number of geometry optimization to 300. The third line would enable the block so that the geomtry optimization can happen.

Note

Inner keywords can be modified when the block is disabled. However, the block will not appear in the input until is is explicitely enabled.

[*]Currently, Functional only contains the optgeom attribute. If implemented, other sub-blocks should derive from ExclAttrBlock.
add_keyword(name, value=None)

Creates a new parameter. The parameter will appear in the input within the OPTGEOM block. If value is None or True, then it will result in the following input:

OPTGEOM
NAME
END OPTGEOM

The name is automatically in capital letters. Other keywords from the block were removed for clarity. If value is a string, then it is printed as is:

>>> functional.optgeom.add_keyword('hello')
>>> functional.optgeom.hello = "This\nis\na string"

The above will create the formatted output:

OPTGEOM
HELLO
THIS
IS
A STRING
END OPTGEOM

By formatting a string, any input, however complex, can be given. However, simple cases such as an integer, are handled sensibly:

>>> functional.optgeom.hello = 2*5
OPTGEOM
HELLO
10
END OPTGEOM

Floating point numbers, and mixed lists of integers, floating points, and strings are also handled sensibly.

This function makes it easy to add new keywords to the OPTGEOM block.

fulloptg

Optimization of all degrees of freedom: volume, cell-shape, ionic positions.

This is an instance of GeometryOpt. It excludes cellonly, itatocell, interdun.

>>> functional.optgeom.fulloptg = True
>>> functional.optgeom.cellonly, functional.optgeom.itatocell, functional.optgeom.interdun
False, False, False

It can also be made to optimize at constant volume if cvolopt is True.

cellonly

Optimization of cell-shape at constant atomic-position.

This is an instance of GeometryOpt. It excludes fulloptg, itatocell, interdun.

>>> functional.optgeom.cellonly = True
>>> functional.optgeom.fulloptg, functional.optgeom.itatocell, functional.optgeom.interdun
False, False, False

It can also be made to optimize at constant volume if cvolopt is True.

itatocell

Iterative optimization of cell-shape <–> atomic positions.

This is an instance of GeometryOpt. It excludes cellonly, fulloptg, interdun.

>>> functional.optgeom.itatocell = True
>>> functional.optgeom.fulloptg, functional.optgeom.cellonly, functional.optgeom.interdun
False, False, False
interdun

If True, turns on constrained optimization. See CRYSTAL manual.

This is an instance of GeometryOpt. It excludes cellonly, fulloptg, interdun.

>>> functional.optgeom.itatocell = True
>>> functional.optgeom.fulloptg, functional.optgeom.cellonly, functional.optgeom.interdun
False, False, False
cvolopt

If True and if one of fulloptg or cellonly is True, then performs constant volume optimization.

bhor

Bhor radius, defined as in CRYSTAL, 0.5291772083 angstrom.

bohr = None

Bohr radius as defined by CRYSTAL

breaksym = None

Whether to keep or break symmetries.

This value can be True, False, or None. If True, then symmetries will be broken. If False, symmetries will be kept during the minimization. By default, symmetries are broken.

cvolopt = None

Constant volume optimization keyword.

Only appears if FULLOPTG or CELLONLY exist.

enabled

True if this block is enabled.

extpress = None

Hydrostatic pressure in \(\frac{\text{hartree}}{\text{bohr}^{3}}\).

Sets the hydrostatic pressure for which an structural relaxation is performed.

extstress = None

External stress in \(\frac{\text{hartree}}{\text{bohr}^{3}}\).

Sets the stress for which a structural relaxation is performed.

fixcell = None

Constant volume optimization keyword.

When used in conjunction with intredun optimization method, keeps the cell-external degrees of freedom constant. Only appears for intredun relaxations.

intredun = None

Constrained optimization.

Relaxes the strain energy by optimizing a complete and redundant set of chemically intuitive parameters, such as bond-length and bond-angles. This option is not compatible with other optimization methods.

>>> functional.optgeom.intredun = True
>>> functional.fulloptg, functional.itatocell
False, False
keepsymm[source]

Alias to the opposite of breaksym.

keyword = 'optgeom'

CRYSTAL input keyword (class-attribute)

maxcycle = None

Maxium number of iterations in geometry optimization loop.

nosymmops = None

Whether to print symmetry operations at the end of optimization.

noxyz = None

Whether to print cartesian coordinates at the end of optimization.

onelog = None

Whether to print electronic minimization at each geometry step.

The electronic minimization steps can be printed to the same file as the geometry optimization step (e.g. the standard output). By default, Pylada prefers to print to the same file, in contrast to CRYSTAL‘s default.

printforces = None

Whether to print forces at the end of optimization.

printhess = None

Whether to print Hessian at the end of optimization.

printopt = None

Whether to print extended optimization information.

toldee = None

Electronic structure minimization convergence criteria.

The criteria is with respect to the total energy. It is logarithmic and should be an integer: \(|\Delta E| < 10^{-\mathrm{toldee}}\).

toldeg = None

Structural relaxation convergence criteria.

Convergence criteria for the root mean square gradient of the total energy with respect to the displacements. Should be a floating point.

toldex = None

Structural relaxation convergence criteria.

Convergence criteria as the root mean square of the displacements during structural relaxation. Should be a floating point.

verbose = None

Verbose printint.

class pylada.dftcrystal.optgeom.ExclAttrBlock[source]

Bases: pylada.dftcrystal.input.AttrBlock

An attribute block set up to exclude others.

Expects both “keyword” and “excludegroup” attributes (or class attributes) to exist in derived instances. This class makes it convenient to describe mutually exclusive blocks such as optgeom and freqcalc.

enabled[source]

True if this block is enabled.

excludegroup = ('optgeom', 'freqcalc', 'anharm', 'confcnt', 'cphf', 'elastcon', 'eos')

Groups of blocks of which only one should be enabled.

output_map(**kwargs)[source]

Does not print if disabled.

read_input(tree, owner=None, **kwargs)[source]

Reads from input.

Previous topic

Functional class and attributes

Next topic

Basis sets

This Page