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

ComplexWarning on spin_moment() #360

Closed
pfebrer opened this issue Jul 18, 2021 · 1 comment · Fixed by #363
Closed

ComplexWarning on spin_moment() #360

pfebrer opened this issue Jul 18, 2021 · 1 comment · Fixed by #363

Comments

@pfebrer
Copy link
Contributor

pfebrer commented Jul 18, 2021

When I use spin_moment, I get a numpy ComplexWarning.

This is annoying but it is not super bad. However, when I run a parallel calculation on the BZ, I get a ComplexWarning for each k point, since numpy can't realize it has already issued this warning. Then it gets really bad 😅

Substituting

s[i, 2] = D[0, 0] - D[1, 1]
by

s[i, 2] = (D[0, 0] - D[1, 1]).real

removes the warning, but I don't know if it's the correct fix.

@zerothi
Copy link
Owner

zerothi commented Aug 2, 2021

Thanks, correct fix, could you please make a pr?

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 a pull request may close this issue.

2 participants