Tensor
- class libadcc.Tensor(self: libadcc.Tensor, symmetry: libadcc.Symmetry)
Bases:
pybind11_objectConstruct a Tensor object using a Symmetry object describing its symmetry properties. The returned object is not guaranteed to contain initialised memory. Python binding to
libadcc::TensorAttributes Summary
Does the tensor need evaluation or is it fully evaluated and resilient in memory.
Methods Summary
antisymmetrise(*args, **kwargs)Overloaded function.
copy(self)Returns a deep copy of the tensor.
describe_expression(*args, **kwargs)Overloaded function.
describe_symmetry(self)Return a string providing a hopefully descriptive representation of the symmetry information stored inside the tensor.
diagonal(self, *args)dot(*args, **kwargs)Overloaded function.
empty_like(self)evaluate(self)Ensure the tensor to be fully evaluated and resilient in memory.
is_allowed(self, idcs)Is a particular index allowed by symmetry
nosym_like(self)ones_like(self)select_n_absmax(self, n)Select the n absolute maximal elements.
select_n_absmin(self, n)Select the n absolute minimal elements.
select_n_max(self, n)Select the n maximal elements.
select_n_min(self, n)Select the n minimal elements.
set_from_ndarray(*args, **kwargs)Overloaded function.
set_immutable(self)Set the tensor as immutable, allowing some optimisations to be performed.
set_mask(self, mask, value)Set all elements corresponding to an index mask, which is given by a string eg.
set_random(self)Set all tensor elements to random data, adhering to the internal symmetry.
symmetrise(*args, **kwargs)Overloaded function.
to_ndarray(self)Export the tensor data to a standard np::ndarray by making a copy.
transpose(*args, **kwargs)Overloaded function.
zeros_like(self)Attributes Documentation
- T
- flags
- mutable
- ndim
- needs_evaluation
Does the tensor need evaluation or is it fully evaluated and resilient in memory.
- shape
- size
- space
- subspaces
Methods Documentation
- antisymmetrise(*args, **kwargs)
Overloaded function.
antisymmetrise(self: libadcc.Tensor, permutations: collections.abc.Iterable[int] | collections.abc.Iterable[collections.abc.Iterable[int]]) -> libadcc.Tensor
antisymmetrise(self: libadcc.Tensor, *args: int) -> libadcc.Tensor
- copy(self: libadcc.Tensor) libadcc.Tensor
Returns a deep copy of the tensor.
- describe_expression(*args, **kwargs)
Overloaded function.
describe_expression(self: libadcc.Tensor, stage: str) -> str
Return a string providing a hopefully descriptive representation of the tensor expression stored inside the object.
describe_expression(self: libadcc.Tensor) -> str
- describe_symmetry(self: libadcc.Tensor) str
Return a string providing a hopefully descriptive representation of the symmetry information stored inside the tensor.
- diagonal(self: libadcc.Tensor, *args: int) libadcc.Tensor
- dot(*args, **kwargs)
Overloaded function.
dot(self: libadcc.Tensor, other: libadcc.Tensor) -> float
dot(self: libadcc.Tensor, tensors: list[libadcc.Tensor]) -> numpy.ndarray[tuple[int], numpy.dtype[numpy.float64]]
- empty_like(self: libadcc.Tensor) libadcc.Tensor
- evaluate(self: libadcc.Tensor) libadcc.Tensor
Ensure the tensor to be fully evaluated and resilient in memory. Usually happens automatically when needed. Might be useful for fine-tuning, however.
- is_allowed(self: libadcc.Tensor, idcs: tuple[SupportsInt | SupportsIndex, ...]) bool
Is a particular index allowed by symmetry
- nosym_like(self: libadcc.Tensor) libadcc.Tensor
- ones_like(self: libadcc.Tensor) libadcc.Tensor
- select_n_absmax(self: libadcc.Tensor, n: SupportsInt | SupportsIndex) list[tuple[list[int], float]]
Select the n absolute maximal elements.
- select_n_absmin(self: libadcc.Tensor, n: SupportsInt | SupportsIndex) list[tuple[list[int], float]]
Select the n absolute minimal elements.
- select_n_max(self: libadcc.Tensor, n: SupportsInt | SupportsIndex) list[tuple[list[int], float]]
Select the n maximal elements.
- select_n_min(self: libadcc.Tensor, n: SupportsInt | SupportsIndex) list[tuple[list[int], float]]
Select the n minimal elements.
- set_from_ndarray(*args, **kwargs)
Overloaded function.
set_from_ndarray(self: libadcc.Tensor, in_array: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> libadcc.Tensor
Set all tensor elements from a standard np::ndarray by making a copy.
set_from_ndarray(self: libadcc.Tensor, in_array: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symmetry_tolerance: typing.SupportsFloat | typing.SupportsIndex) -> libadcc.Tensor
Set all tensor elements from a standard np::ndarray by making a copy. Provide an optional tolerance argument to increase the tolerance for the check for symmetry consistency.
- set_immutable(self: libadcc.Tensor) None
Set the tensor as immutable, allowing some optimisations to be performed.
- set_mask(self: libadcc.Tensor, mask: str, value: SupportsFloat | SupportsIndex) None
Set all elements corresponding to an index mask, which is given by a string eg. ‘iijkli’ sets elements T_{iijkli}
- set_random(self: libadcc.Tensor) libadcc.Tensor
Set all tensor elements to random data, adhering to the internal symmetry.
- symmetrise(*args, **kwargs)
Overloaded function.
symmetrise(self: libadcc.Tensor, permutations: collections.abc.Iterable[int] | collections.abc.Iterable[collections.abc.Iterable[int]]) -> libadcc.Tensor
symmetrise(self: libadcc.Tensor, *args: int) -> libadcc.Tensor
- to_ndarray(self: libadcc.Tensor) numpy.typing.NDArray[numpy.float64]
Export the tensor data to a standard np::ndarray by making a copy.
- transpose(*args, **kwargs)
Overloaded function.
transpose(self: libadcc.Tensor) -> libadcc.Tensor
transpose(self: libadcc.Tensor, axes: tuple[typing.SupportsInt | typing.SupportsIndex, …]) -> libadcc.Tensor
- zeros_like(self: libadcc.Tensor) libadcc.Tensor