sisl.physics.Coefficient

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

Bases: sisl.physics.ParentContainer

An object holding coefficients for a parent with info

c

coefficients

Type

numpy.ndarray

info

information regarding the creation of these coefficients

Type

dict

parent

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

Type

obj

Parameters
  • c (array_like) – coefficients

  • parent (obj, optional) – a parent object that defines the origin of the coefficient

  • **info (dict, optional) – an info dictionary that turns into an attribute on the object. This info may contain anything that may be relevant for the coefficient.

Methods

copy()

Return a copy (only the coefficients are copied).

degenerate([eps])

Find degenerate coefficients with a specified precision

iter([asarray])

An iterator looping over the coefficients in this system

remove(idx[, inplace])

Return a new coefficient without the specified coefficients

sub(idx[, inplace])

Return a new coefficient with only the specified coefficients

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

__init__(c, parent=None, **info)[source]
c
copy()[source]

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

degenerate(eps=1e-08)[source]

Find degenerate coefficients with a specified precision

Parameters

eps (float, optional) – the precision above which coefficients are not considered degenerate

Returns

a list of indices

Return type

list of numpy.ndarray

property dkind

The data-type of the coefficient (in str)

property dtype

Data-type for the coefficients

info
iter(asarray=False)[source]

An iterator looping over the coefficients in this system

Parameters

asarray (bool, optional) – if true the yielded values are the coefficient vectors, i.e. a numpy array. Otherwise an equivalent object is yielded.

Yields
  • coeff (Coefficent) – the current coefficent as an object, only returned if asarray is false.

  • coeff (numpy.ndarray) – the current the coefficient as an array, only returned if asarray is true.

parent
remove(idx, inplace=False)[source]

Return a new coefficient without the specified coefficients

Parameters
  • idx (int or array_like) – indices that are removed in the returned object

  • inplace (bool, optional) – whether the values will be removed inplace

Returns

a new coefficient without containing the requested elements

Return type

Coefficient

property shape

Returns the shape of the coefficients

sub(idx, inplace=False)[source]

Return a new coefficient with only the specified coefficients

Parameters
  • idx (int or array_like) – indices that are retained in the returned object

  • inplace (bool, optional) – whether the values will be retained inplace

Returns

a new coefficient only containing the requested elements, only if inplace is false

Return type

Coefficient