Phonon energies¶
The Phonons
class allows to compute the normal modes of a
system.
-
class
mybigdft.workflows.phonons.
Phonons
(ground_state, translation_amplitudes=None, order=2)[source]¶ Bases:
mybigdft.workflows.workflow.AbstractWorkflow
This class allows to run all the calculations enabling the computation of the phonon energies of a given system.
To get the phonon energies of the system, one needs to find the eigenvalues of the dynamical matrix, that is closely related to the Hessian. To build these matrices, one must find the derivatives of the forces when each coordinate of each atom is translated by a small amount around the equilibrium positions. This derivative must be performed numerically. For a first order evaluation of the derivative, \(3 n_{at} + 1\) DFT calculations must be performed, where \(n_{at}\) is the number of atoms of the system, the 3 factors comes from the translations along each space coordinate, while the extra calculation corresponds to the ground state. However, this might not be precise enough because you want the ground state forces to be equal to 0, or at least negligible with respect to the forces of the out of equilibrium positions. This can be difficult to obtain. It is therefore advised to evaluate that derivative with a second order scheme, where each coodinate is translated positively and negatively, so that the number of BigDFT calculations amounts to \(2*3*n_{at} = 6 n_{at}\) (no \(+ 1\) here, because there is no need to compute the ground state anymore).
From a ground state calculation, which must correspond to the equilibrium calculation geometry, the \(3 n_{at}+1\) or \(6 n_{at}\) jobs necessary for the calculation of the phonon energies are prepared (depending on the order of the calculation).
The distance of the displacement in each direction is controlled by translation_amplitudes (one amplitude per space coordinate must be given).
The phonon energies calculations are computed while post- processing the results of all the calculations (after running the run method). They correspond to the energies of the Raman spectrum. If interested in getting the Raman intensity and depolarization ratio of each phonon (or normal mode), see
RamanSpectrum
. If interested in getting the infrared intensity of each phonon, seeInfraredSpectrum
.- Parameters
ground_state (Job) – Job of the ground state of the system under consideration.
translation_amplitudes (Sequence of length 3) – Amplitudes of the translations to be applied to each atom along each of the three space coordinates (in atomic units).
order (int) – Order of the numerical differentiation used to compute the dynamical matrix. If second order (resp. first), then six (resp. three) calculations per atom are to be performed.
-
property
ground_state
¶ - Returns
Job of the ground state of the system under consideration.
- Return type
-
property
translation_amplitudes
¶ - Returns
Amplitudes of the translations to be applied to each atom along each of the three space coordinates.
- Return type
Sequence of length 3
-
property
order
¶ - Returns
order – Order of the numerical differentiation used to compute the dynamical matrix. If second order (resp. first), then six (resp. three) calculations per atom are to be performed.
- Return type
int
-
property
energies
¶ - Returns
Phonon energies of the system (units: cm^-1).
- Return type
numpy.array or None
-
property
dyn_mat
¶ - Returns
Dynamical matrix deduced from the calculations.
- Return type
numpy.array or None
-
property
normal_modes
¶ - Returns
Normal modes of the system found as eigenvectors of the dynamical matrix.
- Return type
numpy.array or None
-
property
displacements
¶ - Returns
Displacements each atom of the system must undergo before computing the dynamical matrix as post-processing. There are three or six of them (one or two per space coordinate, depending on the order of the numerical derivative procedure) if the forward or central difference scheme is used, respectively.
- Return type
OrderedDict of length 3 or 6
-
post_proc
()[source]¶ Run the post-processing of the calculations, here:
compute the dynamical matrix,
solve it to get the phonons (normal modes) and their energies.
-
property
is_completed
¶ - Returns
True if all the post-processing attributes are no longer set to their default value.
- Return type
bool
-
property
logfiles
¶ - Returns
A dictionary of all the logfiles of the workflow, with the name of the associated job as key.
- Return type
dict
-
property
queue
¶ - Returns
All the jobs of the workflow.
- Return type
list
-
run
(nmpi=1, nomp=1, force_run=False, dry_run=False, restart_if_incomplete=False, timeout=None)¶ Run all the calculations if the post-processing was not already performed.
Warning
If force_run or dry_run is set to True, then any previous value of the post-processing attributes is deleted and set back to their default value, so that the post-processing is not considered as being performed.
- Parameters
nmpi (int) – Number of MPI tasks.
nomp (int) – Number of OpenMP tasks.
force_run (bool) – If True, the calculations are run even though a logfile already exists.
dry_run (bool) – If True, the input files are written on disk, but the bigdft-tool command is run instead of the bigdft one.
restart_if_incomplete (bool) – If True, the job is restarted if the existing logfile is incomplete.
timeout (float or int or None) – Number of minutes after which each job must be stopped.
- Warns
UserWarning – If the post-processing was already completed.
-
class
mybigdft.workflows.phonons.
Displacement
[source]¶ Bases:
mybigdft.workflows.phonons.Displacement
This class defines an atomic displacement from the coordinate index and the amplitude of the displacement in that direction.
Create new instance of Displacement(i_coord, amplitude)
-
property
vector
¶ - Returns
Displacement vector.
- Return type
list
-
property
amplitude
¶ Alias for field number 1
-
count
()¶ Return number of occurrences of value.
-
property
i_coord
¶ Alias for field number 0
-
index
()¶ Return first index of value.
Raises ValueError if the value is not present.
-
property