Basis
- class btensor.basis.Basis(argument, *, parent=None, metric=None, name=None, orthonormal=None)[source]
Class to represent a vector space basis, which can be used to define a Tensor object.
- Parameters
argument (int | BasisArgument) – Integer to create a rootbasis or sequence, slice, or array to create a derived basis.
parent (Basis | None) – Parent basis object for the derived basis. If it is None, the basis is a root-basis. Default: None.
metric (np.ndarray | None) – Metric array, representing the inner product of the basis with itself. It is used to raise and lower tensor indices, if the basis is non-orthonormal. Default: None.
name (str | None) – Name of the basis, which is used for string representations of basis objects. Basis names are not required to be unique. Default: None.
orthonormal (bool | None) – Set True, if the basis is orthonormal, i.e. the metric is the identity matrix. If None, the basis is assumed orthonormal if a) it is a root basis without metric or b) it is a derived basis with an orthonormal parent basis, defined in terms of a permutation + selection (slice or 1D sequence). Default: None.
- Return type
None
Methods
Initialize new Basis object.
Returns a previously defined basis based on its ID, if it exists.
Find first common ancestor basis between multiple bases.
Get overlap matrix with another basis as a Tensor.
Get list of parent bases ordered from direct parent to root basis.
Get transformation matrix to another basis as a Tensor with general variance.
Get transformation matrix from another basis as a Tensor with variance (-1, 1).
Get transformation matrix to another basis as a Tensor with variance (-1, 1).
Check if basis is compatible with another basis.
Check if the basis is derived from a second basis.
Check if the basis is parent of a second basis.
True if basis is a root-basis, False otherwise.
Make the smallest orthonormal basis, which spans the intersecting space of both the basis and another basis.
Make a new basis with coefficients or indices in reference to the current basis.
Make the smallest orthonormal basis, which spans both the basis and one or more other bases.
Check if all bases have the same root.
Attributes
Talias of TypeVar('T')
idUnique ID of basis.
is_orthonormalTrue if the basis is orthonormal.
metricMetric matrix, used to raise and lower tensor indices.
nameName of basis.
parentParent of basis or None, if the basis is a root-basis.
rootRoot-basis of the basis or None, if the basis itself is the root-basis.
sizeSize of basis.
spaceSpace spanned by basis.