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

irrepInstallRequirements #29

Merged
merged 3 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 10 additions & 261 deletions README.md

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions banduppy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
__version__ = "0.3.2"
__version__ = "0.3.3"


import irrep
if irrep.__version__ <"1.6.2" :
raise ImportError("A critical bug was found in irrep-1.6.1, which caused incorrect results for unfolding with spin-orbit. Please ipdate irrep to 1.6.2 or newer (when available)")
if not ('1.6.2' <= irrep.__version__ <= '1.8.3'):
raise ImportError("Critical bugs found in irrep-1.6.1 and >1.8.3 versions. We request BandUPpy users to use irrep-1.8.3 until the next release of the irrep package.")

from irrep.bandstructure import BandStructure


from irrep.bandstructure import BandStructure

from .unfolding import Unfolding, Properties, SaveBandStructuredata, Plotting
Expand Down
14 changes: 8 additions & 6 deletions banduppy/src/unfolding.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ def _generate_kpoints_line(self, irrep_bandstr_instance, pc_kpts_coord,
Primitive cell k-points line path for unfolded bandstructure.

"""
# Supercell lattice vectors
sc_lattice = irrep_bandstr_instance.Lattice
# Convert k-points in inverse lattice unit
# Note: (A.T^-1)^-1 == T.A^-1
RecLattice = 2*np.pi*np.dot(transformation_matrix, np.linalg.pinv(sc_lattice)).T
KPcart = np.dot(pc_kpts_coord, RecLattice)
# Supercell lattice vectors in real space
real_lattice_sc = irrep_bandstr_instance.Lattice
# Reciprocal lattice super cell
reciprocal_lattice_sc = 2*np.pi*np.linalg.pinv(real_lattice_sc).T
# Reciprocal lattice primitive cell
reciprocal_lattice_pc = transformation_matrix.T @ reciprocal_lattice_sc
# Convert k-points to inverse angstrom unit
KPcart = np.dot(pc_kpts_coord, reciprocal_lattice_pc)
#KPcart = np.linalg.solve(np.dot(sc_lattice, np.linalg.pinv(transformation_matrix)), pc_kpts_coord.T).T # without 2*pi

# Generate distance array
Expand Down
33 changes: 33 additions & 0 deletions docs/FAQs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Frequently Asked Questions

## ============================================================
__Question:__ I am getting `RuntimeError` in one of my calculations using VASP. How can I resolve this?

`RuntimeError: *** error - computed ncnt=18134 != input nplane=18133`

**Answer**: VASP does not write which plane waves it uses to the `WAVECAR` file. Therefore, when `banduppy` (specifically `IrRep`) reads the band structure, it tries to mimic `VASP`'s selection and ordering of plane waves that fall within the cut-off sphere. Occasionally, due to numerical errors, one code might consider a plane wave within the sphere while the other does not. This discrepancy can result in an extra vector, as seen in the above case. To address this, use a small correction coefficient (`_correct_Ecut0`) value. This slightly adjusts the `Ecut` to either exclude or include plane waves near the boundary of the cut-off sphere. In the example case, use small negative correction to exclude plane waves near the boundary of the cut-off sphere. Use small positive correction when `computed ncnt < input nplane`.

`bands = banduppy.BandStructure(code="vasp", spinor=spinorbit, fPOS = "POSCAR", fWAV = "WAVECAR", _correct_Ecut0=-1e-7)`

## ============================================================

## ============================================================
__Question:__ BandUP code needed both the primitive unit cell and supercell POSCAR files. But in Banduppy it seems only POSCAR_SC is needed. What do I need to modify if I want to do calculations with a different primitiveunit cell and where does it come?

__Answer:__ In a broader sense, for unfolding, we need to know the relationship between the supercell and the reference primitive unit cells on which we want to project your supercell eigenstates. Mathematically, they are related by a matrix transformation: A = M.a. Here, the primitive cell lattice vectors (a_i) (i = 1, 2, 3) form the building unit for the supercell vectors ( A_i), and the two sets of basis vectors are related by the transformation matrix M.

Now, we can provide the primitive unit cell POSCAR (for a) and supercell POSCAR (for A), and software internally calculates the relation between them (M). => BandUP
Alternatively, we can provide the supercell POSCAR (A) and the transformation matrix (M) as inputs, and software internally calculates the reference primitive cell (a). => BandUPpy

The information required is essentially the same for BandUP and BandUPpy, only alternative ways.

Regarding the necessary modifications for different reference primitive unit cell calculations: you need to adjust the 'super_cell_size' parameter in for example the run_banduppy_vasp.py, which is the primitive-to-supercell transformation matrix.
## ============================================================

If you are not satisfied with the answers, cannot find an answer to your question, or have new suggestions, please feel free to reach out to us. We are committed to providing the best experience for our users and greatly value your feedback.


__Have fun with BandUPpy!__

__Best wishes,__
__The BandUPpy Team__
File renamed without changes.
11 changes: 8 additions & 3 deletions RELEASE.md → docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
__Latest release: v0.3.2__
__Latest release: v0.3.3__

__v0.3.3__

* Bug fix unfolding kpline in A^-1
* Updated install requirements. Bug found in irrep-1.9.0 and 1.9.1.

__v0.3.2__

* Bug fix for PC band path cartesian coordinate conversion
* Bug fix for PC band path Cartesian coordinate conversion
* Improved band structures plotting
* Implemented plotting band centers at each SCF cycles
* Implemened save band structure data independently
* Implemented effective mass modules
* Added version track file
* Added bibliograpy file (.bib) for referencing
* Added bibliography file (.bib) for referencing
* Added tips and tricks in README
* Documentation improved

Expand Down
Loading