Tensors #
This module sets up the tensors used for index notation in Physlib.
Physics picture:
- Choose a symmetry group
G(for example, the Lorentz group). - Give each index kind a name called a color (encoded by a type
C). In Lorentzian notation, a typical choice is two colors:upanddown. - For each color, choose a representation of
G. - Fix a basis for each color. This determines which values that index can take and lets us speak about tensor components explicitly.
- Specify a dual color for each color, telling us which index pairs can contract.
- For dual pairs, provide the contraction/unit/metric data used for contraction and for raising/lowering indices.
All of this structure is packaged as a TensorSpecies.
For S : TensorSpecies and a list of index colors c : Fin n → C:
Tensor S cis the type of tensors with those indices.Pure S cis the type of pure tensors, i.e. tensors of the formv₀ ⊗ₜ v₁ ⊗ₜ v₂ ….ComponentIdx S cis the type of allowed component labels for those indices.
From this setup we get the usual index-notation operations in a uniform way: contraction, raising/lowering, and permutation of indices.
The tensors associated with a list of indices of a given color
c : Fin n → C.
Equations
- S.Tensor c = ↑(S.F.obj (IndexNotation.OverColor.mk c))
Instances For
Given a list of indices c : Fin n → C e.g. ![.up, .down], the type
ComponentIdx c is the type of components indexes of a tensor with those indices
e.g. ⟨0, 2⟩ corresponding to T⁰₂.
Equations
- TensorSpecies.Tensor.ComponentIdx c = ((j : Fin n) → basisIdx (c j))
Instances For
Casting of a ComponentIdx through equivalent color maps.
Equations
- TensorSpecies.Tensor.ComponentIdx.cast h hc b j = (TensorSpecies.basisIdxCongr ⋯) (b (Fin.cast ⋯ j))
Instances For
Pure tensors #
The type of pure tensors associated to a list of indices c : OverColor C.
A pure tensor is a tensor which can be written in the form v1 ⊗ₜ v2 ⊗ₜ v3 ….
Instances For
The tensor corresponding to a pure tensor.
Equations
- p.toTensor = (PiTensorProduct.tprod k) p
Instances For
Given a list of indices c of n indices, a pure tensor p, an element i : Fin n and
a x in S.FD.obj (Discrete.mk (c i)) then update p i x corresponds to p where
the ith part of p is replaced with x.
E.g. if n = 2 and p = v₀ ⊗ₜ v₁ then update p 0 x = x ⊗ₜ v₁.
Equations
- p.update i x = Function.update p i x
Instances For
Given a list of indices c of length n + 1, a pure tensor p and an i : Fin (n + 1), then
drop p i is the tensor p with it's ith part dropped.
For example, if n = 2 and p = v₀ ⊗ₜ v₁ ⊗ₜ v₂ then drop p 1 = v₀ ⊗ₜ v₂.
Instances For
Components #
Given an element b of ComponentIdx c and a pure tensor p then
component p b is the element of the ring k corresponding to
the component of p in the direction b.
For example, if p = v ⊗ₜ w and b = ⟨0, 1⟩ then component p b = v⁰ ⊗ₜ w¹.
Instances For
The multilinear map taking pure tensors p to a map ComponentIdx c → k which when
evaluated returns the components of p.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given an component idx b in ComponentIdx c, basisVector c b is the pure tensor
formed by S.basis (c i) (b i).
Equations
- TensorSpecies.Tensor.Pure.basisVector c b i = (S.basis (c i)) (b i)
Instances For
The basis #
The linear map from tensors to its components.
Equations
Instances For
The tensor created from it's components.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The basis of tensors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rank #
Equations
The action #
The action on tensors #
Equations
- TensorSpecies.Tensor.actionT = { smul := fun (g : G) (t : S.Tensor c) => ((S.F.obj (IndexNotation.OverColor.mk c)).ρ g) t, mul_smul := ⋯, one_smul := ⋯ }
Given two lists of indices c : Fin n → C and c1 : Fin m → C a map
σ : Fin m → Fin n satisfies the condition PermCond c c1 σ if it is:
- A bijection
- Forms a commutative triangle with
candc1.
Equations
- TensorSpecies.Tensor.PermCond c c1 σ = (Function.Bijective σ ∧ ∀ (i : Fin m), c (σ i) = c1 i)
Instances For
For a map σ : Fin m → Fin n satisfying PermCond c c1 σ,
that map lifted to an equivalence between
Fin n and Fin m.
Equations
- h.toEquiv = { toFun := TensorSpecies.Tensor.PermCond.inv σ h, invFun := σ, left_inv := ⋯, right_inv := ⋯ }
Instances For
Given a morphism in the OverColor C between c and c1 category the corresponding morphism
(Hom.toEquiv σ).symm satisfies the PermCond.
Permutations #
Given a permutation σ : Fin m → Fin n of indices satisfying PermCond through h,
and a pure tensor p, permP σ h p is the pure tensor permuted according to σ.
For example if m = n = 2 and σ = ![1, 0], and p = v ⊗ₜ w then
permP σ _ p = w ⊗ₜ v.
Equations
- TensorSpecies.Tensor.Pure.permP σ h p i = (CategoryTheory.ConcreteCategory.hom (S.FD.map (CategoryTheory.eqToHom ⋯))) (p (σ i))
Instances For
Given a permutation σ : Fin m → Fin n of indices satisfying PermCond through h,
and a tensor t, permT σ h t is the tensor tensor permuted according to σ.
Equations
- TensorSpecies.Tensor.permT σ h = { toFun := fun (t : S.Tensor c) => (Rep.Hom.hom (S.F.map h.toHom)) t, map_add' := ⋯, map_smul' := ⋯ }
Instances For
field #
The linear map between tensors with zero indices and the underlying field
k.