pwtools.crys.scell

pwtools.crys.scell(obj, dims, method=1, **kwds)[source]

Build supercell based on dims.

Uses coords_frac and cell.

Parameters:
  • obj (Structure or Trajectory)

  • dims (tuple (nx, ny, nz) for a N = nx * ny * nz supercell)

  • method (int, optional) – Switch between numpy-ish (1) or loop (2) implementation. (2) should always produce correct results but is sublty slower. Only for Structure.

  • **kwds (see scell_mask())

Notes

The mask for the supercell is created by scell_mask() and applied to each atom in obj one after another, i.e. each atom is repeated nx*ny*nz times according to the mask pattern, independently of how the pattern looks like (e.g. the direc parameter in scell_mask()). So, just as rows in np.repeat(), we have:

original: symbols=[A,B,C,D]
2 x 1 x 1: symbols=[A,A,B,B,C,C,D,D]
nx x ny x nz: symbols=[(nx*ny*nz) x A, (nx*ny*nz) x B, …]
Returns:

scell

Return type:

Structure