9. Linear algebraΒΆ
Currently, Cytnx supports the following linear algebra functions. See the API documentation for more details.
func |
Inplace |
CPU |
GPU |
Called by Tn |
Tn |
CyTn (xlinalg) |
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
x |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
Y |
Y |
x |
|
x |
Y |
Y |
Y |
Y |
Y |
|
x |
Y |
Y |
N |
Y |
Y |
|
InvM_ |
Y |
Y |
Y |
Y |
N |
|
Inv_ |
Y |
Y |
Y |
Y |
N |
|
Conj_ |
Y |
Y |
Y |
Y |
Y |
|
Exp_ |
Y |
Y |
Y |
Y |
N |
|
Expf_ |
Y |
Y |
Y |
Y |
N |
|
x |
Y |
Y |
Y |
Y |
N |
|
x |
Y |
Y |
N |
Y |
Y |
|
x |
Y |
N |
N |
Y |
Y |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
N |
N |
Y |
N |
|
x |
Y |
N |
N |
Y |
N |
|
x |
Y |
Y |
Y |
Y |
N |
|
x |
Y |
Y |
N |
Y |
N |
|
x |
Y |
N |
N |
Y |
N |
|
Pow_ |
Y |
Y |
Y |
Y |
Y |
|
Abs_ |
Y |
N |
Y |
Y |
N |
|
x |
Y |
N |
N |
Y |
Y |
|
x |
Y |
N |
N |
Y |
N |
|
x |
Y |
N |
Y |
Y |
N |
|
x |
Y |
N |
Y |
Y |
N |
|
x |
Y |
N |
Y |
Y |
Y |
Inplace: If the function applies inplacely to the input tensor, and the corresponding function to use if it does.
CPU/GPU: If it is supported for input tensors on that device.
Called by Tn: If the function can be called as a member function of the tensor object, e.g. Tensor1.add(Tensor2)
Tn: If the function supports the Cytnx.Tensor as input.
CyTn: If the function supports the Cytnx.UniTensor as input.
(*): This is a high level linalg.
Many linear algebra functions can be used with Tensors and UniTensors. Most of the linear algebra algorithms take a matrix as an input. We use Rowrank to specify how to cast the input UniTensor into a matrix. See Rowrank as well for an example of how to calculate a singular value decomposition of a UniTensor.