Skip to content

Commit

Permalink
bug: fixed zerothi#102
Browse files Browse the repository at this point in the history
I am not sure this will solve all problems.
Basically the problem I encountered refers
to systems where sc.origo is defined, that variable
does not have a unified meaning, but really should have.
  • Loading branch information
zerothi authored and pfebrer committed Sep 8, 2021
1 parent 49f355a commit 2a85ccd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sisl/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4095,8 +4095,8 @@ def within_inf(self, sc, periodic=None, tol=1e-5, origo=None):
length tolerance for the fractional coordinates to be on a duplicate site (in Ang).
This allows atoms within `tol` of the cell boundaries to be taken as *inside* the
cell.
origo : (3, ) of float
origo that is the basis for comparison
origo : (3,) of float, optional
origo that is the basis for comparison, default to 0.
Returns
-------
Expand Down
3 changes: 3 additions & 0 deletions sisl/physics/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,9 @@ def wavefunction(v, grid, geometry=None, k=None, spinor=0, spin=None, eta=None):
geometry = grid.geometry
if geometry is None:
raise SislError("wavefunction: did not find a usable Geometry through keywords or the Grid!")
# Ensure coordinates are in the primary unit-cell, regardless of origo etc.
geometry = geometry.copy()
geometry.xyz = (geometry.fxyz % 1) @ geometry.sc.cell

# In case the user has passed several vectors we sum them to plot the summed state
if v.ndim == 2:
Expand Down

0 comments on commit 2a85ccd

Please sign in to comment.