Evaluating order parameters#
DoFSpace#
A DoFSpace
specifies a subspace of allowed degrees of freedom (DoF) values of a particular DoF type, with subspace basis
Examples
For occupant DoF,
represents sublattice concentrations in the supercell commensurate with all ordered structures of interest, for example:where
is the concentration of species on sublattice in the supercell.For displacement DoF using the standard basis,
represents the average values of each displacement component on a sublattice in the supercell commensurate with all ordered structures of interest, for example:where
indicates the average of the displacement component, respectively, on sublattice in the supercell.For strain DoF,
represents the strain DoF values, for example:
Examples, non-standard prim basis
It is also possible to define order parameters in terms of a non-standard prim basis:
For displacement DoF using a non-standard prim basis allowing two-dimensional displacements:
where
indicates the average of the displacement component, respectively, on sublattice in the supercell commensurate with all ordered structures of interest.For strain DoF using a symmetry-adapted prim strain basis, excluding shear:
where
are symmetry-adapted strains (see Thomas and Van der Ven [TVandVen17]):
Symmetry operations transform the DoF values of a configuration and the effect
Note
For each DoF type, there is a set of symmetry representation matrices,
Matrix representations,
To calculate symmetry adapted order parameters, a DoFSpace should be constructed with a symmetry adapted basis,
Construction of a symmetry adapted basis can be done using methods in libcasm-configuration, which provides support for determining and applying symmetry representations. This package provides the underlying methods that calculate ConfigDoFValues
) given a particular choice of order parameter basis,
See also
For more details on symmetry adapated order parameters, see Natarajan et al. [NTPVdV17]. Note that the paper uses the convention
Global DoF#
For global DoF, each row of
dof_component_index: The index of the relevant global DoF value component on that site
Each element of
Local DoF#
For local continuous DoF and occupant DoF, DoFSpace
is constructed with a supercell transformation matrix,
Each row of
linear_site_index: The index of the associated site in the DoFSpace supercell
dof_component_index: The index of the relevant DoF value component on that site
Note
The DoFSpace member function axis_info()
can be used to lookup the mapping of DoF components to rows of
For local continuous DoF,
For occupant DoF,
Note
For occupant DoF, elements of
The OrderParameter calculator#
The class OrderParameter
is used to calculate:
the value of an order parameter
the change in the value of an order parameter given changes in degree of freedom (DoF) values
To calculate the order parameter value, OrderParameter uses:
DoFSpace
: To specify the order parameter basisSiteIndexConverter
: To perform index conversionsConfigDoFValues
: OrderParameter is given a pointer to a ConfigDoFValues instance and calculates the order parameters using the current state of the DoF values
Construction#
A OrderParameter
calculator can be constructed as follows:
import numpy as np
import libcasm.xtal as xtal
from libcasm.clexulator import (
DoFSpace, OrderParameter,
)
# construct the Prim
xtal_prim = # xtal.Prim(...)
# specify the DoFSpace
dof_space = # DoFSpace(...)
# construct a OrderParameter calculator
order_parameter = OrderParameter(
dof_space=dof_space,
)
Setup#
An OrderParameter instance is set to calculate order parameters in one supercell at a time, using the appropriate SiteIndexConverter
. This can be set or changed using the update()
method.
Order parameters are calculated for a ConfigDoFValues
instance that can be specified using the call operator, the update()
method, or the set()
method.
Default configuration degree of freedom (DoF) values in a particular supercell can be constructed and the OrderParameter instance updated to evaluate using those values as follows:
import libcasm.xtal as xtal
from libcasm.clexulator import (
make_default_config_dof_values,
)
# specify the supercell:
l_unitcells = # int(... specify a l * l * l unit cells sized supercell ...)
transformation_matrix_to_super = np.eye(3) * l_unitcells
# construct SiteIndexConverter
site_index_converter = xtal.SiteIndexConverter(
transformation_matrix_to_super=transformation_matrix_to_super,
n_sublattice=len(xtal_prim.occ_dof()),
)
# construct ConfigDoFValues, in the prim DoF basis
config_dof_values = make_default_config_dof_values(
xtal_prim=xtal_prim,
n_unitcells=round(np.linalg.det(transformation_matrix_to_super)),
)
# set the supercell and ConfigDoFValues used for order parameter calculation
order_parameter.update(
transformation_matrix_to_super=transformation_matrix_to_super,
site_index_converter=site_index_converter,
config_dof_values=config_dof_values,
)
The transformation_matrix_to_super used to construct the ConfigDoFValues
and SiteIndexConverter
instances and given as the update()
argument defines the supercell of the configuration being evaluated and therefore must be the same.
However, it does not need to be the same supercell as the DoFSpace
is defined with. When evaluating the order paramers, if the configuration supercell differs from the the DoFSpace
supercell:
For occupant DoF and local DoF, a commensurate supercell is determined internally and order parameters are evaluated as if the config_dof_values are tiled into the commensurate supercell.
For global DoF, the supercell is irrelevant.
Evaluate the order parameters#
The variable config_dof_values returned by make_cluster_expansion()
is an instance of ConfigDoFValues
which the OrderParameter
calculator is set to evaluate.
Then, the cluster expansion value can be evaluated with:
# evaluate and get current order parameters value:
eta = order_parameter.value()
# eta is a const reference of type numpy.ndarray[numpy.float64[d, 1]],
# where d is the dimension of the DoFSpace basis (number of columns)
Internally, this uses config_dof_values to construct a vector,
Change DoF values and re-evaluate#
To change DoF values and re-calculate the cluster expansion, just modify the values of the ConfigDoFValues
instance and re-evaluate. For a detailed discussion and some pitfalls, see the discussion Change DoF values and re-evaluate for ClusterExpansion.