hTensor-0.1.0: Multidimensional arrays and simple tensor computations.Source codeContentsIndex
Numeric.LinearAlgebra.Tensor
Stabilityexperimental
MaintainerAlberto Ruiz <aruiz@um.es>
Contents
The Tensor type
Tensor creation utilities
Index manipulation
General array operations
Description
Tensor computations. Indices can only be contracted if they are of different Variant type.
Synopsis
type Tensor t = NArray Variant t
data Variant
= Co
| Contra
listTensor :: Coord t => [Int] -> [t] -> Tensor t
superindex :: Coord t => Name -> [Tensor t] -> Tensor t
subindex :: Coord t => Name -> [Tensor t] -> Tensor t
vector :: [Double] -> Tensor Double
covector :: [Double] -> Tensor Double
transf :: [[Double]] -> Tensor Double
switch :: Tensor t -> Tensor t
cov :: NArray i t -> Tensor t
contrav :: NArray i t -> Tensor t
forget :: NArray i t -> Array t
module Numeric.LinearAlgebra.Array
The Tensor type
type Tensor t = NArray Variant tSource
data Variant Source
Constructors
Co
Contra
show/hide Instances
listTensorSource
:: Coord t
=> [Int]coordinates
-> [t]
-> Tensor t
Creates a tensor from a list of dimensions and a list of coordinates. A positive dimension means that the index is assumed to be contravariant (vector-like), and a negative dimension means that the index is assumed to be covariant (like a linear function, or covector). Contractions can only be performed between indices of different type.
Tensor creation utilities
superindex :: Coord t => Name -> [Tensor t] -> Tensor tSource
Create an Tensor from a list of parts with a contravariant index (superindex = newIndex Contra).
subindex :: Coord t => Name -> [Tensor t] -> Tensor tSource
Create an Tensor from a list of parts with a covariant index (subindex = newIndex Co).
vector :: [Double] -> Tensor DoubleSource
Create a contravariant rank-1 tensor from a list of coordinates.
covector :: [Double] -> Tensor DoubleSource
Create a covariant rank-1 tensor from a list of coordinates.
transf :: [[Double]] -> Tensor DoubleSource
Create a 1-contravariant, 1-covariant rank-2 tensor from list of lists of coordinates.
Index manipulation
switch :: Tensor t -> Tensor tSource
Change the Variant nature of all dimensions to the opposite ones.
cov :: NArray i t -> Tensor tSource
Make all dimensions covariant.
contrav :: NArray i t -> Tensor tSource
Make all dimensions contravariant.
forget :: NArray i t -> Array tSource
Remove the Variant nature of coordinates.
General array operations
module Numeric.LinearAlgebra.Array
Produced by Haddock version 2.6.0