Advanced options

Back

Big data

In order to obtain well converged results in the calculation of anharmonic phonon properties, specially in phonon linewidths, usually it becomes necessary to use very long MD simulations. This requires long calculation times and imply to hadle very large files. Fortunatelly, in canonical ensemble calculations the velocity time correlation usually decreases fast with the time. That means that it becomes possible to join several independent MD trajectories to obtain a larger one with almost negligible added error. That allows to calculate many independent MD simulations at the same time and join them later to obtain a larger MD trajectory and increase the accuracy of the results.
To support this task DynaPhoPy can save the MD information into a hdf5 file to be read afterwards. Additionally I provide an independent script called concath5 which allows join several hdf5 files into one.
Note: VASP code has to be compiled with advanced features in order to start MD from a random seed and generate different trajectories each run. Please, refere to VASP documentation for further information.

MEM coeficient analysis

The correct setting of the number of coefficents in MEM algorithm to calculate the power spectrum is one of the crucial point to take in account. Depending on the number of coefficents the peak width of the peaks may significantly change, which directly affects the phonon linewidths results.
From my experience, if the MD simulations are long enough, as the number of coefficents increase the peak width become to stabilize while keeping the peaks shape smooth. Is to be expected than this stabilized width is more reliable even if the peaks become a little more uglyer.
In order to check the evolution of the power spectra peaks width with the number of coefficents dynaphopy provides option -csa which performs a scan for all peaks anf fits each one to Lorentzian function to extract width information. All this information is plotted in 3 matplotlib windows for each phonon.

$ dynaphopy input_file TRAJECTORY -csa
Interactive Interactive Interactive

Additionally, it shows the optimum number of coeficients that has the best fit with a Lorentzian function and estimates the peak width value taking a average for all coefficents ponderated by the inverse of fit error.

Peak # 5
------------------------------------
Estimated width(FWHM): 0.0570242354113 THz
Position: 3.8546680966 THz
Optimum coefficients num: 336.0
Fitting Error: 2.31991499922e-07

External power spectra analysis

The calculation of the power spectra, specially using Fourier transform method, can take a lot of time (maybe few days). For this reason the calculation of these spectra may be done in a cluster computer in which may not have acces through graphical interface. This makes the fitting analysis difficult since there is no way to evaluate visually if the fitting has been correctly done. Besides, the power spectrum obtained may be noisy and a post processing may be needed to improve the fitting quality.
In dynaphopy package, fitdata script is included in scripts folder to extract the anharmonic information from a power spectrum file obtained with Dynaphopy throught -sw or -sp options. This allows to first calculate the power spectrum using Dynaphopy in a cluster computer, saving it in a file and later extract the information in a local machine. Additionally this script allows to smooth the spectrum using Local regression method before fitting it with a Lorentzian function.
During the execution it shows the smoothing result and the fitting result for each spectrum present in the spectrum file allowing to test different smoothing parameters to obtain the best results.

Thermal expansion contribution

Thermal expansion may have a huge contribution to the frequency shift at high temperatures. This contribution can be included in DynaPhoPy via force constants. These force constants are obtained from a lattice dynamics calculation using a unit cell correspoponding to the cell volume at a given temperature. This temperature should correspond to the temperature at which the MD simulation is calculated. The crystal symmetry of the unit cell is assumed to remain constant with the volume. If the crystal symmetry of the structure at the analyzed temperature is different respect the symmetry of the structure at 0 K temperature this approximation may be incorrect.
In order to calculate the thermal expansion contribution the quasi-harmonic approximation (QHA) may be used. DynaPhoPy package includes a script to facilitate this calculation using phonopy: qha_extract. To use this script, first it is necessary to prepare a set of phonon calculations at different volumes as described in phonopy-qha manual. Using this procedure we should obtain 3 kinds of files:
1) A FORCE_CONSTANTS file at each volume.
2) A thermal_properties.yaml file at each volume
3) A e-v.dat file.
The qha_extract is executed by:

$ qha_extract input_file -ev e-v.dat 
-fc FORCE_CONSTANTS_1 FORCE_CONSTANTS_2 FORCE_CONSTANTS_3 ...  
-tp thermal_properties_1.yaml thermal_properties_2.yaml ...
-t 800

where input_file is a usual DynaPhoPy input file (the same used to analyze the MD is OK) and -t flag indicates the temperature at which the force constants are obtained. This temperature should be the one at which the MD simulation is calculated. The output result of this script is a file named FORCE_CONSTANTS_QHA that contains the force constants at the given temperature.
The order in which the files are introduced using -fc and -tp flags matters, make sure to be consistent each other. Wildcards can be used, just make sure the filenames is properly set according to alphanumeric order:

$ qha_extract input_file -ev e-v.dat 
-fc FORCE_CONSTANTS_*  
-tp thermal_properties_*
-t 800

Optional flags:
-p Plot results of the QHA calculation using phonopy-qha
-sfc Defines custom name for the ouput FORCE_CONSTANTS_QHA file.

Once the calculation is finished, the file FORCE_CONSTANTS_QHA is used in DynaPhoPy by the flag --qha_force_constants:

$ dynaphopy input_file TRAJECTORY 
--qha_force_constants FORCE_CONSTANTS_QHA