Skip to content
Snippets Groups Projects
Commit 0b537c8f authored by Ivan Kondov's avatar Ivan Kondov
Browse files

Merge branch '418-dimer-example-not-running' into 'master'

Resolve "Dimer example not running"

Closes #418

See merge request !327
parents 5417e7b7 ef79ab08
No related branches found
No related tags found
1 merge request!327Resolve "Dimer example not running"
Pipeline #410476 passed
......@@ -186,7 +186,7 @@ h2_fix0 = FixedAtoms where (fix: true, false) # fix first atom in H2
## Algorithm
The AMML `Algorithm` parameter describes operations that are either available as algorithms in the [Atomic Simulation Environment (ASE)](https://wiki.fysik.dtu.dk/ase/) or are user-defined routines. For example, the `BFGS` structure optimization is an algorithm. Further available algorithms are: `BFGSLineSearch`, `LBFGS`, `LBFGSLineSearch`, `GPMin`, `MDMin`, `QuasiNewton`, `FIRE`, `VelocityVerlet`, `Langevin`, `Andersen`, `NVTBerendsen`, `NPTBerendsen`, `NPT`, `RDF`, `RMSD`, `EquationOfState`, `NEB`, `Dimer`. Not implemented: `BFGSClimbFixInternals`, `BasinHopping`, `MinimaHopping`, `GA`, `PourbaixDiagram`, `PhaseDiagram`, `Inertia`.
The AMML `Algorithm` parameter describes operations that are either available as algorithms in the [Atomic Simulation Environment (ASE)](https://wiki.fysik.dtu.dk/ase/) or are user-defined routines. For example, the `BFGS` structure optimization is an algorithm. Further available algorithms are summarized in the table below.
The general syntax of `Algorithm` is:
......@@ -376,6 +376,26 @@ As for the calculators, the numerical parameters of algorithms must have explici
| | fmax | Float | 0.05 [eV Å{sup}`-1`] | [length mass time{sup}`-2`] | [eV Å{sup}`-1`] |
| | trajectory | Boolean | null | --- | --- |
| | logfile | Boolean | null | --- | --- |
| | eigenmode_logfile | String | null | --- | --- |
| | eigenmode_method | String | 'dimer' | --- | --- |
| | f_rot_min | Float | 0.1 [eV Å{sup}`-1`] | [length mass time{sup}`-2`] | [eV Å{sup}`-1`] |
| | f_rot_max | Float | 1.0 [eV Å{sup}`-1`] | [length mass time{sup}`-2`] | [eV Å{sup}`-1`] |
| | max_num_rot | Integer | 1 | [dimensionless] | --- |
| | trial_angle | Float | 0.25 $\pi$ [radians] | [angle] | [radians] |
| | trial_trans_step | Float | 0.001 [Å] | [length] | [Å] |
| | maximum_translation | Float | 0.1 [Å] | [length] | [Å] |
| | cg_translation | Boolean | true | --- | --- |
| | use_central_forces | Boolean | true | --- | --- |
| | dimer_separation | Float | 0.0001 [Å] | [length] | [Å] |
| | initial_eigenmode_method | String | 'gauss' | --- | --- |
| | extrapolate_forces | Boolean | False | --- | --- |
| | displacement_method | String | 'gauss' | --- | --- |
| | gauss_std | String | 0.1 [Å] | [length] | [Å] |
| | order | Integer | 1 | [dimensionless] | --- |
| | mask | BoolArray | null | --- | --- |
| | displacement_center | FloatArray | null | [length] | [Å] |
| | displacement_radius | Float | null | [length] | [Å] |
| | number_of_displacement_atoms | Integer | null | [dimensionless] | --- |
| [Vibrations](https://wiki.fysik.dtu.dk/ase/ase/vibrations/modes.html) | delta | Float | 0.01 [Å] | [lenght] | [Å] |
| | nfree | Integer | 2 | [dimensionless] | --- |
| | method | String | 'standard' | --- | --- |
......
......@@ -22,23 +22,13 @@ scalar_type = (str, *scalar_booltype, numbers.Number)
def is_numeric_type(type_):
"""check if the type_ is numeric"""
if issubclass(type_, ScalarNumerical) and not issubclass(type_, bool):
return True
if issubclass(type_, ureg.Quantity):
return True
if issubclass(type_, numpy.ndarray) and issubclass(type_.datatype, ScalarNumerical):
"""check if type_ is a numeric type"""
if issubclass(type_, scalar_booltype):
return False
if issubclass(type_, (ScalarNumerical, ureg.Quantity)):
return True
if issubclass(type_, pandas.Series):
if type_.datatype is None:
return None
if issubclass(type_.datatype, scalar_booltype):
return False
if issubclass(type_.datatype, (ScalarNumerical, ureg.Quantity)):
return True
if issubclass(type_.datatype, numpy.ndarray):
if issubclass(type_.datatype.datatype, ScalarNumerical):
return True
if issubclass(type_, (pandas.Series, numpy.ndarray)):
return getattr(type_, 'datatype', None) and is_numeric_type(type_.datatype)
return False
......@@ -52,7 +42,7 @@ def is_scalar_type(type_):
def is_numeric_scalar_type_of(type_, numtype):
"""check if type_ is numerical scalar type of numtype"""
"""check if type_ is numeric scalar sub-type of numtype"""
if not is_scalar_type(type_) or issubclass(type_, scalar_booltype):
return False
if issubclass(type_, ureg.Quantity) and type_.datatype:
......@@ -61,35 +51,35 @@ def is_numeric_scalar_type_of(type_, numtype):
def is_scalar_inttype(type_):
"""check if type_ is scalar integer type"""
"""check if type_ is a scalar integer type"""
return is_numeric_scalar_type_of(type_, ScalarInteger)
def is_scalar_realtype(type_):
"""check if type_ is scalar real type"""
"""check if type_ is a scalar real type"""
return (is_numeric_scalar_type_of(type_, ScalarReal) and not
is_numeric_scalar_type_of(type_, ScalarInteger))
def is_scalar_complextype(type_):
"""check if type_ is scalar complex type"""
"""check if type_ is a scalar complex type"""
return (is_numeric_scalar_type_of(type_, ScalarComplex) and not
is_numeric_scalar_type_of(type_, ScalarReal))
def is_array_type(type_):
"""check if type_ is array type"""
"""check if type_ is an array type"""
return ((hasattr(type_, 'arraytype') and type_.arraytype) or
(hasattr(type_, 'datatype') and is_array_type(type_.datatype)))
def is_numeric_scalar_type(type_):
"""check if the type_ is numeric scalar type"""
"""check if type_ is a numeric scalar type"""
return is_numeric_type(type_) and is_scalar_type(type_)
def is_numeric_array_type(type_):
"""check if the type is numeric array type"""
"""check if type is a numeric array type"""
return is_numeric_type(type_) and is_array_type(type_)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment