Coefficient

class sisl.physics.Coefficient(c, parent=None, **info)[source]

An object holding coefficients for a parent with info

Parameters
carray_like

coefficients

parentobj, optional

a parent object that defines the origin of the coefficient

**infodict, optional

an info dictionary that turns into an attribute on the object. This info may contain anything that may be relevant for the coefficient.

Attributes
cndarray

coefficients

infodict

information regarding the creation of these coefficients

parentobj

object from where the coefficients has been calculated, in one way or the other

Attributes

c

dkind

The data-type of the coefficient (in str)

dtype

Data-type for the coefficients

info

parent

shape

Returns the shape of the coefficients

Methods

__init__(self, c[, parent])

Initialize self.

copy(self)

Return a copy (only the coefficients are copied).

degenerate(self, eps)

Find degenerate coefficients with a specified precision

iter(self[, asarray])

An iterator looping over the coefficients in this system

sub(self, idx)

Return a new coefficient with only the specified coefficients

c
copy(self)[source]

Return a copy (only the coefficients are copied). parent and info are passed by reference

degenerate(self, eps)[source]

Find degenerate coefficients with a specified precision

Parameters
epsfloat

the precision above which coefficients are not considered degenerate

Returns
list of numpy.ndarraya list of indices
property dkind

The data-type of the coefficient (in str)

property dtype

Data-type for the coefficients

info
iter(self, asarray=False)[source]

An iterator looping over the coefficients in this system

Parameters
asarraybool, optional

if true the yielded values are the coefficient vectors, i.e. a numpy array. Otherwise an equivalent object is yielded.

Yields
coeffCoefficent

the current coefficent as an object, only returned if asarray is false.

coeffnumpy.ndarray

the current the coefficient as an array, only returned if asarray is true.

parent
property shape

Returns the shape of the coefficients

sub(self, idx)[source]

Return a new coefficient with only the specified coefficients

Parameters
idxint or array_like

indices that are retained in the returned object

Returns
Coefficient

a new coefficient only containing the requested elements