fitting_elph_smearing¶
This code extract data from lambda.out file and plot Tc vs sigma, fit Tc = exp(-A*sigma**(1/3) + B) to obtain the value of decay parameter “A”.
Functions
|
Performs a fitting procedure to obtain exponential decay parameters and creates plots of the fitting. |
|
Computes the value of a linear function at given points. |
|
Main function to perform fitting procedure for electron-phonon coupling and handle input/output files. |
|
Parses the lambda.out file obtained from lambda.x of Quantum ESPRESSO (QE). |
- fitting_elph_smearing.func(xdata, aval, bval)[source]¶
Computes the value of a linear function at given points.
Parameters:¶
- xdataarray-like
The input data points where the function is evaluated.
- avalfloat
The coefficient ‘a’ in the linear function.
- bvalfloat
The intercept ‘b’ in the linear function.
Returns:¶
- ydataarray-like
The computed values of the linear function at the input data points.
- fitting_elph_smearing.parse_lambda(filename)[source]¶
Parses the lambda.out file obtained from lambda.x of Quantum ESPRESSO (QE). Creates a new file named “lambda.txt” containing columns for lambda, omega_log, and Tc.
Parameters:¶
- filenamestr
The name of the file to parse, typically “lambda.out”.
Note:¶
This function utilizes the ‘sed’ command-line tool to extract data from the lambda.out file. It extracts data starting from the line containing ‘omega_log’ until the end of the file, removes the first line, and saves the extracted data into a new file named “lambda.txt”.
- fitting_elph_smearing.fit_param(mpid, compound, ind, a_mgb2, begin_sigma, n_sigma)[source]¶
Performs a fitting procedure to obtain exponential decay parameters and creates plots of the fitting.
Parameters:¶
- mpidstr
Materials ID.
- compoundstr
Compound name.
- indint
Index of property. 1 for lambda and 2 for Tc.
- a_mgb2float
Decay parameter obtained by fitting Tc vs sigma data of MgB2.
- begin_sigmafloat
Width of smearing used in double delta integration.
- n_sigmaint
Number of sigma values.
- fitting_elph_smearing.main()[source]¶
Main function to perform fitting procedure for electron-phonon coupling and handle input/output files.
Usage: python fitting_elph_smearing.py result.csv AMgB2 smearing_begin number_of_smearing
Parameters:¶
- result.csvstr
CSV file containing results of electron-phonon coupling calculations.
- AMgB2float
An exponential decay parameter for MgB2.
- smearing_beginfloat
Starting value of the smearing parameter.
- number_of_smearingint
Number of smearing parameter values.
Returns:¶
None