Skip to content

Commit

Permalink
removed geometry_coords argument
Browse files Browse the repository at this point in the history
  • Loading branch information
pfebrer committed Jun 19, 2023
1 parent e30603b commit b3e5453
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/sisl/sparse_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3024,13 +3024,13 @@ def translate2uc(self):

# Get the quotient and remainder of dividing by 1.
# The quotient is the supercell index, the remainder is the coordinates in the unit cell.
current_sc, uc_fcoords = np.divmod(fxyz, 1)
current_sc = fxyz // 1

# Simply translate the atoms to move all atoms to the unit cell. That is, all atoms
# should be moved to supercell (0,0,0).
return self.translate_atoms_sc(-current_sc, geometry_coords=uc_fcoords @ self.cell)
return self.translate_atoms_sc(-current_s)

def translate_atoms_sc(self, sc_translations, geometry_coords=None):
def translate_atoms_sc(self, sc_translations):
"""Translates atoms across supercells.
This operation results in new coordinates of the associated geometry
Expand All @@ -3040,10 +3040,6 @@ def translate_atoms_sc(self, sc_translations, geometry_coords=None):
----------
sc_translations : array of int of shape (na, 3)
For each atom, the displacement in number of supercells along each direction.
geometry_coords : array of float of shape (na, 3), optional
If you already computed the new coordinates of the geometry after the translation,
you can provide them here. Otherwise, they will be computed from the current
coordinates and the supercell translations.
Returns
--------
Expand Down Expand Up @@ -3083,12 +3079,9 @@ def translate_atoms_sc(self, sc_translations, geometry_coords=None):
new_geometry = self.geometry.copy()
new_geometry.set_nsc(new_nsc)

# Update the coordinates of the geometry. If they have been precomputed, we
# have received them as an argument. Otherwise, compute them from the cell
# Update the coordinates of the geometry, according to the cell
# displacements.
if geometry_coords is None:
geometry_coords = new_geometry.xyz + np.dot(sc_translations, new_geometry.cell)
new_geometry.xyz = geometry_coords
new_geometry.xyz = new_geometry.xyz + np.dot(sc_translations, new_geometry.cell)

# Find out supercell indices in this new auxiliary supercell
new_sc = new_geometry.isc_off[isc[:, 0], isc[:, 1], isc[:, 2]]
Expand Down

0 comments on commit b3e5453

Please sign in to comment.