Physlib

Physlib.Relativity.Tensors.Evaluation

Evaluation of tensor indices

## The evaluation coefficient.

Evaluation for a pure tensor.

Evaluation for a pure tensor as multilinear map.

16 declarations

definition

bb-th basis coefficient of the ii-th vector in a pure tensor pp

Let SS be a tensor species over a field kk and cc be a sequence of colors representing a collection of vector spaces {Vcj}j=0n\{V_{c_j}\}_{j=0}^n. A pure tensor pPure(S,c)p \in \text{Pure}(S, c) is defined as an element of the dependent product j=0nVcj\prod_{j=0}^n V_{c_j}, representing the tensor v0v1vnv_0 \otimes v_1 \otimes \dots \otimes v_n. Given an index i{0,,n}i \in \{0, \dots, n\} and a basis index b{0,,dim(Vci)1}b \in \{0, \dots, \dim(V_{c_i}) - 1\}, the function `evalPCoeff` returns the bb-th coordinate of the ii-th component vector viv_i with respect to the basis of VciV_{c_i} provided by the tensor species.

theorem

`evalPCoeff` after `update` at the same index equals the new vector's coefficient

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors representing a collection of vector spaces {Vcj}j=0n\{V_{c_j}\}_{j=0}^n. Let pPure(S,c)p \in \text{Pure}(S, c) be a pure tensor, representing the product v0v1vnv_0 \otimes v_1 \otimes \dots \otimes v_n. Let evalPCoeff(i,b,p)\text{evalPCoeff}(i, b, p) be the function that returns the bb-th coordinate of the ii-th component vector viv_i with respect to the basis of VciV_{c_i} provided by the species. For any index i{0,,n}i \in \{0, \dots, n\}, basis index b{0,,dim(Vci)1}b \in \{0, \dots, \dim(V_{c_i}) - 1\}, and vector xVcix \in V_{c_i}, the bb-th basis coefficient of the ii-th component of the pure tensor updated at index ii with xx is equal to the bb-th basis coefficient of xx: evalPCoeff(i,b,update(p,i,x))=repr(x)b \text{evalPCoeff}(i, b, \text{update}(p, i, x)) = \text{repr}(x)_b where repr(x)b\text{repr}(x)_b denotes the bb-th coordinate of xx in the basis of VciV_{c_i}.

theorem

`evalPCoeff` is invariant under `update` at distinct indices

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors representing a collection of vector spaces {Vcm}m=0n\{V_{c_m}\}_{m=0}^n. Let pp be a pure tensor, defined as an element of the dependent product m=0nVcm\prod_{m=0}^n V_{c_m}, which represents the simple tensor v0v1vnv_0 \otimes v_1 \otimes \dots \otimes v_n. Let evalPCoeff(i,b,p)\text{evalPCoeff}(i, b, p) be the function that returns the bb-th coordinate of the ii-th component vector viv_i with respect to the basis of VciV_{c_i}. For any index i{0,,n}i \in \{0, \dots, n\} and j{0,,n1}j \in \{0, \dots, n-1\}, let k=i.succAbove jk = i.\text{succAbove } j denote an index in {0,,n}\{0, \dots, n\} distinct from ii. If the kk-th component of pp is updated with a new vector xVckx \in V_{c_k}, the bb-th basis coefficient of the ii-th component vector remains unchanged: evalPCoeff(i,b,update pkx)=evalPCoeff(i,b,p) \text{evalPCoeff}(i, b, \text{update } p \, k \, x) = \text{evalPCoeff}(i, b, p)

definition

Evaluation of the ii-th index of a pure tensor pp at basis index bb

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. A pure tensor pp of type cc is a family of vectors (v0,v1,,vn)(v_0, v_1, \dots, v_n) representing the tensor product v0v1vnv_0 \otimes v_1 \otimes \dots \otimes v_n, where each vjv_j belongs to the vector space VcjV_{c_j} associated with color cjc_j. Given an index i{0,,n}i \in \{0, \dots, n\} and a basis index bb for the vector space VciV_{c_i}, the function evalP ibp\text{evalP } i \, b \, p returns the tensor of rank nn formed by evaluating the ii-th index of pp at the bb-th basis element. This is defined as: evalP ibp=(vi)b(v0vi1vi+1vn) \text{evalP } i \, b \, p = (v_i)_b \cdot (v_0 \otimes \dots \otimes v_{i-1} \otimes v_{i+1} \otimes \dots \otimes v_n) where (vi)b(v_i)_b is the bb-th coordinate of the vector viv_i with respect to the basis of VciV_{c_i} provided by the tensor species SS.

theorem

Additivity of Pure Tensor Evaluation evalP\text{evalP} with respect to Component Updates

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors, where each c(m)c(m) corresponds to a vector space Vc(m)V_{c(m)}. Let pp be a pure tensor (formally an element of the dependent product m=0nVc(m)\prod_{m=0}^n V_{c(m)}) representing the simple tensor v0vnv_0 \otimes \dots \otimes v_n. Let evalP(i,b,p)\text{evalP}(i, b, p) be the operation that evaluates the ii-th index of pp at the bb-th basis element of Vc(i)V_{c(i)}, returning a tensor of rank nn. For any indices i,j{0,,n}i, j \in \{0, \dots, n\}, a basis index bb for Vc(i)V_{c(i)}, and vectors x,yVc(j)x, y \in V_{c(j)}, the evaluation operation is additive with respect to updating the jj-th component of the pure tensor: evalP(i,b,update(p,j,x+y))=evalP(i,b,update(p,j,x))+evalP(i,b,update(p,j,y)) \text{evalP}(i, b, \text{update}(p, j, x + y)) = \text{evalP}(i, b, \text{update}(p, j, x)) + \text{evalP}(i, b, \text{update}(p, j, y)) where update(p,j,v)\text{update}(p, j, v) denotes the pure tensor pp with its jj-th component replaced by vv.

theorem

Scalar Multiplicativity of evalP\text{evalP} under Component Update evalP(i,b,update(p,j,rx))=revalP(i,b,update(p,j,x))\text{evalP}(i, b, \text{update}(p, j, r \cdot x)) = r \cdot \text{evalP}(i, b, \text{update}(p, j, x))

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors, where VcmV_{c_m} denotes the vector space associated with color cmc_m. Let pp be a pure tensor of type cc, representing the family of vectors (v0,,vn)(v_0, \dots, v_n) where vmVcmv_m \in V_{c_m}. For any indices i,j{0,,n}i, j \in \{0, \dots, n\}, a basis index bb for the vector space VciV_{c_i}, a scalar rkr \in k, and a vector xVcjx \in V_{c_j}, the evaluation of the ii-th index at basis index bb is homogeneous with respect to scalar multiplication in the jj-th component: evalP(i,b,update(p,j,rx))=revalP(i,b,update(p,j,x)) \text{evalP}(i, b, \text{update}(p, j, r \cdot x)) = r \cdot \text{evalP}(i, b, \text{update}(p, j, x)) where update(p,j,x)\text{update}(p, j, x) denotes the pure tensor obtained by replacing the jj-th component of pp with xx, and evalP(i,b,p)\text{evalP}(i, b, p) is the rank-nn tensor defined by (vi)b(v0vi1vi+1vn)(v_i)_b \cdot (v_0 \otimes \dots \otimes v_{i-1} \otimes v_{i+1} \otimes \dots \otimes v_n), where (vi)b(v_i)_b is the bb-th coordinate of viv_i with respect to the basis of VciV_{c_i}.

definition

Multilinear map for the evaluation of the ii-th index at basis index bb

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. For a fixed index i{0,,n}i \in \{0, \dots, n\} and a basis index bb for the vector space VciV_{c_i} (the space associated with color cic_i), the function `evalPMultilinear i b` is the multilinear map from the product of vector spaces j=0nVcj\prod_{j=0}^n V_{c_j} to the space of tensors of rank nn with the color sequence ci.succAbovec \circ i.\text{succAbove} (where the ii-th color is omitted). Given a tuple of vectors (v0,,vn)(v_0, \dots, v_n), the map is defined by: (v0,,vn)(vi)b(v0vi1vi+1vn) (v_0, \dots, v_n) \mapsto (v_i)_b \cdot (v_0 \otimes \dots \otimes v_{i-1} \otimes v_{i+1} \otimes \dots \otimes v_n) where (vi)b(v_i)_b is the bb-th coordinate of the vector viv_i with respect to the basis of VciV_{c_i} provided by the tensor species SS.

definition

kk-linear map for the evaluation of the ii-th tensor index at basis index bb

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. For a fixed index i{0,,n}i \in \{0, \dots, n\} and a basis index bb for the vector space VciV_{c_i} associated with the color cic_i, the kk-linear map evalT i b\text{evalT } i \text{ } b maps a tensor tTensor Sct \in \text{Tensor } S c to a tensor of rank nn with the color sequence ci.succAbovec \circ i.\text{succAbove} (the original sequence cc with the ii-th element omitted). This map is defined as the linear extension of the multilinear evaluation map, which acts on a pure tensor as: v0vn(vi)b(v0vi1vi+1vn) v_0 \otimes \dots \otimes v_n \mapsto (v_i)_b \cdot (v_0 \otimes \dots \otimes v_{i-1} \otimes v_{i+1} \otimes \dots \otimes v_n) where (vi)b(v_i)_b is the bb-th coordinate of the vector viv_i with respect to the basis of VciV_{c_i} provided by the tensor species SS.

theorem

evalT ib(p.toTensor)=evalP ibp\text{evalT } i \, b (p.\text{toTensor}) = \text{evalP } i \, b \, p

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. For any index i{0,,n}i \in \{0, \dots, n\}, any basis index bb for the vector space VciV_{c_i} associated with the color cic_i, and any pure tensor pp (representing the tuple of vectors (v0,,vn)(v_0, \dots, v_n)), the kk-linear evaluation map evalT ib\text{evalT } i \, b applied to the tensor j=0nvj\bigotimes_{j=0}^n v_j is equal to the direct evaluation of the pure tensor evalP ibp\text{evalP } i \, b \, p. That is, evalT ib(p.toTensor)=evalP ibp \text{evalT } i \, b (p.\text{toTensor}) = \text{evalP } i \, b \, p where p.toTensorp.\text{toTensor} is the image of the vectors in the tensor product space, and evalP\text{evalP} is defined as (vi)b(v0vi1vi+1vn)(v_i)_b \cdot (v_0 \otimes \dots \otimes v_{i-1} \otimes v_{i+1} \otimes \dots \otimes v_n).

theorem

Evaluation of the ii-th index of a tensor basis element

Let SS be a tensor species over a field kk and c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. Let ebe_b denote the basis element of the tensor space Tensor Sc\text{Tensor } S c corresponding to the multi-index bComponentIdx cb \in \text{ComponentIdx } c. For any index position i{0,,n}i \in \{0, \dots, n\} and any basis index xx of the vector space VciV_{c_i}, the evaluation of the ii-th index of ebe_b at xx is given by: evalT i x (eb)={ebi.succAboveif bi=x0if bix \text{evalT } i \ x \ (e_b) = \begin{cases} e_{b \circ i.\text{succAbove}} & \text{if } b_i = x \\ 0 & \text{if } b_i \neq x \end{cases} where bi.succAboveb \circ i.\text{succAbove} is the multi-index of length nn obtained by removing the ii-th component from bb, and ebi.succAbovee_{b \circ i.\text{succAbove}} is the corresponding basis element in the reduced tensor space Tensor S(ci.succAbove)\text{Tensor } S (c \circ i.\text{succAbove}).

theorem

Evaluation commutes with tensor index permutation (Commutativity of evalT\text{evalT} and permT\text{permT})

Let SS be a tensor species over a field kk. Let c:Fin(n+1)Cc: \text{Fin}(n+1) \to C and c:Fin(m+1)Cc': \text{Fin}(m+1) \to C be two color sequences, and let σ:Fin(n+1)Fin(m+1)\sigma: \text{Fin}(n+1) \to \text{Fin}(m+1) be a reindexing (a bijection such that cσ=cc' \circ \sigma = c). For any tensor tTensor S ct \in \text{Tensor } S \ c', any index iFin(n+1)i \in \text{Fin}(n+1), and any basis index xx of the vector space VciV_{c_i}, the evaluation of the ii-th index of the permuted tensor permT(σ,h,t)\text{permT}(\sigma, h, t) at xx is equal to: evalTi x (permT σ h t)=permT (σ) (h.succAbove i) (evalTσ(i) x t) \text{evalT}_i \ x \ (\text{permT} \ \sigma \ h \ t) = \text{permT} \ (\sigma') \ (h.\text{succAbove } i) \ (\text{evalT}_{\sigma(i)} \ x' \ t) where: 1. xx' is the basis index xx viewed as an index for Vcσ(i)V_{c'_{\sigma(i)}} (noting that ci=cσ(i)c_i = c'_{\sigma(i)}). 2. σ\sigma' is the induced reindexing on the reduced color sequences after removing ii from the target and σ(i)\sigma(i) from the source. 3. permT\text{permT} is the linear map that reorders tensor indices. 4. evalT\text{evalT} is the linear map that evaluates a tensor index at a specific basis element.

theorem

Evaluation and Contraction of Tensor Indices Commute

Let SS be a tensor species over a field kk, and let tt be a tensor of rank n+3n+3 with color sequence c:Fin(n+3)Cc: \text{Fin}(n+3) \to C. For an index kFin(n+3)k \in \text{Fin}(n+3) and a basis index ϕ\phi of the vector space VckV_{c_k}, let evalTk(ϕ,t)\text{evalT}_k(\phi, t) be the evaluation of tt at the kk-th index. Let i,jFin(n+2)i, j \in \text{Fin}(n+2) be two distinct indices such that the contraction contrTi,j\text{contrT}_{i,j} is well-defined on the evaluated tensor (i.e., the color at jj is the dual of the color at ii in the sequence ck.succAbovec \circ k.\text{succAbove}). Then, evaluating the kk-th index and then contracting the pair (i,j)(i, j) is equivalent to first contracting the corresponding pair (i,j)(i', j') in the original tensor and then evaluating the residual index kk', up to a canonical reindexing: contrTi,j(evalTk(ϕ,t))=permT(id,h)(evalTk(ϕ,contrTi,j(t))) \text{contrT}_{i,j}(\text{evalT}_k(\phi, t)) = \text{permT}(\text{id}, h) \left( \text{evalT}_{k'}(\phi', \text{contrT}_{i', j'}(t)) \right) where: 1. i=succAbovek(i)i' = \text{succAbove}_k(i) and j=succAbovek(j)j' = \text{succAbove}_k(j) are the indices in the original rank n+3n+3 tensor that map to ii and jj after kk is removed. 2. k=predPredAbovei,j(k)k' = \text{predPredAbove}_{i', j'}(k) is the index in the rank n+1n+1 tensor corresponding to the original index kk after indices ii' and jj' are removed via contraction. 3. ϕ\phi' is the basis index ϕ\phi under the canonical identification of color spaces. 4. permT(id,h)\text{permT}(\text{id}, h) is the reindexing map corresponding to the commutativity of skipping one index and skipping a pair of indices (IsReindexing.succAbove_succSuccAbove_comm\text{IsReindexing.succAbove\_succSuccAbove\_comm}).

theorem

Evaluation Commutes with Tensor Product on the Right Factor

Let SS be a tensor species over a field kk. Let tt be a tensor of rank nn with color sequence cc, and t1t_1 be a tensor of rank n1+1n_1 + 1 with color sequence c1c_1. For any index i{0,,n1}i \in \{0, \dots, n_1\} and any basis index xx of the vector space associated with color c1(i)c_1(i), the evaluation of the ii-th index of the right factor t1t_1 commutes with the tensor product operation: tevalTi(x,t1)=permT(id,h)(evalTn+i(x,tt1))t \otimes \text{evalT}_i(x, t_1) = \text{permT}(\text{id}, h) (\text{evalT}_{n+i}(x, t \otimes t_1)) where \otimes denotes the tensor product `prodT`, evalTk\text{evalT}_k is the evaluation map at the kk-th index, and permT(id,h)\text{permT}(\text{id}, h) is the canonical reindexing (permutation) that identifies the color sequence of tevalTi(x,t1)t \otimes \text{evalT}_i(x, t_1) with the color sequence of tt1t \otimes t_1 after the (n+i)(n+i)-th index has been removed.

theorem

Evaluation of a single-index basis tensor is the Kronecker delta

Let SS be a tensor species over a field kk. For a color cCc \in C, let ebe_b denote the basis vector of the rank-1 tensor space S.Tensor [c]S.\text{Tensor } [c] corresponding to the index bbasisIdx(c)b \in \text{basisIdx}(c). Let evalT0(x,)\text{evalT}_0(x, \cdot) be the linear map that evaluates the 00-th index of a tensor at the basis index xx, and let toField\text{toField} be the linear isomorphism that maps a rank-0 tensor to its corresponding scalar in kk. Then, evaluating the basis tensor ebe_b at the index xx yields the Kronecker delta: toField(evalT0(x,eb))=δbx={1if b=x0if bx\text{toField}(\text{evalT}_0(x, e_b)) = \delta_{bx} = \begin{cases} 1 & \text{if } b = x \\ 0 & \text{if } b \neq x \end{cases} where the comparison b=xb = x is performed under the canonical identification of the index types.

theorem

t1=t2t_1 = t_2 if evalTi(ϕ,t1)=evalTi(ϕ,t2)\text{evalT}_i(\phi, t_1) = \text{evalT}_i(\phi, t_2) for all i,ϕi, \phi

Let SS be a tensor species over a field kk, and let c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors defining a tensor space. For any two tensors t1,t2t_1, t_2 of rank n+1n+1 with color sequence cc, if for every index i{0,,n}i \in \{0, \dots, n\} and every basis index ϕ\phi of the associated vector space VciV_{c_i}, the evaluations evalTi(ϕ,t1)\text{evalT}_i(\phi, t_1) and evalTi(ϕ,t2)\text{evalT}_i(\phi, t_2) are equal, then t1=t2t_1 = t_2. Here, evalTi(ϕ,t)\text{evalT}_i(\phi, t) denotes the tensor of rank nn obtained by evaluating the ii-th slot of tt at the ϕ\phi-th basis vector.

theorem

Equality of tensors via evaluation of a single index ii

Let SS be a tensor species over a field kk, and let c:{0,,n}Cc: \{0, \dots, n\} \to C be a sequence of colors. Let t1t_1 and t2t_2 be tensors in Tensor Sc\text{Tensor } S c. If there exists a fixed index i{0,,n}i \in \{0, \dots, n\} such that for every basis index ϕ\phi of the vector space associated with the color cic_i, the evaluation of the ii-th tensor index satisfies evalT i ϕ(t1)=evalT i ϕ(t2)\text{evalT } i \text{ } \phi(t_1) = \text{evalT } i \text{ } \phi(t_2), then t1=t2t_1 = t_2.