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

[BUG] Missing () in electronic_structure.boltztrap.BoltztrapAnalyzer.get_extreme.is_isotropic #4165

Open
DanielYang59 opened this issue Nov 11, 2024 · 0 comments

Comments

@DanielYang59
Copy link
Contributor

DanielYang59 commented Nov 11, 2024

Seemingly missing () in 744c7db:

def is_isotropic(x, isotropy_tolerance) -> bool:
"""Internal method to tell you if 3-vector "x" is isotropic.
Args:
x: the vector to determine isotropy for
isotropy_tolerance: tolerance, e.g. 0.05 is 5%
"""
if len(x) != 3:
raise ValueError("Invalid input to is_isotropic!")
st = sorted(x)
return bool(
all([st[0], st[1], st[2]])
and (abs((st[1] - st[0]) / st[1]) <= isotropy_tolerance)
and (abs(st[2] - st[0]) / st[2] <= isotropy_tolerance)
and (abs((st[2] - st[1]) / st[2]) <= isotropy_tolerance)
)

- and (abs(st[2] - st[0]) / st[2] <= isotropy_tolerance) 
+ and (abs((st[2] - st[0]) / st[2]) <= isotropy_tolerance) 

i.e.:

- abs(a) / b <= tol
+ abs(a / b) <= tol

Otherwise any vector with a negative z component would be considered isotropic along z direction.

Can you please comment on this? @computron

@DanielYang59 DanielYang59 changed the title [BUG] Typo in electronic_structure.boltztrap.BoltztrapAnalyzer.get_extreme.is_isotropic [BUG] Missing () in electronic_structure.boltztrap.BoltztrapAnalyzer.get_extreme.is_isotropic Nov 11, 2024
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

1 participant