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.
This file realizes Tensor S c as a PiTensorProduct, relates pure tensors to
their components, constructs the component basis, and supplies the inherited
finite-dimensional and module-topology instances. It also defines the natural
action of G on pure tensors and tensors, the associated permutation maps, and
the map from rank-zero tensors to the scalars k.
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 = PiTensorProduct k fun (i : Fin n) => V (c i)
Instances For
Components of tensors #
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 ….
Equations
- TensorSpecies.Tensor.Pure S c = ((i : Fin n) → V (c i))
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 V (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 φ i = (b (c i)) (φ 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
componentMap is the basis representation (basis c).repr definitionally; this bridges the two
notations wherever a component computation meets a repr rewrite.
Two tensors with the same colour sequence are equal when all their components agree.
The rank #
Equations
The action #
Equations
- TensorSpecies.Tensor.Pure.actionP = { smul := fun (g : G) (p : TensorSpecies.Tensor.Pure S c) (i : Fin n) => ((rep (c i)) g) (p i), mul_smul := ⋯, one_smul := ⋯ }
The action on tensors #
Equations
- TensorSpecies.Tensor.instSMul = { smul := fun (g : G) (t : S.Tensor c) => (PiTensorProduct.map fun (i : Fin n) => (rep (c i)) g) t }
Equations
- TensorSpecies.Tensor.actionT = { toSMul := TensorSpecies.Tensor.instSMul, mul_smul := ⋯, one_smul := ⋯ }
Equations
- TensorSpecies.Tensor.instDistribMulAction = { toMulAction := TensorSpecies.Tensor.actionT, smul_zero := ⋯, smul_add := ⋯ }
Permutations #
Given a permutation σ : Fin m → Fin n of indices satisfying IsReindexing 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 = (LinearEquiv.cast ⋯) (p (σ i))
Instances For
The reindexing of a tensor based on a map σ : Fin m → Fin n of indices
satisfying IsReindexing.
Equations
- TensorSpecies.Tensor.permT σ h = (PiTensorProduct.map fun (i : Fin m) => ↑(LinearEquiv.cast ⋯)) ∘ₗ ↑(PiTensorProduct.reindex k (fun (i : Fin n) => V (c i)) h.toEquiv)
Instances For
A reindexing whose slot map is pointwise the identity only transports the labels.
permT is injective.
Rank-zero tensors as scalars #
The linear map between tensors with zero indices and the underlying scalars
k.