[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Tensor Spaces

In Magma a tensor space is a parent type for tensors. It behaves as a module but also maintains an interpretation of its elements as a multilinear map. Each tensor space further maintains a tensor category which is assigned to its tensors.

Subsections

Constructions of Tensor and Cotensor Spaces

Universal Tensor Spaces

Construction of universal tensor spaces is modeled after construction of free modules and matrix spaces. For efficiency reasons, the actual representation may vary based on the parameters, e.g. it may be a space of structure constants, black-box functions, or systems of forms. So access to the tensors in these tensor space should be made through the provided functions.

KTensorSpace(K, S) : Fld, [RngIntElt] -> TenSpc
KTensorSpace(K, S, C) : Fld, [RngIntElt], TenCat -> TenSpc
For a field K and sequence S=[dv, ..., d0], returns the universal tensor space homK(Kdv, ... , homK(Kd1, Kd0) ... ) isomorphic to Kdv ... d0 with covariant tensor category given by C. The default is Albert's homotopism category.
RTensorSpace(R, S) : Rng, [RngIntElt] -> TenSpc
RTensorSpace(R, S, C) : Rng, [RngIntElt], TenCat -> TenSpc
For a commutative and unital ring R and sequence S=[dv, ..., d0], returns the universal tensor space homR(Rdv, ... , homR(Rd1, Rd0) ... ) isomorphic to Rdv ... d0 with covariant tensor category given by C. The default is Albert's homotopism category.
TensorSpace(S) : [ModRng] -> TenSpc
TensorSpace(S) : [ModTupRng] -> TenSpc
TensorSpace(S) : [ModMatRng] -> TenSpc
TensorSpace(S) : List -> TenSpc
TensorSpace(S, C) : [ModRng], TenCat -> TenSpc
TensorSpace(S, C) : [ModTupRng], TenCat -> TenSpc
TensorSpace(S, C) : [ModMatRng], TenCat -> TenSpc
TensorSpace(S, C) : List, TenCat -> TenSpc
Given a sequence S=[Uv, ..., U0] of K-modules returns a universal tensor space equivalent to homK(Uv tensor K ... tensor K U1, U0) with covariant tensor category given by C. The default is Albert's homotopism category.
TensorSpace(V, p, q) : ModTupFld, RngIntElt, RngIntElt -> TenSpc
TensorSpace(K, d, p, q) : Fld, RngIntElt, RngIntElt, RngIntElt -> TenSpc
Returns the signatured (p, q)-tensor space over the vector space V=Kd. The first p indices are covariant and the last q indices are contravariant. This is functionally equivalent to creating a universal tensor space from the sequence [V, ..., p V, V * , ..., q V * ] and the tensor category with arrows [1, ..., p 1, - 1, ..., q - 1] and duplicates {{p + q, ..., 1 + q}, {q, ..., 1}, {0}}.

Example Multilinear_TenSpc_Const (H61E20)

> TS := KTensorSpace(Rationals(),[ i : i in [3..7] ]);
> TS;
Tensor space of dimension 2520 over Rational Field with 
valence 4
U4 : Full Vector space of degree 3 over Rational Field
U3 : Full Vector space of degree 4 over Rational Field
U2 : Full Vector space of degree 5 over Rational Field
U1 : Full Vector space of degree 6 over Rational Field
U0 : Full Vector space of degree 7 over Rational Field
> 
> TS.1;
Tensor of valence 4, U4 x U3 x U2 x U1 >-> U0
U4 : Full Vector space of degree 3 over Rational Field
U3 : Full Vector space of degree 4 over Rational Field
U2 : Full Vector space of degree 5 over Rational Field
U1 : Full Vector space of degree 6 over Rational Field
U0 : Full Vector space of degree 7 over Rational Field
Give a tensor space a frame.

> R := pAdicRing(3,6);
> Fr := [RSpace(R,5), sub<RSpace(R,3)|[0,1,0],[0,0,1]>,
>   RSpace(R,2)];
> TS := TensorSpace(Fr);
> TS;
Tensor space of dimension 20 over 3-adic ring mod 3^6 with 
valence 2
U2 : Full RSpace of degree 5 over pAdicRing(3, 6)
U1 : RSpace of degree 3, dimension 2 over pAdicRing(3, 6)
Generators:
(0 1 0)
(0 0 1)
Echelonized basis:
(0 1 0)
(0 0 1)
U0 : Full RSpace of degree 2 over pAdicRing(3, 6)
> 
> TS.10;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full RSpace of degree 5 over pAdicRing(3, 6)
U1 : RSpace of degree 3, dimension 2 over pAdicRing(3, 6)
Generators:
(0 1 0)
(0 0 1)
Echelonized basis:
(0 1 0)
(0 0 1)
U0 : Full RSpace of degree 2 over pAdicRing(3, 6)
With signatured tensor spaces, the tensor category is not immediately obvious at print out. Instead, one can glean categorical information using TensorCategory on a tensor space.

> TS := TensorSpace( VectorSpace(GF(3),3), 2, 4 );
> TS;
Tensor space of dimension 729 over GF(3) with valence 6
U6 : Full Vector space of degree 3 over GF(3)
U5 : Full Vector space of degree 3 over GF(3)
U4 : Full Vector space of degree 3 over GF(3)
U3 : Full Vector space of degree 3 over GF(3)
U2 : Full Vector space of degree 3 over GF(3)
U1 : Full Vector space of degree 3 over GF(3)
U0 : Full Vector space of degree 1 over GF(3)
> 
> TensorCategory(TS);
Tensor category of Valence 6 (<-,<-,->,->,->,->,==)
({ 0 },{ 5 .. 6 },{ 1 .. 4 })
We see that the indices 5 and 6 are contravariant and both are linked together as well. Furthermore the covariant indices are 1--4, which are also linked together.
Universal Cotensor Spaces

We only consider cotensor spaces over fields.

KCotensorSpace(K, S) : Fld, [RngIntElt] -> TenSpc
KCotensorSpace(K, S, C) : Fld, [RngIntElt], TenCat -> TenSpc
For a field K and sequence S=[dv, ..., d1] returns the universal cotensor space homK(Kdv tensor ... tensor Kd1, K) isomorphic to Kdv ... d1 with the given contravariant tensor category C. The default is Albert's homotopism category.
CotensorSpace(S) : [ModTupFld] -> TenSpc
CotensorSpace(S) : [ModMatFld] -> TenSpc
CotensorSpace(S) : List -> TenSpc
CotensorSpace(S, C) : [ModTupFld], TenCat -> TenSpc
CotensorSpace(S, C) : [ModMatFld], TenCat -> TenSpc
CotensorSpace(S, C) : List, TenCat -> TenSpc
Given a sequence S=[Uv, ..., U1] of K-vector spaces returns the universal tensor space equivalent to homK(Uv tensor K ... tensor K U1, K) with contravariant tensor category given by C. The default is Albert's homotopism category.

Example Multilinear_CoTenSpc_Const (H61E21)

> CT := KCotensorSpace(GF(2),[ i : i in [5..7] ]);
> CT;
Cotensor space of dimension 210 over GF(2) with valence 2
U3 : Full Vector space of degree 5 over GF(2)
U2 : Full Vector space of degree 6 over GF(2)
U1 : Full Vector space of degree 7 over GF(2)
> 
> CT.1;
Cotensor of valence 2, U3 x U2 x U1 >-> K
U3 : Full Vector space of degree 5 over GF(2)
U2 : Full Vector space of degree 6 over GF(2)
U1 : Full Vector space of degree 7 over GF(2)
> 
> 
> Cat := CotensorCategory([1,0,-1],{{1},{2},{3}});
> Fr := [ VectorSpace(GF(8),4) : i in [1..3] ];
> CT := CotensorSpace( Fr, Cat );
> CT;
Cotensor space of dimension 64 over GF(2^3) with valence 2
U3 : Full Vector space of degree 4 over GF(2^3)
U2 : Full Vector space of degree 4 over GF(2^3)
U1 : Full Vector space of degree 4 over GF(2^3)
> 
> TensorCategory(CT);
Cotensor category of valence 2 (->,==,<-) ({ 1 },{ 2 },{ 3 })

Some Standard Constructions

We include some subspaces generated by well-known tensors.

AlternatingSpace(T) : TenSpc -> TenSpc
Returns the sub(co-)tensor space generated by all the alternating (co-)tensors contained in the given (co-)tensor space.
AntisymmetricSpace(T) : TenSpc -> TenSpc
Returns the sub(co-)tensor space generated by all the antisymmetric (co-)tensors contained in the given (co-)tensor space.
SymmetricSpace(T) : TenSpc -> TenSpc
Returns the sub(co-)tensor space generated by all the symmetric (co-)tensors contained in the given (co-)tensor space.
ExteriorCotensorSpace(V, n) : ModTupFld, RngIntElt -> TenSpc
Returns the cotensor space given by the nth exterior power of the vector space V.
SymmetricCotensorSpace(V, n) : ModTupFld, RngIntElt -> TenSpc
Returns the cotensor space given by the nth symmetric power of the vector space V.

Example Multilinear_TenSpc_Const2 (H61E22)

> TS := KTensorSpace(GF(3), [3,3,3,2]);
> TS;
Tensor space of dimension 54 over GF(3) with valence 3
U3 : Full Vector space of degree 3 over GF(3)
U2 : Full Vector space of degree 3 over GF(3)
U1 : Full Vector space of degree 3 over GF(3)
U0 : Full Vector space of degree 2 over GF(3)
> 
> SS := SymmetricSpace(TS);
> AsMatrices(Random(SS),3,2);
[
    [1 1 1]
    [1 0 0]
    [1 0 0],

    [2 2 2]
    [2 0 1]
    [2 1 0],

    [1 0 0]
    [0 1 2]
    [0 2 2],

    [2 0 1]
    [0 1 1]
    [1 1 2],

    [1 0 0]
    [0 2 2]
    [0 2 1],

    [2 1 0]
    [1 1 2]
    [0 2 0]
]
For V=F256, we construct the fourth exterior power of V, Λ4(V) as a sub cotensor space of dimension 6 choose (4)=15.

> V := VectorSpace(GF(25),6);
> E := ExteriorCotensorSpace(V,4);
> E;
Cotensor space of dimension 15 over GF(5^2) with valence 3
U4 : Full Vector space of degree 6 over GF(5^2)
U3 : Full Vector space of degree 6 over GF(5^2)
U2 : Full Vector space of degree 6 over GF(5^2)
U1 : Full Vector space of degree 6 over GF(5^2)
> T := Random(E);
> IsAlternating(T);
true

Subspaces as Closures
DerivationClosure(TS, O) : TenSpc, AlgMat -> TenSpc
DerivationClosure(TS, O) : TenSpc, ModMatFld -> TenSpc
DerivationClosure(TS, O) : TenSpc, AlgMatLie -> TenSpc
DerivationClosure(TS, O) : TenSpc, [Mtrx] -> TenSpc
DerivationClosure(TS, O) : TenSpc, [AlgMatLie] -> TenSpc
Returns the derivation closure of the given tensor space TS, with frame U2 x U1 ↣ U0, with operators O⊆(End)(U2) x (End)(U1) x (End)(U0). Currently, this only works for tensor spaces of valence 2. This is the subspace whose tensors' derivation algebra contains O.
DerivationClosure(TS, T) : TenSpc, TenSpcElt -> TenSpc
Returns the derivation closure of the given tensor space TS, with frame U2 x U1 ↣ U0, with operators O⊆(End)(U2) x (End)(U1) x (End)(U0). Currently, this only works for tensor spaces of valence 2. This is the subspace whose tensors' derivation algebra contains the derivation algebra of T.
NucleusClosure(TS, O, s, t) : TenSpc, AlgMat, RngIntElt, RngIntElt -> TenSpc
NucleusClosure(TS, O, s, t) : TenSpc, ModMatFld, RngIntElt, RngIntElt -> TenSpc
NucleusClosure(TS, O, s, t) : TenSpc, [Mtrx], RngIntElt, RngIntElt -> TenSpc
Returns the nucleus closure of the tensor space TS, with frame U2 x U1 ↣ U0, with operators O⊆(End)(Us) x (End)(Ut). Currently, this only works for tensor spaces of valence 2. This returns the subspace whose tensors' st-nuclues contains O.
NucleusClosure(TS, T, s, t) : TenSpc, TenSpcElt, RngIntElt, RngIntElt -> TenSpc
Returns the nucleus closure of the tensor space TS, with frame U2 x U1 ↣ U0, with operators O⊆(End)(Us) x (End)(Ut). Currently, this only works for tensor spaces of valence 2. This returns the subspace whose tensors' st-nuclues contains the st-nucleus of T.

Example Multilinear_Der_Closure (H61E23)

The derivation closure of the tensor in the universal tensor space is 1-dimensional.

> Fr := [ KMatrixSpace(GF(3),2,3),
>   KMatrixSpace(GF(3),3,2),KMatrixSpace(GF(3),2,2) ];
> F := func< x | x[1]*x[2] >;
> T := Tensor(Fr,F);
> T;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full KMatrixSpace of 2 by 3 matrices over GF(3)
U1 : Full KMatrixSpace of 3 by 2 matrices over GF(3)
U0 : Full KMatrixSpace of 2 by 2 matrices over GF(3)
> 
> TS := Parent(T);
> TS;
Tensor space of dimension 144 over GF(3) with valence 2
U2 : Full Vector space of degree 6 over GF(3)
U1 : Full Vector space of degree 6 over GF(3)
U0 : Full Vector space of degree 4 over GF(3)
> 
> D := DerivationClosure(TS,T);
> D;
Tensor space of dimension 1 over GF(3) with valence 2
U2 : Full Vector space of degree 6 over GF(3)
U1 : Full Vector space of degree 6 over GF(3)
U0 : Full Vector space of degree 4 over GF(3)

Example Multilinear_Nuc_Closure (H61E24)

> H := ClassicalSylow( GL(3,125), 5 ); // Heisenberg group
> T := pCentralTensor(H,5,1,1);
> T;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full Vector space of degree 6 over GF(5)
U1 : Full Vector space of degree 6 over GF(5)
U0 : Full Vector space of degree 3 over GF(5)
The centroid of T will be 3-dimensional and is isomorphic to F125.

> C := Centroid(T);
> C;
Matrix Algebra of degree 15 with 3 generators over GF(5)
> 
> S := TensorOverCentroid(T);
> S;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full Vector space of degree 2 over GF(5^3)
U1 : Full Vector space of degree 2 over GF(5^3)
U0 : Full Vector space of degree 1 over GF(5^3)
> 
> TS := Parent(S);
> N := NucleusClosure(TS,S,2,1);
> N;
Tensor space of dimension 1 over GF(5^3) with valence 2
U2 : Full Vector space of degree 2 over GF(5^3)
U1 : Full Vector space of degree 2 over GF(5^3)
U0 : Full Vector space of degree 1 over GF(5^3)
Compare this closure with the closure of our original tensor over F5.

> NT := NucleusClosure(Parent(T),T,2,1);
> NT;
Tensor space of dimension 36 over GF(5) with valence 2
U2 : Full Vector space of degree 6 over GF(5)
U1 : Full Vector space of degree 6 over GF(5)
U0 : Full Vector space of degree 3 over GF(5)

Operations on Tensor Spaces

Membership and Comparison with Tensor Spaces

We define some intuitive functions for tensor spaces, similar to those found for modules.

T in TS : TenSpcElt, TenSpc -> BoolElt
Decides if T is contained in the tensor space TS.
TS ! T : TenSpc, TenSpcElt -> TenSpcElt
Decides if the tensor T can be coerced into the tensor space TS. If so, the tensor is returned as an element of TS.
TS ! S : TenSpc, SeqEnum -> TenSpcElt
Decides if the sequence S can be coerced into the tensor space TS as a tensor. If so, the corresponding tensor is returned.
S eq T : TenSpc, TenSpc -> BoolElt
Decides if the tensor spaces S and T are equal.
S subset T : TenSpc, TenSpc -> BoolElt
Decides if S is a subset of the tensor space T.

Example Multilinear_TenCoerce (H61E25)

> TS := KTensorSpace( GF(2), [2,3,2] );
> TS;
Tensor space of dimension 12 over GF(2) with valence 2
U2 : Full Vector space of degree 2 over GF(2)
U1 : Full Vector space of degree 3 over GF(2)
U0 : Full Vector space of degree 2 over GF(2)
> 
> S := [ Random(GF(2)) : i in [1..12] ];
> T := TS!S;
> T;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full Vector space of degree 2 over GF(2)
U1 : Full Vector space of degree 3 over GF(2)
U0 : Full Vector space of degree 2 over GF(2)
> 
> T eq Tensor(GF(2),[2,3,2],S);
true
We demonstrate how to coerce into the symmetric cube of V=Q10 and construct a subcotensor space.

> V := VectorSpace(Rationals(),10);
> SS := SymmetricCotensorSpace(V,3);
> SS;
Cotensor space of dimension 220 over Rational Field with valence 2
U3 : Full Vector space of degree 10 over Rational Field
U2 : Full Vector space of degree 10 over Rational Field
U1 : Full Vector space of degree 10 over Rational Field
>
> CT := SubtensorSpace(SS,SS![1..1000]);
> CT;
Cotensor space of dimension 1 over Rational Field with valence 2
U3 : Full Vector space of degree 10 over Rational Field
U2 : Full Vector space of degree 10 over Rational Field
U1 : Full Vector space of degree 10 over Rational Field
>
> CT subset SS;
true
> CT.1 in SS;
true
> SS.2 in CT;
false

Tensor Spaces as Modules

We view a tensor space as a K-module, so we have notions of generators, dimension (if it is free), and cardinality.

Generators(T) : TenSpc -> SeqEnum
Returns a sequence of generators for the tensor space.
T . i : TenSpc, RngIntElt -> TenSpcElt
Returns the ith generator of the tensor space T.
NumberOfGenerators(T) : TenSpc -> RngIntElt
Ngens(T) : TenSpc -> RngIntElt
Returns the number of generators of the tensor space T.
Dimension(T) : TenSpc -> RngIntElt
Returns the dimension of the tensor space T as a free K-module.
# T : TenSpc -> RngIntElt
Returns the size of the tensor space, provided it is finite.
Random(T) : TenSpc -> TenSpcElt
Provided the base ring has a random algorithm in Magma, it returns a random element of the tensor space T.
RandomTensor(R, S) : Rng, [RngIntElt] -> TenSpcElt
RandomTensor(R, S, C) : Rng, [RngIntElt], TenCat -> TenSpcElt
Provided R has a random algorithm in Magma, it returns a random tensor from the tensor space homR(Rdv, ..., homR(Rd1, Rd0) ... ) with category C. The default category is the homotopism category.

Example Multilinear_TenSpc_Module (H61E26)

> TS := KTensorSpace( GF(9), [2,2,2,2] );
> TS;
Tensor space of dimension 16 over GF(3^2) with valence 3
U3 : Full Vector space of degree 2 over GF(3^2)
U2 : Full Vector space of degree 2 over GF(3^2)
U1 : Full Vector space of degree 2 over GF(3^2)
U0 : Full Vector space of degree 2 over GF(3^2)
> 
> Ngens(TS);
16
> #TS eq 9^Ngens(TS);
true
> 
> Eltseq(TS.2);
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
We can use RandomTensor to get a random tensor or cotensor from scratch.

> T := RandomTensor(GF(3),[2,2,2]);
> T;
Tensor of valence 2, U2 x U1 >-> U0
U2 : Full Vector space of degree 2 over GF(3)
U1 : Full Vector space of degree 2 over GF(3)
U0 : Full Vector space of degree 2 over GF(3)
> 
> Cat := CotensorCategory([1,1,1],{{1,2,3}});
> T := RandomTensor(GF(3),[2,2,2],Cat);
> T;
Cotensor of valence 2, U3 x U2 x U1 >-> K
U3 : Full Vector space of degree 2 over GF(3)
U2 : Full Vector space of degree 2 over GF(3)
U1 : Full Vector space of degree 2 over GF(3)

Properties of Tensor Spaces

We define some functions to access basic properties of tensor spaces.

Valence(T) : TenSpc -> RngIntElt
Returns the valence of the tensor space.
Frame(T) : TenSpc -> List
Returns the list of modules in the frame of the tensor space.
BaseRing(T) : TenSpc -> Rng
BaseField(T) : TenSpc -> Fld
Returns the base ring (or field) of the tensor space.
TensorCategory(T) : TenSpc -> TenCat
Returns the underlying tensor category of the tensor space.
IsCovariant(T) : TenSpc -> BoolElt
IsContravariant(T) : TenSpc -> BoolElt
Decides if the underlying tensor category is covariant or contravariant.
ChangeTensorCategory(T, C) : TenSpc, TenCat -> TenSpc
ChangeTensorCategory( T, C) : TenSpc, TenCat ->
Returns the tensor category with the given tensor category.
IsAlternating(T) : TenSpc -> BoolElt
Decides if every tensor in the tensor space is an alternating tensor.
IsAntisymmetric(T) : TenSpc -> BoolElt
Decides if every tensor in the tensor space is an antisymmetric tensor.
IsSymmetric(T) : TenSpc -> BoolElt
Decides if every tensor in the tensor space is a symmetric tensor.
UniversalTensorSpace(T) : TenSpc -> TenSpc
UniversalCotensorSpace(T) : TenSpc -> TenSpc
Generic(T) : TenSpc -> TenSpc
Returns the universal (co-)tensor space with the same frame and category as T.

Example Multilinear_TenSpc_Prop (H61E27)

> TS := KTensorSpace( GF(23), [3,4,5,6] );
> TS;
Tensor space of dimension 360 over GF(23) with valence 3
U3 : Full Vector space of degree 3 over GF(23)
U2 : Full Vector space of degree 4 over GF(23)
U1 : Full Vector space of degree 5 over GF(23)
U0 : Full Vector space of degree 6 over GF(23)
> 
> Valence(TS);
3
> Frame(TS);
[*
    Full Vector space of degree 3 over GF(23),

    Full Vector space of degree 4 over GF(23),

    Full Vector space of degree 5 over GF(23),

    Full Vector space of degree 6 over GF(23)
*]
> TensorCategory(TS);
Tensor category of Valence 3 (->,->,->,->) 
({ 1 },{ 2 },{ 0 },{ 3 })
> 
> Cat := TensorCategory([1,1,-1,-1],{{0},{1},{2},{3}});
> ChangeTensorCategory(~TS,Cat);
> TensorCategory(TS);
Tensor category of Valence 3 (->,->,<-,<-) 
({ 1 },{ 2 },{ 0 },{ 3 })
We construct the universal cotensor space of the symmetric cube, S3(V), of a vector space V.

> V := VectorSpace( GF(3), 5 );
> S := SymmetricCotensorSpace(V,3);
> S;
Cotensor space of dimension 30 over GF(3) with valence 2
U3 : Full Vector space of degree 5 over GF(3)
U2 : Full Vector space of degree 5 over GF(3)
U1 : Full Vector space of degree 5 over GF(3)
> UniversalCotensorSpace(S);
Cotensor space of dimension 125 over GF(3) with valence 2
U3 : Full Vector space of degree 5 over GF(3)
U2 : Full Vector space of degree 5 over GF(3)
U1 : Full Vector space of degree 5 over GF(3)
> 
> IsSymmetric(S);
true

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]

Version: V2.25 of Tue Dec 3 10:52:18 AEDT 2019