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

Error in finding the little group irreps of SG 230 #19

Open
vg137 opened this issue Mar 8, 2023 · 6 comments
Open

Error in finding the little group irreps of SG 230 #19

vg137 opened this issue Mar 8, 2023 · 6 comments

Comments

@vg137
Copy link

vg137 commented Mar 8, 2023

Hi Thomas,

I was trying to find the little group irreps of SG 230 at the high-symmetry points following the example code in the README file. I get the following error:

ERROR: UndefVarError: i not defined
Stacktrace:
 [1] align_operators!(lgirs::Vector{LGIrrep{3}}, lg::LittleGroup{3})
   @ MPBUtils ~/.julia/packages/MPBUtils/DSQNN/src/read_utils.jl:567
 [2] pick_lgirreps(lgd::Dict{String, LittleGroup{3}}; timereversal::Bool, isprimitive::Bool)
   @ MPBUtils ~/.julia/packages/MPBUtils/DSQNN/src/read_utils.jl:552
 [3] top-level scope
   @ REPL[17]:1

I am new to Julia so I don't know how to debug this.

@thchr
Copy link
Owner

thchr commented Mar 8, 2023

Hi :) thanks for finding this bug! Apparently, there had been a bug in align_operators! - possibly since it was first written. It only surfaced if it actually needed to do something, which is rare, but which must be the case in SG230.

Should be fixed now (you probably need to remove and reinstall the package to get the fix). Let me know if there's still trouble after that.

@thchr thchr closed this as completed Mar 8, 2023
@vg137
Copy link
Author

vg137 commented Mar 9, 2023

Thanks for such a quick response time but now I am getting a different error.

ERROR: could not align operators
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] align_operators!(lgirs::Vector{LGIrrep{3}}, lg::LittleGroup{3})
   @ MPBUtils /projects/physics/vaibhav9/conda_files/envs/new_pmp/share/julia/packages/MPBUtils/gTqBO/src/read_utils.jl:566
 [3] pick_lgirreps(lgd::Dict{String, LittleGroup{3}}; timereversal::Bool, isprimitive::Bool)
   @ MPBUtils /projects/physics/vaibhav9/conda_files/envs/new_pmp/share/julia/packages/MPBUtils/gTqBO/src/read_utils.jl:552
 [4] top-level scope
   @ REPL[10]:1

Please ignore the specific directory locations. I installed julia using conda.

@thchr
Copy link
Owner

thchr commented Mar 9, 2023

Can you send me a self-contained snippet that reproduces the above error? Then I can look at it properly tomorrow. Thanks 👍

@vg137
Copy link
Author

vg137 commented Mar 9, 2023

Sure. Here it is. I just changed the sgnum from the README file examples.

# --- load relevant packages ---
using Crystalline, MPBUtils
using PyCall
mp = pyimport("meep")
mpb = pyimport("meep.mpb")

# --- band representations, littlegroups, & irreps ---
sgnum = 230                                        
brs = bandreps(sgnum)                             # elementary band representations
lgs = littlegroups(sgnum)                         # little groups
filter!(((klab, _),) -> klab ∈ klabels(brs), lgs) # restrict to k-points in `brs`
map!(primitivize, values(lgs))                    # convert to primitive setting
lgirsd = pick_lgirreps(lgs; timereversal=true)    # small irreps associated with `lgs`

@thchr thchr reopened this Mar 9, 2023
@thchr
Copy link
Owner

thchr commented Mar 9, 2023

The issue is that the mapping of primitivized little groups in the line map!(primitivize, values(lgs)) doesn't map in the same way as is done internally in pick_lgirreps. Specifically, in the latter case, we do not reduce translations to the primitive unit cell (since that reduction could change the irrep for nonsymmorphic operations).
As a fix, you could change the line to map!(lg -> primitivize(lg, false), values(lgs)).

I would caution that I have not used MPBUtils.jl for SG 230 much - but I am aware of possible pitfalls that exist in this setting. Specifically, Crystalline.jl - which MPBUtils.jl is built on - has a particular convention choice for the k-sign of Bloch phases in irreps - that convention is inherited from ISOTROPY and Bilbao. Unfortunately, it doesn't really align with the usual convention for operations acting actively. Usually, it doesn't matter but in SG 230 it does matter, e.g. at the P point (which was where the align_operators! was failing).
The fix I used was to manually flip the sign of k when computing irrep data from symmetry data (see here). Very ugly hack but - despite trying - I have not been able to figure out how to correctly change the convention in Crystalline (see thchr/Crystalline.jl#12).

To close issue, I think a reasonable interim fix would be to just update the README.md to the correct primitivizing approach. I should probably open an issue to track the k-sign thing here as well though.

thchr added a commit that referenced this issue Mar 9, 2023
@thchr
Copy link
Owner

thchr commented Mar 9, 2023

For now, fixed by f577221.

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

No branches or pull requests

2 participants