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

trying to fix the within_inf problem #850

Merged
merged 3 commits into from
Oct 24, 2024
Merged

trying to fix the within_inf problem #850

merged 3 commits into from
Oct 24, 2024

Conversation

zerothi
Copy link
Owner

@zerothi zerothi commented Oct 23, 2024

Basically the isc did not respect the initial placement of the atomic coordinates, so if atoms were already outside of the unit-cell, then isc would be wrong.

@pfebrer I think this corrects your remarks in #649.
Comments?

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.89%. Comparing base (bc41504) to head (e774c5a).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/sisl/_core/_ufuncs_geometry.py 66.66% 1 Missing ⚠️
src/sisl/_core/geometry.py 95.45% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #850   +/-   ##
=======================================
  Coverage   86.89%   86.89%           
=======================================
  Files         403      403           
  Lines       52434    52450   +16     
=======================================
+ Hits        45561    45577   +16     
  Misses       6873     6873           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pfebrer
Copy link
Contributor

pfebrer commented Oct 24, 2024

This fixes the first code snippet in #649, but not the second one 😅

By the way, before getting this in, we have to remove these lines:

# within_inf translates atoms to the unit cell to compute
# supercell indices. Here we revert that
ISC -= np.floor(self.fxyz[IA]).astype(int32)

@zerothi
Copy link
Owner Author

zerothi commented Oct 24, 2024

This fixes the first code snippet in #649, but not the second one 😅

By the way, before getting this in, we have to remove these lines:

# within_inf translates atoms to the unit cell to compute
# supercell indices. Here we revert that
ISC -= np.floor(self.fxyz[IA]).astype(int32)

I think I tried that, but I'll double check! Thanks for the heads up of the blob, I'll add this to this PR then!

Basically the isc did not respect the initial placement of the
atomic coordinates, so if atoms were already outside
of the unit-cell, then isc would be wrong.

Signed-off-by: Nick Papior <[email protected]>
Skewed cells will deliberatily move them to
outside supercells, rounding should be preferred.

Signed-off-by: Nick Papior <[email protected]>
@zerothi zerothi merged commit b82cf42 into main Oct 24, 2024
17 checks passed
@zerothi zerothi deleted the 649-within-inf branch October 24, 2024 12:08
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 this pull request may close these issues.

within_inf returns wrong supercell indices?
2 participants