anharm module

This module contains classes dealing with anharmonicity

class anharm.anharm_measure(*args: Any, **kwargs: Any)

Bases: pyepfd.elph_classes.

This class have all methods to compute anharmonicity measure. Currently only anharmonic measure proposed by Knoop, Purcell, Scheffler, and Carbogno is implemented.

Citation: Phys. Rev. Mater 4, 083809 (2020)

Arguments:

dynmat = dynamical matrix, a (3 N x 3 N) numpy array of floats ; where N is the number of atoms.

mass = A numpy array of length 3 N containing mass matrix

forces = A (n,3N) numpy float matrix: n 3N-dimensional vector containing cartesian forces from n number of MD/MC snapshots

disp_coords = A (n,3N) numpy float matrix: n 3N-dimensional vector containing cartesian coordinates from n number of MD/MC snapshots

opt_coord = 3N-dimensional vector of cartesian coordinates of a optimized geometry/structure

asr = Acoustic Sum Rule; a string. Allowed values are: (1) 'none' (Default): asr is not applied, OR (2) 'crystal' : For infinite systems / crystals, OR (3) 'poly' : For poly-atomic non-linear molecules, OR (4) 'lin' : For any linear molecules

mode_resolved = Allowed values are (1) True : Mode-resolved anharmonic measure is computed, OR (2) False : Mode-resolved anharmonic measure is not computed.

write(file_path, atoms, vib_freq_unit='cm-1')

This function writes the anharmonic measure for each mode and atoms.

Arguments:

file_path = A string; path to the output files where anharmonic measure values would be written

atoms = A python list of strings containing symbols of all atoms

vib_freq_unit = A string. The unit in which vibrational frequency of normal modes would be printed. The allowed values are: (1) 'cm-1' (Default), OR (2) 'THz' , OR (3) 'K' , OR (4) 'meV' .

Returns:

In the given file_path it will create files with suffix _atom_res_anh_mes.out and _mode_res_anh_mes.out (if mode_resolved = True ) where anharmonic measure would be printed.

class anharm.boltzmann_reweighting(*args: Any, **kwargs: Any)

Bases: pyepfd.elph_classes.

Danger

This class is experimental. Only use it if you know what you want.

This class uses a Boltzmann reweighting technique at a finite T to include anharmonicity.

Important

T cannot be small or 0 for Boltzmann weights. However, if you want only energy based anharmonic measure (see below), then temperature can be anything as the quantity does not depend on it directly. You can use any non-zero value here.

Arguments:

dynmat = Dynamical matrix

mass = Mass matrix

disp_coords = (n,3N) matrix: n 3N-dimensional vector containing cartesian coordinates from n number of MD/MC snapshots

opt_coord = 3N-dimensional vector of cartesian coordinates of a optimized geometry/structure

opt_energy = A float representing energy (atomic_unit) of the optimized coordinates

temperature = A float representing Temperature (in K)

asr = acoustic sum rule; a string. Allowed values are: (1) 'none' (Default): asr is not applied, OR (2) 'crystal' : For infinite systems / crystals, OR (3) 'poly' : For poly-atomic non-linear molecules, OR (4) 'lin' : For any linear molecules

remove_rot_trans = A boolean. Allowed values are: (1) True : removes global translations and rotations, OR (2) False : does not remove global translations and rotations, from the disp_coords

Returns:

  1. The modified weights for new configurations as an object anharm.boltzmann_reweighting.weights

  2. The energy based anharmonic measure as an object anharm.boltzmann_reweighting.anharm_measure

Warning

If you use stochastic trajectories for calculating energy based anharmonic measure, please use only algo = MC OR MCAP. As it is a ratio of fluctuations between anharmonic and total energies, we need to create an ensemble that samples the full vibrational density and not only the thermal lines along the normal modes.