{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 9a. Tensors on modules\n",
"\n",
"This notebook is part of the [Introduction to manifolds in SageMath](https://sagemanifolds.obspm.fr/intro_to_manifolds.html) by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'SageMath version 9.6, Release Date: 2022-05-15'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"version()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Reminder. Vectors and linear forms on modules\n",
"\n",
"
\n",
"\n",
"Recall that for free modules of finite rank (in [notebook 6](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/06Manifold_VectSpaces_Modules.ipynb)) we have introduced **vectors** and **linear forms**.\n",
"\n",
"
\n",
"\n",
"**Example 9.1a**\n",
"\n",
"Define a free module of finite rank and some vector and linear form."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"N=3 # dimension of the module\n",
"%display latex\n",
"M=FiniteRankFreeModule(SR,3,name='M') # 3-dim module over SR\n",
"e = M.basis('e') # basis of M\n",
"v=var('v',n=3) # components of vector v\n",
"v=M(list(v)) # define vector v"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Element of the 3-dimensional vector space M over the Symbolic Ring\n"
]
},
{
"data": {
"text/html": [
"\\(\\displaystyle \\left[v_{0}, v_{1}, v_{2}\\right]\\)"
],
"text/latex": [
"$\\displaystyle \\left[v_{0}, v_{1}, v_{2}\\right]$"
],
"text/plain": [
"[v0, v1, v2]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(v) # information on v\n",
"v.comp()[:] # components of v"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"General linear forms on a 3-dimensional module can be defined as follows:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"a=M.linear_form() # linear form a on M\n",
"a[:]=var('a',n=4) # components of a"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle a_{0} e^{0} + a_{1} e^{1} + a_{2} e^{2}\\)"
],
"text/latex": [
"$\\displaystyle a_{0} e^{0} + a_{1} e^{1} + a_{2} e^{2}$"
],
"text/plain": [
"a0 e^0 + a1 e^1 + a2 e^2"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.disp() # show a as combination\n",
" # of dual basis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The linear form applied to a vector gives a scalar."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle a_{0} v_{0} + a_{1} v_{1} + a_{2} v_{2}\\)"
],
"text/latex": [
"$\\displaystyle a_{0} v_{0} + a_{1} v_{1} + a_{2} v_{2}$"
],
"text/plain": [
"a0*v0 + a1*v1 + a2*v2"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a(v) # value a(v)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The value of a vector $v\\in M$ on a linear form $a\\in M^*$ is by definition equal to $a(v)$. "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle a_{0} v_{0} + a_{1} v_{1} + a_{2} v_{2}\\)"
],
"text/latex": [
"$\\displaystyle a_{0} v_{0} + a_{1} v_{1} + a_{2} v_{2}$"
],
"text/plain": [
"a0*v0 + a1*v1 + a2*v2"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"v(a) # value v(a)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"Now we are ready to define more general objects."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"\n",
"## Tensors on modules\n",
"\n",
"
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If $M$ is a vector space or a module, by a **multilinear** or more precisely $k$-**linear form** we mean a function $t:\n",
"M^k\\to R$ which is linear in each of its arguments, i.e., for $i=1,\\ldots,k$\n",
"\n",
"$$t(v_1\\ldots,\\alpha v_i+\\beta w_i,\\ldots v_k)=\n",
"\\alpha t(v_1\\ldots,v_i,\\ldots v_k)+\\beta t(v_1\\ldots,w_i,\\ldots v_k),\\quad \\alpha,\\beta\\in R,\\quad v_i,w_i\\in M.$$\n",
"\n",
"
\n",
"\n",
"Assume that $M$ is a module."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"### Tensor module $T^{(k,l)}M$\n",
"\n",
"
\n",
"\n",
"\n",
"**Tensors** of type (k,l) on $ M$ \n",
"are multilinear maps:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$ T^{(k,l)}M = \\{t:\\underbrace{M^*\\times\\cdots\\times M^*}_{k\\ \\; \\mbox{times}}\n",
" \\times \\underbrace{M\\times\\cdots\\times M}_{l\\ \\; \\mbox{times}}\\to R\\},$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"where $\\ M^*\\ $ denotes the dual module, i.e. the module of linear forms on $M$ (cf. [notebook 6](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/06Manifold_VectSpaces_Modules.ipynb)).\n",
"\n",
"Since $a\\to v(a)$ defines a linear form $M^*\\to R$, the elements $v\\in M$ can be considered as elements of $T^{(1,0)}M$. On the other hand $T^{(0,1)}M$ as the space of linear forms on $M$ is equal to $M^*$. Thus, **tensors generalize vectors and linear forms**. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"**Example 9.2a**\n",
"\n",
"Let us show how to use `tensor_module` method of SageMath Manifolds."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle M\\)"
],
"text/latex": [
"$\\displaystyle M$"
],
"text/plain": [
"3-dimensional vector space M over the Symbolic Ring"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# continuation\n",
"M.tensor_module(1,0) # elements of T^(1,0) are vectors"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3-dimensional vector space M over the Symbolic Ring\n"
]
}
],
"source": [
"print(M.tensor_module(1,0)) # T^(1,0) = M\n",
"# since the ring SR is a field we obtain vector space"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle M^*\\)"
],
"text/latex": [
"$\\displaystyle M^*$"
],
"text/plain": [
"Free module of type-(0,1) tensors on the 3-dimensional vector space M over the Symbolic Ring"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M.tensor_module(0,1) # T^(0,1) = M*"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Free module of type-(0,1) tensors on the 3-dimensional vector space M over the Symbolic Ring\n"
]
}
],
"source": [
"print(M.tensor_module(0,1))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"### Module $T^{(0,k)}M$ - of covariant tensors of rank $k$\n",
"\n",
"
\n",
"\n",
"is the module of multilinear maps"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$ T^{(0,k)}M = \\{t:\\underbrace{M\\times\\cdots\\times M}_{k\\ \\; \\mbox{times}}\\to R\\}.$$\n",
"For k=1 we obtain the module of linear forms or **covectors** on $M$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In $T^{(0,k)}M$ we introduce the **algebraic operations** by\n",
"\n",
"$$ (at+bs)(v_1\\ldots,v_k)=at(v_1\\ldots,v_k)+bs(v_1\\ldots,v_k),$$\n",
"\n",
"where $t,s\\in T^{(0,k)}M$, $v_1,\\ldots,v_k\\in M$ and $a,b\\in R$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For $t\\in T^{(0,k)},\\ s\\in T^{(0,l)}M$ we define the **tensor product** $\\ t\\otimes s\\in T^{(0,k+l)}M\\ $ by\n",
"\n",
"\\begin{equation}\n",
"(t ⊗ s )(v_1 ,\\ldots , v_{k+l} ) = t (v_1 ,\\ldots, v_k ) s (v_{k+1} , . . . , v_{k+l} ),\n",
"\\label{eq:tensor_product}\\tag{9.1a}\n",
"\\end{equation}\n",
"\n",
"for $v_1,\\ldots,v_{k+l}\\in M$.
\n",
"In SageMath Manifolds the symbol of tensor product is simply $*$.
\n",
"\n",
"
\n",
"\n",
"**Example 9.3a**\n",
"\n",
"Let us check the last formula in the case of two general tensors from $T^{(0,2)}$ and 2-dimensional module."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"N=2; # dimension of module\n",
"%display latex\n",
"Mo=FiniteRankFreeModule(SR,2,name='Mo') # module Mo\n",
"e = Mo.basis('e') # basis of Mo\n",
"t=Mo.tensor((0,2)) # (0,2) type tensor t\n",
"s=Mo.tensor((0,2)) # (0,2) type tensor s"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle \\left[\\left[{v^0_0}, {v^1_0}\\right], \\left[{v^0_1}, {v^1_1}\\right], \\left[{v^0_2}, {v^1_2}\\right], \\left[{v^0_3}, {v^1_3}\\right]\\right]\\)"
],
"text/latex": [
"$\\displaystyle \\left[\\left[{v^0_0}, {v^1_0}\\right], \\left[{v^0_1}, {v^1_1}\\right], \\left[{v^0_2}, {v^1_2}\\right], \\left[{v^0_3}, {v^1_3}\\right]\\right]$"
],
"text/plain": [
"[[v00, v10], [v01, v11], [v02, v12], [v03, v13]]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"M=4 # number of vectors \n",
"vv=[[var('v'+str(i)+str(j), # components of four vectors\n",
" latex_name='v'+'^'+str(i)+'_'+str(j))\n",
" for i in range(N)] for j in range(M)]\n",
"vv "
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"v=[Mo(vv[k]) for k in range(M)] # list of vectors\n",
"tt=[[var('t'+str(i)+str(j)) # components of tensor t\n",
" for j in range(M)] for i in range(N)]\n",
"ss=[[var('t'+str(i)+str(j)) # components of tensor s\n",
" for j in range(M)] for i in range(N)]\n",
"\n",
"\n",
"t[:]=tt # define tensor t components t_{ij}\n",
"s[:]=ss # define tensor s components s_{ij}"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle \\mathrm{True}\\)"
],
"text/latex": [
"$\\displaystyle \\mathrm{True}$"
],
"text/plain": [
"True"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# check the equality (9.1a) defining tensor product\n",
"bool((t*s)(v[0],v[1],v[2],v[3])==t(v[0],v[1])*s(v[2],v[3]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"Tensor product has the following properties (proofs for modules $T_pM,$ where $M$ denotes a manifold are given in the [next notebook](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/09Manifold_LinearFormsTensors_onTp.ipynb))\n",
"\n",
"\\begin{equation}\n",
"\\begin{matrix}\n",
"(ar + bs ) ⊗ t = ar ⊗ t + bs ⊗ t ,\\\\\n",
"r ⊗ (as + bt ) = ar ⊗ s + br ⊗ t ,\\\\\n",
"(r ⊗ s ) ⊗ t = r ⊗ (s ⊗ t ),\n",
"\\end{matrix}\n",
"\\label{eq:tensor_product_prop}\\tag{9.2a}\n",
"\\end{equation}\n",
"\n",
"for $a,b\\in R\\ $ and for arbitrary covariant tensors $r,s,t$ (the addition is defined only for tensors of the same rank $(0,k)$). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"### Covariant tensors in components\n",
"\n",
"
\n",
"\n",
"\n",
"One can check that if $e_1,\\ldots,e_n$ is a basis of the module $M$\n",
"and $e^1,\\ldots,e^n\\ $ its dual basis (defined in [notebook 6](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/06Manifold_VectSpaces_Modules.ipynb)), then the elements\n",
"\n",
"\\begin{equation}\n",
"e^{j_1}\\otimes\\ldots \\otimes e^{j_m}, \\quad j_q\\in\\{1,\\ldots,n\\}\n",
"\\tag{9.2a}\n",
"\\end{equation}\n",
"\n",
"form a basis for $T^{(0,m)}M$ and if we put\n",
"\n",
"$$t_{j_1\\ldots j_m}\n",
"=t(e_{j_1},\\ldots,e_{j_m}),\n",
"$$\n",
"\n",
"then \n",
"\n",
"\\begin{equation}\n",
"t=t_{j_1\\ldots j_m}\n",
"e^{j_1}\\otimes\\ldots\\otimes e^{j_m}, \\quad \\text{for }\\ t\\in T^{(0,m)}M.\n",
"\\tag{9.3a}\n",
"\\end{equation}\n",
"\n",
"In fact, since $\\ v_1=e^{j_1}(v_1)e_{j_1},\\ldots, v_m=e^{j_m}(v_m)e_{j_m},\\ $ then\n",
"\n",
"$$t(v_1,\\ldots,v_m)=t(e^{j_1}(v_1)e_{j_1},\\ldots,e^{j_m}(v_m)e_{j_m})\\\\\n",
"=e^{j_1}(v_1)\\ldots e^{j_m}(v_m)t(e_{j_1},\\ldots,e_{j_m})\\\\\n",
"=t_{j_1\\ldots j_m}e^{j_1}\\otimes \\ldots \\otimes e^{j_m}(v_1,\\ldots v_m).\n",
"$$\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"**Example 9.4a**\n",
"\n",
"Let us show the representation of a tensor $\\ t\\in T^{(0,3)}M\\ $ in components."
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle \\left[\\left[\\left[t_{000}, t_{001}\\right], \\left[t_{010}, t_{011}\\right]\\right], \\left[\\left[t_{100}, t_{101}\\right], \\left[t_{110}, t_{111}\\right]\\right]\\right]\\)"
],
"text/latex": [
"$\\displaystyle \\left[\\left[\\left[t_{000}, t_{001}\\right], \\left[t_{010}, t_{011}\\right]\\right], \\left[\\left[t_{100}, t_{101}\\right], \\left[t_{110}, t_{111}\\right]\\right]\\right]$"
],
"text/plain": [
"[[[t000, t001], [t010, t011]], [[t100, t101], [t110, t111]]]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"N=2 # dimension of module\n",
"st=[[[var('t'+str(i0)+str(i1)+str(i2)) # components of t\n",
" for i2 in range(N)] \n",
" for i1 in range(N)] \n",
" for i0 in range(N)]\n",
"st # show components"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"Mo=FiniteRankFreeModule(SR,2,name='Mo') # module Mo\n",
"e = Mo.basis('e') # basis of Mo\n",
"%display latex\n",
"t = Mo.tensor((0,3), name='t') # tensor of (0,3) type\n",
"t[:]=st # define all components"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"General tensor of type (0,3) on a 2-dimensional module:"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = t_{000} e^{0}\\otimes e^{0}\\otimes e^{0} + t_{001} e^{0}\\otimes e^{0}\\otimes e^{1} + t_{010} e^{0}\\otimes e^{1}\\otimes e^{0} + t_{011} e^{0}\\otimes e^{1}\\otimes e^{1} + t_{100} e^{1}\\otimes e^{0}\\otimes e^{0} + t_{101} e^{1}\\otimes e^{0}\\otimes e^{1} + t_{110} e^{1}\\otimes e^{1}\\otimes e^{0} + t_{111} e^{1}\\otimes e^{1}\\otimes e^{1}\\)"
],
"text/latex": [
"$\\displaystyle t = t_{000} e^{0}\\otimes e^{0}\\otimes e^{0} + t_{001} e^{0}\\otimes e^{0}\\otimes e^{1} + t_{010} e^{0}\\otimes e^{1}\\otimes e^{0} + t_{011} e^{0}\\otimes e^{1}\\otimes e^{1} + t_{100} e^{1}\\otimes e^{0}\\otimes e^{0} + t_{101} e^{1}\\otimes e^{0}\\otimes e^{1} + t_{110} e^{1}\\otimes e^{1}\\otimes e^{0} + t_{111} e^{1}\\otimes e^{1}\\otimes e^{1}$"
],
"text/plain": [
"t = t000 e^0⊗e^0⊗e^0 + t001 e^0⊗e^0⊗e^1 + t010 e^0⊗e^1⊗e^0 + t011 e^0⊗e^1⊗e^1 + t100 e^1⊗e^0⊗e^0 + t101 e^1⊗e^0⊗e^1 + t110 e^1⊗e^1⊗e^0 + t111 e^1⊗e^1⊗e^1"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.disp() # show t"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tensor of type (0,3) on a 2-dimensional module with concrete components:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = e^{0}\\otimes e^{0}\\otimes e^{0} + 2 e^{0}\\otimes e^{0}\\otimes e^{1} + 3 e^{0}\\otimes e^{1}\\otimes e^{0} + 4 e^{0}\\otimes e^{1}\\otimes e^{1} + 5 e^{1}\\otimes e^{0}\\otimes e^{0} + 6 e^{1}\\otimes e^{0}\\otimes e^{1} + 7 e^{1}\\otimes e^{1}\\otimes e^{0} + 8 e^{1}\\otimes e^{1}\\otimes e^{1}\\)"
],
"text/latex": [
"$\\displaystyle t = e^{0}\\otimes e^{0}\\otimes e^{0} + 2 e^{0}\\otimes e^{0}\\otimes e^{1} + 3 e^{0}\\otimes e^{1}\\otimes e^{0} + 4 e^{0}\\otimes e^{1}\\otimes e^{1} + 5 e^{1}\\otimes e^{0}\\otimes e^{0} + 6 e^{1}\\otimes e^{0}\\otimes e^{1} + 7 e^{1}\\otimes e^{1}\\otimes e^{0} + 8 e^{1}\\otimes e^{1}\\otimes e^{1}$"
],
"text/plain": [
"t = e^0⊗e^0⊗e^0 + 2 e^0⊗e^0⊗e^1 + 3 e^0⊗e^1⊗e^0 + 4 e^0⊗e^1⊗e^1 + 5 e^1⊗e^0⊗e^0 + 6 e^1⊗e^0⊗e^1 + 7 e^1⊗e^1⊗e^0 + 8 e^1⊗e^1⊗e^1"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# continuation\n",
"ct=range(1,9) # [1,...,8] consecutive components\n",
"for i0 in range(N):\n",
" for i1 in range(N):\n",
" for i2 in range(N):\n",
" t[i0,i1,i2]=ct[i0*N*N+i1*N+i2]\n",
"t.disp()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Basis (e_0,e_1) on the 2-dimensional vector space Mo over the Symbolic Ring\n"
]
}
],
"source": [
"print(e) # basis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check that the coefficient $t_{011}$ is equal to $t(e_0,e_1,e_1)$:"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle 4\\)"
],
"text/latex": [
"$\\displaystyle 4$"
],
"text/plain": [
"4"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t(e[0],e[1],e[1]) # t(e_0,e_1,e_1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"### Module $T^{(k,0)}M $ of contravariant tensors of rank $k$\n",
"\n",
"
\n",
"\n",
"is the module of $k$-linear forms:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$ T^{(k,0)}M = \\{t:\\underbrace{M^*\\times\\cdots\\times M^*}_{k\\ \\;\\mbox{times}}\n",
" \\to R\\}.$$\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In $T^{(k,0)}M$ we introduce the module structure by\n",
"\n",
"$$ (at+bs)(\\alpha_1\\ldots,\\alpha_k)=at(\\alpha_1\\ldots,\\alpha_k)+bs(\\alpha_1\\ldots,\\alpha_k),$$\n",
"\n",
"where $t,s\\in T^{(k,0)}M$, $\\alpha_1,\\ldots,\\alpha_k\\in M^*$ and $a,b\\in R$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For $t,s\\in T^{(k,0)}M$ we define the **tensor product** $t\\otimes s\\ $ by\n",
"\n",
"\\begin{equation}\n",
"(t ⊗ s )(\\alpha_1 ,\\ldots , \\alpha_{k+l} ) ≡ t (\\alpha_1 ,\\ldots, \\alpha_k ) s(\\alpha_{k+1} , \\ldots , \\alpha_{k+l} ),\n",
"\\tag{9.4a}\n",
"\\end{equation}\n",
"\n",
"for $\\alpha_1,\\ldots,\\alpha_{k+l}\\in M^*$.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"### Contravariant tensors in components\n",
"\n",
"
\n",
"\n",
"One can check that if $e_1,\\ldots,e_n$ is a basis of the module $M$\n",
"and $e^1,\\ldots,e^n$ its dual basis then the elements\n",
"\n",
"$$e_{i_1}\\otimes\\ldots\\otimes e_{i_k}, \\quad i_p\\in\\{1,\\ldots,n\\}\n",
"$$\n",
"\n",
"form a basis for $T^{(k,0)}M$ and if we put\n",
"\n",
"$$t^{i_1\\ldots i_k}\n",
"=t(e^{i_1},\\ldots,e^{i_k}),\n",
"$$\n",
"\n",
"then \n",
"\n",
"\\begin{equation}\n",
"t=t^{i_1\\ldots i_k}\n",
"e_{i_1}\\otimes\\ldots\\otimes e_{i_k}, \\quad \\text{for }\\ t\\in T^{(k,0)}M.\n",
"\\tag{9.5a}\n",
"\\end{equation}\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This follows from $\\alpha(v)=\\alpha(e^i(v)e_\n",
"i)=\\alpha(e_i)e^i(v),\\ $ and $\\ v(\\alpha)=\\alpha(v)$ for linear form $\\ \\alpha\\in M^*\\ $ and $\\ v\\in M,\\ $since we have\n",
"\n",
"$$t(\\alpha_1,\\ldots,\\alpha_k)=\n",
"t(\\alpha_1(e_{i_1})e^{i_1},\\ldots,\\alpha_k(e_{i_k})e^{i_k})\\\\\n",
"=\\alpha_1(e_{i_1})\\ldots \\alpha_k(e_{i_k})t(e^{i_1},\\ldots,e^{i_k})\\\\\n",
"=e_{i_1}(\\alpha_1)\\ldots e_{i_k}(\\alpha_k)t(e^{i_1},\\ldots, e^{i_k})\\\\\n",
"=t^{i_1\\ldots i_k} e_{i_1}\\otimes \\ldots \\otimes e_{i_k}(\\alpha_1,\\ldots,\\alpha_k).\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"**Example 9.5a**\n",
"\n",
"Let us show the representation of a tensor of type (3,0) in components."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle \\left[\\left[\\left[{t^{000}}, {t^{001}}\\right], \\left[{t^{010}}, {t^{011}}\\right]\\right], \\left[\\left[{t^{100}}, {t^{101}}\\right], \\left[{t^{110}}, {t^{111}}\\right]\\right]\\right]\\)"
],
"text/latex": [
"$\\displaystyle \\left[\\left[\\left[{t^{000}}, {t^{001}}\\right], \\left[{t^{010}}, {t^{011}}\\right]\\right], \\left[\\left[{t^{100}}, {t^{101}}\\right], \\left[{t^{110}}, {t^{111}}\\right]\\right]\\right]$"
],
"text/plain": [
"[[[t000, t001], [t010, t011]], [[t100, t101], [t110, t111]]]"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%display latex\n",
"N=2 # dimension of module\n",
"st=[[[var('t'+str(i0)+str(i1)+str(i2),\n",
" latex_name='t'+'^'+'{'+str(i0)+str(i1)+str(i2)+'}') \n",
" for i2 in range(N)] \n",
" for i1 in range(N)] # components of t\n",
" for i0 in range(N)] # with superscripts\n",
"st # show components"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"Mo=FiniteRankFreeModule(SR,2,name='Mo') # module Mo\n",
"e = Mo.basis('e') # basis of Mo\n",
"t = Mo.tensor((3,0), name='t') # tensor of (3,0) type\n",
"t[:]=st # define all components"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"General tensor of type (3,0) on a 2-dimensional module:"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = {t^{000}} e_{0}\\otimes e_{0}\\otimes e_{0} + {t^{001}} e_{0}\\otimes e_{0}\\otimes e_{1} + {t^{010}} e_{0}\\otimes e_{1}\\otimes e_{0} + {t^{011}} e_{0}\\otimes e_{1}\\otimes e_{1} + {t^{100}} e_{1}\\otimes e_{0}\\otimes e_{0} + {t^{101}} e_{1}\\otimes e_{0}\\otimes e_{1} + {t^{110}} e_{1}\\otimes e_{1}\\otimes e_{0} + {t^{111}} e_{1}\\otimes e_{1}\\otimes e_{1}\\)"
],
"text/latex": [
"$\\displaystyle t = {t^{000}} e_{0}\\otimes e_{0}\\otimes e_{0} + {t^{001}} e_{0}\\otimes e_{0}\\otimes e_{1} + {t^{010}} e_{0}\\otimes e_{1}\\otimes e_{0} + {t^{011}} e_{0}\\otimes e_{1}\\otimes e_{1} + {t^{100}} e_{1}\\otimes e_{0}\\otimes e_{0} + {t^{101}} e_{1}\\otimes e_{0}\\otimes e_{1} + {t^{110}} e_{1}\\otimes e_{1}\\otimes e_{0} + {t^{111}} e_{1}\\otimes e_{1}\\otimes e_{1}$"
],
"text/plain": [
"t = t000 e_0⊗e_0⊗e_0 + t001 e_0⊗e_0⊗e_1 + t010 e_0⊗e_1⊗e_0 + t011 e_0⊗e_1⊗e_1 + t100 e_1⊗e_0⊗e_0 + t101 e_1⊗e_0⊗e_1 + t110 e_1⊗e_1⊗e_0 + t111 e_1⊗e_1⊗e_1"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.disp() # show t"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tensor of type (3,0) on a 2-dimensional module with concrete components:"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = e_{0}\\otimes e_{0}\\otimes e_{0} + 2 e_{0}\\otimes e_{0}\\otimes e_{1} + 3 e_{0}\\otimes e_{1}\\otimes e_{0} + 4 e_{0}\\otimes e_{1}\\otimes e_{1} + 5 e_{1}\\otimes e_{0}\\otimes e_{0} + 6 e_{1}\\otimes e_{0}\\otimes e_{1} + 7 e_{1}\\otimes e_{1}\\otimes e_{0} + 8 e_{1}\\otimes e_{1}\\otimes e_{1}\\)"
],
"text/latex": [
"$\\displaystyle t = e_{0}\\otimes e_{0}\\otimes e_{0} + 2 e_{0}\\otimes e_{0}\\otimes e_{1} + 3 e_{0}\\otimes e_{1}\\otimes e_{0} + 4 e_{0}\\otimes e_{1}\\otimes e_{1} + 5 e_{1}\\otimes e_{0}\\otimes e_{0} + 6 e_{1}\\otimes e_{0}\\otimes e_{1} + 7 e_{1}\\otimes e_{1}\\otimes e_{0} + 8 e_{1}\\otimes e_{1}\\otimes e_{1}$"
],
"text/plain": [
"t = e_0⊗e_0⊗e_0 + 2 e_0⊗e_0⊗e_1 + 3 e_0⊗e_1⊗e_0 + 4 e_0⊗e_1⊗e_1 + 5 e_1⊗e_0⊗e_0 + 6 e_1⊗e_0⊗e_1 + 7 e_1⊗e_1⊗e_0 + 8 e_1⊗e_1⊗e_1"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# continuation\n",
"ct=range(1,9) # [1,...,8]- consecutive components\n",
"for i0 in range(N):\n",
" for i1 in range(N):\n",
" for i2 in range(N):\n",
" t[i0,i1,i2]=ct[i0*N*N+i1*N+i2]\n",
"t.disp()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Dual basis (e^0,e^1) on the 2-dimensional vector space Mo over the Symbolic Ring\n"
]
}
],
"source": [
"d=e.dual_basis() # dual basis\n",
"print(d)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check that the coefficient $t^{011}$ is equal to $t( e^0,e^1, e^1)$:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle 4\\)"
],
"text/latex": [
"$\\displaystyle 4$"
],
"text/plain": [
"4"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t(d[0],d[1],d[1]) # t(e^0,e^1,e^1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"### General tensors from $T^{(k,l)}M$ in components\n",
"\n",
"
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For $t\\in T^{(k_1,l_1)}M,\\ \\ s\\in T^{(k_2,l_2)}M$ we define the **tensor product** $t\\otimes s\\in T^{(k_1+k_2,l_1+l_2)}$ by\n",
"\n",
"\\begin{equation}\n",
"(t ⊗ s )(\\alpha_1,\\ldots\\alpha_{k_1+k_2},v_1 ,\\ldots , v_{l_1+l_2} )\\\\\n",
"=t(\\alpha_1,\\ldots,\\alpha_{k_1},v_1 ,\\ldots, v_{l_1} ) s (\\alpha_{k_1+1},\\ldots,\\alpha_{k_1+k_2},v_{l_1+1},\\ldots, v_{l_1+l_2} ),\n",
"\\tag{9.6a}\n",
"\\end{equation}\n",
"\n",
"for $\\alpha_1,\\ldots,\\alpha_{k_1+k_2}\\in M^*$ and $v_1,\\ldots,v_{l_1+l_2}\\in M$.
\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Generalizing the formulas (9.3a) and (9.5a) we obtain the following expression for the general tensor $t\\in T^{(k,l)}M$ in components\n",
"\n",
"\\begin{equation}\n",
"t=\n",
"t\\big(e^{i_1},..,e^{i_k},e_{j_1},..,e_{j_l})\n",
" e_{i_1}\\otimes\\dots\\otimes e_{i_k}\\otimes e^{j_1}\\otimes\\ldots\\otimes e^{j_l}.\n",
" \\label{}\\tag{9.7a}\n",
"\\end{equation}\n",
"\n",
"Very often the notation\n",
"$$t^{i_1\\ldots i_k}_{j_1\\ldots j_l}=t_p\\big(e^{i_1},..,e^{i_k},e_{j_1},..,e_{j_l})\n",
"$$\n",
"is used and then \n",
"$$t=t^{i_1\\ldots i_k}_{j_1\\ldots j_l}e_{i_1}\\otimes\\dots\\otimes e_{i_k}\\otimes e^{j_1}\\otimes\\ldots\\otimes e^{j_l}.\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To check that the elements\n",
"\\begin{equation}\n",
"e_{i_1}\\otimes\\dots\\otimes e_{i_k}\\otimes e^{j_1}\\otimes\\ldots\\otimes e^{j_l}\n",
"\\label{} \\tag{9.8a}\n",
"\\end{equation}\n",
"\n",
"are linearly independent, assume that the linear combination\n",
"\n",
"$$a^{i_1\\ldots i_k}_{j_1\\ldots j_l}e_{i_1}\\otimes\\dots\\otimes e_{i_k}\\otimes e^{j_1}\\otimes\\ldots\\otimes e^{j_l}\n",
"$$\n",
"\n",
"vanishes. If we apply this combination to $\\quad(e^{m_1},\\ldots,e^{m_k}, e_{n_1},..,e_{n_l}\\big)$ we get $\\displaystyle a^{m_1\\ldots m_k}_{n_1\\ldots n_l}=0$.
\n",
"Since as in previous cases we can check that elements of the type (9.8a) span $T^{(k,l)}M$, we have proved that these elements form a **basis** for $T^{(k,l)}M$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"\n",
"**Example 9.6a**\n",
"\n",
"Now we show the representation of a tensor of (2,2) type in components."
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle \\left[\\left[\\left[\\left[{t^{00}_{00}}, {t^{00}_{01}}\\right], \\left[{t^{00}_{10}}, {t^{00}_{11}}\\right]\\right], \\left[\\left[{t^{01}_{00}}, {t^{01}_{01}}\\right], \\left[{t^{01}_{10}}, {t^{01}_{11}}\\right]\\right]\\right], \\left[\\left[\\left[{t^{10}_{00}}, {t^{10}_{01}}\\right], \\left[{t^{10}_{10}}, {t^{10}_{11}}\\right]\\right], \\left[\\left[{t^{11}_{00}}, {t^{11}_{01}}\\right], \\left[{t^{11}_{10}}, {t^{11}_{11}}\\right]\\right]\\right]\\right]\\)"
],
"text/latex": [
"$\\displaystyle \\left[\\left[\\left[\\left[{t^{00}_{00}}, {t^{00}_{01}}\\right], \\left[{t^{00}_{10}}, {t^{00}_{11}}\\right]\\right], \\left[\\left[{t^{01}_{00}}, {t^{01}_{01}}\\right], \\left[{t^{01}_{10}}, {t^{01}_{11}}\\right]\\right]\\right], \\left[\\left[\\left[{t^{10}_{00}}, {t^{10}_{01}}\\right], \\left[{t^{10}_{10}}, {t^{10}_{11}}\\right]\\right], \\left[\\left[{t^{11}_{00}}, {t^{11}_{01}}\\right], \\left[{t^{11}_{10}}, {t^{11}_{11}}\\right]\\right]\\right]\\right]$"
],
"text/plain": [
"[[[[t0000, t0001], [t0010, t0011]], [[t0100, t0101], [t0110, t0111]]],\n",
" [[[t1000, t1001], [t1010, t1011]], [[t1100, t1101], [t1110, t1111]]]]"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%display latex\n",
"N=2 # dimension of module \n",
"st=[[[[var('t'+str(i0)+str(i1)+str(i2)+str(i3),\n",
" latex_name='t'+'^'+'{'+str(i0)+str(i1)+'}'+'_'+\n",
" '{'+str(i2)+str(i3)+'}') \n",
" for i3 in range(N)] for i2 in range(N)] # comp. with upper\n",
" for i1 in range(N)] for i0 in range(N)] # and lower indices\n",
"st # show components"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"Mo=FiniteRankFreeModule(SR,2,name='Mo') # module Mo \n",
"e = Mo.basis('e') # basis of Mo\n",
"t = Mo.tensor((2,2), name='t') # tensor of (2,2) type\n",
"t[:]=st # define all components"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"General tensor from $T^{(2,2)}M$ on a 2-dimensional module ($2^4$ components):"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = {t^{00}_{00}} e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + {t^{00}_{01}} e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + {t^{00}_{10}} e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + {t^{00}_{11}} e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + {t^{01}_{00}} e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + {t^{01}_{01}} e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + {t^{01}_{10}} e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + {t^{01}_{11}} e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1} + {t^{10}_{00}} e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + {t^{10}_{01}} e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + {t^{10}_{10}} e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + {t^{10}_{11}} e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + {t^{11}_{00}} e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + {t^{11}_{01}} e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + {t^{11}_{10}} e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + {t^{11}_{11}} e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1}\\)"
],
"text/latex": [
"$\\displaystyle t = {t^{00}_{00}} e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + {t^{00}_{01}} e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + {t^{00}_{10}} e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + {t^{00}_{11}} e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + {t^{01}_{00}} e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + {t^{01}_{01}} e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + {t^{01}_{10}} e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + {t^{01}_{11}} e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1} + {t^{10}_{00}} e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + {t^{10}_{01}} e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + {t^{10}_{10}} e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + {t^{10}_{11}} e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + {t^{11}_{00}} e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + {t^{11}_{01}} e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + {t^{11}_{10}} e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + {t^{11}_{11}} e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1}$"
],
"text/plain": [
"t = t0000 e_0⊗e_0⊗e^0⊗e^0 + t0001 e_0⊗e_0⊗e^0⊗e^1 + t0010 e_0⊗e_0⊗e^1⊗e^0 + t0011 e_0⊗e_0⊗e^1⊗e^1 + t0100 e_0⊗e_1⊗e^0⊗e^0 + t0101 e_0⊗e_1⊗e^0⊗e^1 + t0110 e_0⊗e_1⊗e^1⊗e^0 + t0111 e_0⊗e_1⊗e^1⊗e^1 + t1000 e_1⊗e_0⊗e^0⊗e^0 + t1001 e_1⊗e_0⊗e^0⊗e^1 + t1010 e_1⊗e_0⊗e^1⊗e^0 + t1011 e_1⊗e_0⊗e^1⊗e^1 + t1100 e_1⊗e_1⊗e^0⊗e^0 + t1101 e_1⊗e_1⊗e^0⊗e^1 + t1110 e_1⊗e_1⊗e^1⊗e^0 + t1111 e_1⊗e_1⊗e^1⊗e^1"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.disp() # show t"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here is a version with concrete components:"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"ct=range(1,17) # [1,..,16]-consecutive components\n",
"for i0 in range(N): \n",
" for i1 in range(N):\n",
" for i2 in range(N):\n",
" for i3 in range(N):\n",
" t[i0,i1,i2,i3]=ct[i0*N*N*N+i1*N*N+i2*N+i3]"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle t = e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + 2 e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + 3 e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + 4 e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + 5 e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + 6 e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + 7 e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + 8 e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1} + 9 e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + 10 e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + 11 e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + 12 e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + 13 e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + 14 e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + 15 e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + 16 e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1}\\)"
],
"text/latex": [
"$\\displaystyle t = e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + 2 e_{0}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + 3 e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + 4 e_{0}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + 5 e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + 6 e_{0}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + 7 e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + 8 e_{0}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1} + 9 e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{0} + 10 e_{1}\\otimes e_{0}\\otimes e^{0}\\otimes e^{1} + 11 e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{0} + 12 e_{1}\\otimes e_{0}\\otimes e^{1}\\otimes e^{1} + 13 e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{0} + 14 e_{1}\\otimes e_{1}\\otimes e^{0}\\otimes e^{1} + 15 e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{0} + 16 e_{1}\\otimes e_{1}\\otimes e^{1}\\otimes e^{1}$"
],
"text/plain": [
"t = e_0⊗e_0⊗e^0⊗e^0 + 2 e_0⊗e_0⊗e^0⊗e^1 + 3 e_0⊗e_0⊗e^1⊗e^0 + 4 e_0⊗e_0⊗e^1⊗e^1 + 5 e_0⊗e_1⊗e^0⊗e^0 + 6 e_0⊗e_1⊗e^0⊗e^1 + 7 e_0⊗e_1⊗e^1⊗e^0 + 8 e_0⊗e_1⊗e^1⊗e^1 + 9 e_1⊗e_0⊗e^0⊗e^0 + 10 e_1⊗e_0⊗e^0⊗e^1 + 11 e_1⊗e_0⊗e^1⊗e^0 + 12 e_1⊗e_0⊗e^1⊗e^1 + 13 e_1⊗e_1⊗e^0⊗e^0 + 14 e_1⊗e_1⊗e^0⊗e^1 + 15 e_1⊗e_1⊗e^1⊗e^0 + 16 e_1⊗e_1⊗e^1⊗e^1"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t.disp()"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
"d=e.dual_basis() # dual basis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check that the coefficient $t^{10}_{01}$ is equal to $t(e^1,e^0,e_0,e_1)$:"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\\(\\displaystyle 10\\)"
],
"text/latex": [
"$\\displaystyle 10$"
],
"text/plain": [
"10"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t(d[1],d[0],e[0],e[1]) # t(e^1,e^0,e_0,e_1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What's next?\n",
"\n",
"Take a look at the notebook [Tensors on $T_pM$](https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/09Manifold_LinearFormsTensors_onTp.ipynb)."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 9.6",
"language": "sage",
"name": "sagemath"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 4
}