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

Update commensurability warning #37

Merged
merged 6 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions easyunfold/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def generate(pc_file, code, sc_file, matrix, kpoints, time_reversal, out_file, n

if matrix:
transform_matrix = matrix_from_string(matrix)
if not np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=2e-2): # 2% mismatch tolerance
if np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=5e-2): # 2-5% mismatch
if not np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=2e-2): # 2% mismatch tolerance
zhubonan marked this conversation as resolved.
Show resolved Hide resolved
if np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=5e-2): # 2-5% mismatch
click.echo(_quantitative_inaccuracy_warning)
else:
click.echo(_incommensurate_warning)
Expand All @@ -102,7 +102,7 @@ def generate(pc_file, code, sc_file, matrix, kpoints, time_reversal, out_file, n
tmp = supercell.cell @ np.linalg.inv(primitive.cell)
transform_matrix = np.rint(tmp)
if not np.allclose(tmp, transform_matrix, rtol=2e-2): # 2% mismatch tolerance
if np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=5e-2): # 2-5% mismatch
if np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=5e-2): # 2-5% mismatch
click.echo(_quantitative_inaccuracy_warning)
else:
click.echo(_incommensurate_warning)
Expand Down