The phonon contribution tasks module
This module analysis the basic units (task) of phonon contribution calculation to be performed, and the order they are conducted.
- class cij.core.tasks.PhononContributionTask(strain, key, calculator=None)
Bases:
object
- property calc_type: ElasticModulusCalculationType
- get_dependencies()
- Return type
List
[Tuple
[Tuple
,ModulusRepresentation
]]
- get_modulus_adiabatic()
Get phonon contribution of the adiabatic elastic modulus as the result of this task.
- Return type
ndarray
- get_modulus_isothermal()
Get phonon contribution of the isothermal elastic modulus as the result of this task.
- Return type
ndarray
- property params: tuple
- property task_params: PhononContributionTaskParams
- class cij.core.tasks.PhononContributionTaskList(calculator)
Bases:
UserList
- calculate()
- Return type
None
- get_adiabatic_results()
- Return type
dict
- get_isothermal_results()
- Return type
dict
- resolve(strain, keys)
Create the list of phonon calculation tasks based on the initial strain and the \(c_{ij}\) keys in topological order, i.e. each task should have a smaller index than its dependant.
- Example
\(c_{44}\) depends on \(c_{2'2'}\), \(c_{2'3'}\) and \(c_{3'3'}\), the order of calculation tasks should be:
[\(c_{2'2'}\), \(c_{2'3'}\), \(c_{3'3'}\), \(c_{44}\)]
- Parameters
strain (
tuple
) – The strains \(e_1/\Delta\), \(e_2/\Delta\), \(e_3/\Delta\) in the orthogonal coordinates system under hydrostatic pressure.keys (
Iterable
[ModulusRepresentation
]) – The symbols :math:`c_{ij}`s needs to be calculated.
- Return type
None
- class cij.core.tasks.PhononContributionTaskParams(calc_type: ElasticModulusCalculationType, params: tuple)
Bases:
NamedTuple
Parameters for elastic constants phonon contribution calculation task.
-
calc_type:
ElasticModulusCalculationType
Alias for field number 0
- classmethod create(strain, key)
Factory method for creating
PhononContributionTaskParams
.- Parameters
strain (
tuple
) – The strains \(e_1/\Delta\), \(e_2/\Delta\), \(e_3/\Delta\) in the orthogonal coordinates system under hydrostatic pressure.key (
ModulusRepresentation
) – The symbol \(c_{ij}\) needs to be calculated.
- Return type
-
params:
tuple
Alias for field number 1
-
calc_type:
- class cij.core.tasks.PhononContributionTaskResults(dict=None, /, **kwargs)
Bases:
UserDict
The results of phonon calculation tasks
Key is
PhononContributionTaskParams
Value is
numpy.ndarray
- get_results_by_strain_keys(strain, keys)
The results for given \(c_{ij}\) symbol at given set of strain
- Parameters
strain (
tuple
) – The strains \(e_1/\Delta\), \(e_2/\Delta\), \(e_3/\Delta\) in the orthogonal coordinates system under hydrostatic pressure.keys (
Iterable
[ModulusRepresentation
]) – The symbols :math:`c_{ij}`s are calculated.
- Return type
dict