Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New wan2skeaf in Julia with energy unit conversion from eV to Ry #6

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

npaulish
Copy link
Contributor

@npaulish npaulish commented Oct 31, 2023

  • Implement wan2skeaf in Julia
  • Convert energies from eV to Ry in skeaf input files to get correct values of the cyclotron masses
  • Allow automatic conversion of user defined Fermi energy from eV to Ry
  • Allow to change the occupation prefactor for Fermi energy calculation to support SOC calculations
  • Enable increasing tolerance in number of electrons when bisection algorithm to find Fermi energy doesn't converge
  • Separate exit code when Fermi energy didn't converge within the upper limit of tolerance in number of electrons (0.001)
  • Parse additional wan2skeaf output parameters
  • Update tests and examples
  • Remove unnecessary files

@npaulish npaulish marked this pull request as draft January 4, 2024 11:01
@npaulish npaulish marked this pull request as ready for review January 10, 2024 09:17
@npaulish npaulish marked this pull request as draft April 19, 2024 15:19
@npaulish npaulish marked this pull request as ready for review May 31, 2024 15:22
Now to write bxsfs for all bands either do not specify band_index
or set {"band_index" : -1}. Adapted aiida calculation and
wan2skeaf.py (!) accordingly. New output parameters for energies
closest to the Fermi level, if smearing specified, wan2skeaf.py
will write -1.0 (not implemented). Command line arguments of
wan2skeaf.py also changed to match the ones of wan2skeaf.jl:
-n for --num_electrons, -b for --band_index, -s for
--smearing_type, -w for --width_smearing (prev. smearing_value)

Ensured compatibility of wan2skeaf.jl with the workflow.
In wannierjl, added 2*pi factor for RUC vectors to match measured frequencies

Added energy conversion from eV to Ry in wan2skeaf.jl;
Added Fermi energy in eV to the output parameters;
Modified the parser accordingly.
…f.py description

Fix in wan2skeaf.jl: convergence tolerance for num_electrons set to 1e-6 (default)
…band degeneracy. `occupation_prefactor` should be 1 for SOC calculation, 2 for non SOC calculation without magnetisation
- Modify wan2skeaf.jl such that only the energies written to bxsfs for SKEAF inputs are converted from eV to Ry.
- Fermi energy and min and max band energies are kept in eV in the output for convenience (the units of the original bxsf file).
- Fermi enery in Ry is also printed to the output.
- Add `convert_fermi_energy_eV_to_Ry` flag to the input parameters for the SkeafCalculation and set it to `True` for default protocols.
- This will allow directly specifying Fermi energy in eV when setting up a SkeafWorkChain, then the conversion will be done when preparing the SKEAF input file.
- If Fermi energy for SKEAF calculations is specified in Ry, `convert_fermi_energy_eV_to_Ry` should be set to `False` to skip conversion.

Remove the setup file for the wan2skeaf.jl code
…n the tolerance in number of electrons

- Catch the error in `wan2skeaf.jl` and print it to the output file
- Parse the error message and add new exit code (304) to Wan2skeafCalculation
- Pass `tol_n_elec` parameter to `wan2skeaf.jl` suth that the tolerance in number of electrons can be controlled
- Make `wan2skeaf.jl` output more verbose, print also the parameters that are actually used in the calculation
- Parse additional wan2skeaf output to the `output_parameters`
band_min = minimum(bxsf.E[ib:ib, :, :, :])
band_max = maximum(bxsf.E[ib:ib, :, :, :])
println("Min and max of band $ib : $band_min $band_max")

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe fix the indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Should be fixed now

* When Fermi energy doesn't converge within provided tolerance in number of electrons,
  increase the tolerance by a factor of 2 up to 0.001.
* Print a warning if the initial tolerance is higher than 0.001
* Adjust the parser accordingly, add new output parameters:
  - `tol_n_electrons_initial`
  - `tol_n_electrons_final`

Fix reference test file for SKEAF input parameters
 * Put `convert_fermi_energy_eV_to_Ry` parameter in the right place
@qiaojunfeng
Copy link
Owner

Fantastic, thanks!

@qiaojunfeng qiaojunfeng merged commit 6b5dd90 into qiaojunfeng:main Jun 4, 2024
3 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants