sisl.supercell module

Define a supercell

This class is the basis of many different objects.

class sisl.supercell.SuperCell(cell, nsc=None)[source]

Bases: object

Object to retain a super-cell and its nested values.

This supercell object handles cell vectors and its supercell mirrors.

Attributes

rcell Returns the reciprocal cell for the SuperCell without 2*np.pi

Methods

append(other, axis) Appends other SuperCell to this grid along axis
center([axis]) Returns center of the SuperCell, possibly with respect to an axis
copy() Returns a copy of the object.
cut(seps, axis) Cuts the cell into several different sections.
is_orthogonal() Returns true if the cell vectors are orthogonal
move(v) Appends additional space in the SuperCell object
offset([isc]) Returns the supercell offset of the supercell index
prepend(other, axis) Prepends other SuperCell to this grid along axis
read(sile, *args, **kwargs) Reads SuperCell from the Sile using Sile.read_sc
rotate(angle, v[, only, radians]) Rotates the supercell, in-place by the angle around the vector
rotatea(angle[, only, radians])
rotateb(angle[, only, radians])
rotatec(angle[, only, radians])
sc_index(sc_off) Returns the integer index in the sc_off list that corresponds to sc_off
scale(scale) Scale lattice vectors
set_nsc([nsc, a, b, c]) Sets the number of supercells in the 3 different cell directions
set_supercell([nsc, a, b, c]) Sets the number of supercells in the 3 different cell directions
swapaxes(a, b) Returns SuperCell with swapped axis
tocell(*args) Returns a 3x3 unit-cell dependent on the input
translate(v) Appends additional space in the SuperCell object

Initialize a SuperCell object from initial quantities

Initialize a SuperCell object with cell information and number of supercells in each direction.

Attributes

rcell Returns the reciprocal cell for the SuperCell without 2*np.pi

Methods

append(other, axis) Appends other SuperCell to this grid along axis
center([axis]) Returns center of the SuperCell, possibly with respect to an axis
copy() Returns a copy of the object.
cut(seps, axis) Cuts the cell into several different sections.
is_orthogonal() Returns true if the cell vectors are orthogonal
move(v) Appends additional space in the SuperCell object
offset([isc]) Returns the supercell offset of the supercell index
prepend(other, axis) Prepends other SuperCell to this grid along axis
read(sile, *args, **kwargs) Reads SuperCell from the Sile using Sile.read_sc
rotate(angle, v[, only, radians]) Rotates the supercell, in-place by the angle around the vector
rotatea(angle[, only, radians])
rotateb(angle[, only, radians])
rotatec(angle[, only, radians])
sc_index(sc_off) Returns the integer index in the sc_off list that corresponds to sc_off
scale(scale) Scale lattice vectors
set_nsc([nsc, a, b, c]) Sets the number of supercells in the 3 different cell directions
set_supercell([nsc, a, b, c]) Sets the number of supercells in the 3 different cell directions
swapaxes(a, b) Returns SuperCell with swapped axis
tocell(*args) Returns a 3x3 unit-cell dependent on the input
translate(v) Appends additional space in the SuperCell object
append(other, axis)[source]

Appends other SuperCell to this grid along axis

cell
center(axis=None)[source]

Returns center of the SuperCell, possibly with respect to an axis

copy()[source]

Returns a copy of the object.

cut(seps, axis)[source]

Cuts the cell into several different sections.

is_orthogonal()[source]

Returns true if the cell vectors are orthogonal

move(v)[source]

Appends additional space in the SuperCell object

n_s
nsc
offset(isc=None)[source]

Returns the supercell offset of the supercell index

prepend(other, axis)[source]

Prepends other SuperCell to this grid along axis

For a SuperCell object this is equivalent to append.

rcell

Returns the reciprocal cell for the SuperCell without 2*np.pi

Note: The returned vectors are still in [0,:] format and not as returned by an inverse LAPACK algorithm.

static read(sile, *args, **kwargs)[source]

Reads SuperCell from the Sile using Sile.read_sc

Parameters:

sile : Sile, str

a Sile object which will be used to read the supercell if it is a string it will create a new sile using get_sile.

rotate(angle, v, only='abc', radians=False)[source]

Rotates the supercell, in-place by the angle around the vector

One can control which cell vectors are rotated by designating them individually with only='[abc]'.

Parameters:

angle : float

the angle of which the geometry should be rotated

v : array_like [3]

the vector around the rotation is going to happen v = [1,0,0] will rotate in the yz plane

radians : bool, False

Whether the angle is in radians (True) or in degrees (False)

only : (‘abc’), str, optional

only rotate the designated cell vectors.

rotatea(angle, only='abc', radians=False)[source]
rotateb(angle, only='abc', radians=False)[source]
rotatec(angle, only='abc', radians=False)[source]
sc_index(sc_off)[source]

Returns the integer index in the sc_off list that corresponds to sc_off

Returns the integer for the supercell

sc_off
scale(scale)[source]

Scale lattice vectors

Parameters:

scale : float

the scale factor for the new lattice vectors

set_nsc(nsc=None, a=None, b=None, c=None)[source]

Sets the number of supercells in the 3 different cell directions

nsc: [3], integer, optional
number of supercells in each direction
a: integer, optional
number of supercells in the first unit-cell vector direction
b: integer, optional
number of supercells in the second unit-cell vector direction
c: integer, optional
number of supercells in the third unit-cell vector direction
set_supercell(nsc=None, a=None, b=None, c=None)

Sets the number of supercells in the 3 different cell directions

nsc: [3], integer, optional
number of supercells in each direction
a: integer, optional
number of supercells in the first unit-cell vector direction
b: integer, optional
number of supercells in the second unit-cell vector direction
c: integer, optional
number of supercells in the third unit-cell vector direction
swapaxes(a, b)[source]

Returns SuperCell with swapped axis

If swapaxes(0,1) it returns the 0 in the 1 values.

classmethod tocell(*args)[source]

Returns a 3x3 unit-cell dependent on the input

If you supply a single argument it is regarded as either a) a proper unit-cell b) the diagonal elements in the unit-cell

If you supply 3 arguments it will be the same as the diagonal elements of the unit-cell

If you supply 6 arguments it will be the same as the cell parameters, a, b, c, alpha, beta, gamma. The angles should be provided in degree (not radians).

translate(v)

Appends additional space in the SuperCell object

vol
class sisl.supercell.SuperCellChild[source]

Bases: object

Class to be inherited by using the self.sc as a SuperCell object

Initialize by a SuperCell object and get access to several different routines directly related to the SuperCell class.

Attributes

cell Returns the inherent SuperCell objects cell
n_s Returns the inherent SuperCell objects n_s
nsc Returns the inherent SuperCell objects nsc
rcell Returns the inherent SuperCell objects rcell
sc_off Returns the inherent SuperCell objects sc_off
vol Returns the inherent SuperCell objects vol

Methods

is_orthogonal() Return true if all cell vectors are linearly independent
sc_index(*args, **kwargs) Call local SuperCell object sc_index function
set_nsc(nsc) Set the number of super-cells in the SuperCell object
set_sc(sc) Overwrites the local supercell
set_supercell(sc) Overwrites the local supercell
cell

Returns the inherent SuperCell objects cell

is_orthogonal()[source]

Return true if all cell vectors are linearly independent

n_s

Returns the inherent SuperCell objects n_s

nsc

Returns the inherent SuperCell objects nsc

rcell

Returns the inherent SuperCell objects rcell

sc_index(*args, **kwargs)[source]

Call local SuperCell object sc_index function

sc_off

Returns the inherent SuperCell objects sc_off

set_nsc(nsc)[source]

Set the number of super-cells in the SuperCell object

set_sc(sc)

Overwrites the local supercell

set_supercell(sc)[source]

Overwrites the local supercell

vol

Returns the inherent SuperCell objects vol