Skip to content

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

Closed
@DanielYang59

Description

@DanielYang59

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions