Tensor trees #
- Tensor trees provide an abstract way to represent tensor expressions.
- Their nodes are either tensors or operations between tensors.
- Every tensor tree has associated with an underlying tensor.
- This is not a one-to-one correspondence. Lots tensor trees represent the same tensor. In the same way that lots of tensor expressions represent the same tensor.
- Define a sub-tensor tree as a node of a tensor tree and all child nodes thereof. One
can replace sub-tensor tree with another tensor tree which has the same underlying tensor
without changing the underlying tensor of the parent tensor tree. These appear as the e.g.
the lemmas
contr_tensor_eq
in what follows.
A syntax tree for tensor expressions.
- tensorNode
{S : TensorSpecies}
{n : ℕ}
{c : Fin n → S.C}
(T : ↑(S.F.obj (IndexNotation.OverColor.mk c)).V)
: TensorTree S c
A general tensor node.
- smul
{S : TensorSpecies}
{n : ℕ}
{c : Fin n → S.C}
: S.k → TensorTree S c → TensorTree S c
A node corresponding to the scalar multiple of a tensor by a element of the field.
- neg
{S : TensorSpecies}
{n : ℕ}
{c : Fin n → S.C}
: TensorTree S c → TensorTree S c
A node corresponding to negation of a tensor.
- add
{S : TensorSpecies}
{n : ℕ}
{c : Fin n → S.C}
: TensorTree S c → TensorTree S c → TensorTree S c
A node corresponding to the addition of two tensors.
- action
{S : TensorSpecies}
{n : ℕ}
{c : Fin n → S.C}
: S.G → TensorTree S c → TensorTree S c
A node corresponding to the action of a group element on a tensor.
- perm
{S : TensorSpecies}
{n m : ℕ}
{c : Fin n → S.C}
{c1 : Fin m → S.C}
(σ : IndexNotation.OverColor.mk c ⟶ IndexNotation.OverColor.mk c1)
(t : TensorTree S c)
: TensorTree S c1
A node corresponding to the permutation of indices of a tensor.
- prod
{S : TensorSpecies}
{n m : ℕ}
{c : Fin n → S.C}
{c1 : Fin m → S.C}
(t : TensorTree S c)
(t1 : TensorTree S c1)
: TensorTree S (Sum.elim c c1 ∘ ⇑finSumFinEquiv.symm)
A node corresponding to the product of two tensors.
- contr
{S : TensorSpecies}
{n : ℕ}
{c : Fin n.succ.succ → S.C}
(i : Fin n.succ.succ)
(j : Fin n.succ)
(h : c (i.succAbove j) = S.τ (c i))
: TensorTree S c → TensorTree S (c ∘ i.succAbove ∘ j.succAbove)
A node corresponding to the contraction of indices of a tensor.
- eval
{S : TensorSpecies}
{n : ℕ}
{c : Fin n.succ → S.C}
(i : Fin n.succ)
(x : ℕ)
: TensorTree S c → TensorTree S (c ∘ i.succAbove)
A node corresponding to the evaluation of an index of a tensor.
Instances For
Composite nodes #
A node consisting of a single vector.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The node vecNode
of a tensor tree, with all arguments explicit.
Equations
- TensorTree.vecNodeE S c1 v = TensorTree.vecNode v
Instances For
A node consisting of a two tensor.
Equations
Instances For
The node twoNode
of a tensor tree, with all arguments explicit.
Equations
- TensorTree.twoNodeE S c1 c2 v = TensorTree.twoNode v
Instances For
A node consisting of a three tensor.
Equations
Instances For
The node threeNode
of a tensor tree, with all arguments explicit.
Equations
- TensorTree.threeNodeE S c1 c2 c3 v = TensorTree.threeNode v
Instances For
A general constant node.
Equations
Instances For
A constant vector.
Equations
Instances For
A constant two tensor (e.g. metric and unit).
Equations
Instances For
The node constTwoNode
of a tensor tree, with all arguments explicit.
Equations
- TensorTree.constTwoNodeE S c1 c2 v = TensorTree.constTwoNode v
Instances For
A constant three tensor (e.g. Pauli matrices).
Equations
Instances For
The node constThreeNode
of a tensor tree, with all arguments explicit.
Equations
- TensorTree.constThreeNodeE S c1 c2 c3 v = TensorTree.constThreeNode v
Instances For
Other operations. #
The number of nodes in a tensor tree.
Equations
- (TensorTree.tensorNode T).size = 1
- (t1.add t2).size = t1.size + t2.size + 1
- (TensorTree.perm σ t).size = t.size + 1
- t.neg.size = t.size + 1
- (TensorTree.smul a t).size = t.size + 1
- (t1.prod t2).size = t1.size + t2.size + 1
- (TensorTree.contr i j h t).size = t.size + 1
- (TensorTree.eval i x_1 t).size = t.size + 1
- (TensorTree.action a t).size = t.size + 1
Instances For
The underlying tensor a tensor tree corresponds to.
Instances For
Takes a tensor tree based on Fin 0
, into the field S.k
.
Equations
- t.field = S.castFin0ToField t.tensor
Instances For
Tensor on different nodes. #
Equality of tensors and rewrites. #
Properties on basis. #
The zero tensor tree #
The zero tensor tree.
Equations
Instances For
A structure containing a pair of indices (i, j) to be contracted in a tensor. This is used in some proofs of node identities for tensor trees.
A proof that the two indices can be contracted.
Instances For
The contraction map for a pair of indices.