sisl.physics.Coefficient
- class sisl.physics.Coefficient(c, parent=None, **info)
Bases:
ParentContainer
An object holding coefficients for a parent with info
- Parameters:
Methods
copy
()Return a copy (only the coefficients are copied).
degenerate
(atol)Find degenerate coefficients with a specified precision
iter
([asarray])An iterator looping over the coefficients in this system
remove
(index[, inplace])Return a new coefficient without the specified coefficients
sub
(index[, inplace])Return a new coefficient with only the specified coefficients
Attributes
The data-type of the coefficient (in str)
Data-type for the coefficients
Returns the shape of the coefficients
- copy() Coefficient
Return a copy (only the coefficients are copied).
parent
andinfo
are passed by reference
- degenerate(atol: float)[source]
Find degenerate coefficients with a specified precision
- Parameters:
atol – the precision above which coefficients are not considered degenerate
- Returns:
list
ofnumpy.ndarray
– a list of indices
- 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.
- remove(index: sisl.typing.SimpleIndex, inplace: bool = False) Coefficient | None
Return a new coefficient without the specified coefficients
- Parameters:
index – indices that are removed in the returned object
inplace – whether the values will be removed inplace
- Returns:
Coefficient
– a new coefficient without containing the requested elements
- sub(index: sisl.typing.SimpleIndex, inplace: bool = False) Coefficient | None
Return a new coefficient with only the specified coefficients
- Parameters:
index – indices that are retained in the returned object
inplace – whether the values will be retained inplace
- Returns:
Coefficient
– a new coefficient only containing the requested elements, only if inplace is false
- c
- property dkind
The data-type of the coefficient (in str)
- property dtype
Data-type for the coefficients
- info
- parent
- property shape
Returns the shape of the coefficients