This notebook is part of the Introduction to manifolds in SageMath by Andrzej Chrzeszczyk (Jan Kochanowski University of Kielce, Poland).
version()
'SageMath version 9.6, Release Date: 2022-05-15'
Warning. In this notebook there are many repetitions with respect to the notebook 9a. Tensors on modules. Although mathematically tensors on modules are generalizations of tensors on the tangent spaces, the SageMath Manifolds code in the present notebook differs significantly from that in notebook 9a.
If $M$ is a smooth manifold, $p ∈ M$, $T_pM$ is the tangent space to $M$ at $p$, and $f ∈ C^∞(M)$, then the differential of $f$ at $p$, denoted by $d f_p$, is defined by
\begin{equation} df_p(X_p)=X_p(f),\quad\mbox{for } X_p\in T_pM. \label{} \tag{9.1} \end{equation}Let us show some examples of scalar functions and differentials.
Example 9.1
Define a 3-dimensional manifold $M,$ a point $p\in M$, the tangent space at $T_pM$, a tangent vector $v\in T_pM$ and some scalar function $f$ on $M$.
%display latex
N = 3
M = Manifold(N, 'M') # manifold M of dimension N
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # generic point p of M
Tp = M.tangent_space(p) # tangent space at p
# components of tangent vector v:
vn = [var('v'+str(i), latex_name='v'+'^'+str(i)) for i in range(N)]
v = Tp(vn, name='v') # tangent vector v
f = M.scalar_field(function('f')(*X), name='f') # scalar funct.
print(p) # information on p
p.coord() # coordinates of p
Point p on the 3-dimensional differentiable manifold M
print(v) # information on v
v.comp()[:] # components of v
Tangent vector v at Point p on the 3-dimensional differentiable manifold M
f.disp() # show scalar function f
Now let us define the differential of $f$ at $p$:
# continuation
df = f.differential() # differential of f
dfp = df.at(p) # differential of f at p
print("df_p is a")
print(dfp) # information on dfp
print("Components of df_p:")
dfp.components()[:] # components of differential at p
df_p is a Linear form df on the Tangent space at Point p on the 3-dimensional differentiable manifold M Components of df_p:
and check that the value of $df$ at $p$ on the tangent vector $v$ is equal to $v(f)$:
bool(dfp(v)==v(f)) # check if df_p(v)=v(f)
Recall that for a vector space (or a module) $V$ the map $t:V\to R$ is linear iff
$$ t (av + bw ) = at(v) + bt(w ),\quad\text{for}\quad v,w\in V,\quad a,b\in R.$$To check that $df_p: T_pM\to R$ is linear let us note that
$$d f_p (av_p + bw_p ) = (av_p + bw_p )( f ) = av_p ( f ) + bw_p ( f ) = a d f_p (v_p ) + b d f_p (w_p ).$$The space of linear forms on $T_pM$ is by definition the dual space of $T_pM$ and is denoted by $T_p^*M$. Elements of $T_p^*M$ are called covectors or covariant vectors and $T_p^*M$ is called the cotangent space to $M$ at $p$.
The vector space operations in $T_p^*M$ are defined in a natural way
for $\ \ α_p , β_p ∈ T_p^∗ M,\ \ v_p ∈ T_p M\ $ and $a ∈ R$.
To check what kind of object is $df_p$ we can use the parent
method:
# continuation
# mathematical object of which "dfp" is an element.
print(dfp.parent())
Dual of the Tangent space at Point p on the 3-dimensional differentiable manifold M
Example 9.2
If $x^1,\ldots,x^n$ are local coordinates on $M$, then differentials $dx^i_p$ are covectors from $T_p^*M$. From (9.1) it follows that if the tangent vector is expressed as $X_p=X_p(x^i)\frac{\partial}{\partial x^i}\big|_p$, then
\begin{equation} \displaystyle dx^i_p(X_p)=X_p(x^i), \label{}\tag{9.1'} \end{equation}i.e. $\ dx^i_p$ is the covector that maps the tangent vector at $p$ to its $i$-th component in the basis $\displaystyle \big\{\frac{\partial}{\partial x^j}\big|_p\big\}_{j=1}^n.$
Example 9.3
Let us define the scalar functions representing the i-th coordinate of the point.
N = 3 # dimension of manifold M
M = Manifold(N, 'M') # manifold M of dimension N
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
x0, x1, x2 = X[:]
p = M.point((x0, x1, x2), name='p') # point of M
fx0 = M.scalar_field(x0, name='fx0') # fx0: x-->x^0
fx1 = M.scalar_field(x1, name='fx1') # fx1: x-->x^1
fx2 = M.scalar_field(x2, name='fx2') # fx2: x-->x^2
fx0.expr(), fx1.expr(), fx2.expr()
dx0 = fx0.differential() # differential of fx0
dx1 = fx1.differential() # differential of fx1
dx2 = fx2.differential() # differential of fx2
dx0_p = dx0.at(p) # differential of fx0 at p
dx1_p = dx1.at(p) # differential of fx1 at p
dx2_p = dx2.at(p) # differential of fx2 at p
[dx0_p.disp(), dx1_p.disp(), dx2_p.disp()] # show all three
We can check that the just defined differentials, when applied to the tangent vector $v$ give its i-th component $v^i$.
Tp = M.tangent_space(p) # tangent space at p
# variables with superscripts:
vn = [var('v'+str(i), latex_name='v'+'^'+str(i)) for i in range(N)]
v = Tp(vn, name='v') # tangent vector at p
(dx0_p(v), dx1_p(v), dx1_p(v)) # values of differentials of xi
# at p on a tangent vector v
Using the definition of the basis tangent vectors $\frac{\partial}{\partial x^i}\Big|_p(f)=D_i\Big|_{\phi(p)}(f\circ\phi^{-1})$ and the fact that $(x^j\circ\phi^{-1}(x^1(p),\ldots,x^n(p))=(x^j\circ\phi^{-1})(\phi(p))=x^j(p),\ $ we see that $\frac{\partial}{\partial x^i}\Big|_p(x^j)=\delta_i^j$ and consequently $dx^i_p\big(\frac{\partial}{\partial x^j}\big|_p\big)= \frac{\partial}{\partial x^j}\big|_p(x^i)=\delta_j^i$. The last relation implies that:
The family $\{dx^i_p\}_{i=1}^n$ is a basis of $T_p^*M$.
In fact if the linear combination $\ a_idx^i_p\ $ is equal to zero covector, then $\ 0 = (a_i dx^i_p ) (∂/∂ x^j|_p)= a_i\delta_j^i=a_j\ $ i.e., the coefficients of this combination vanish, so the family is linearly independent.
If $\ \alpha_p\in T^*_pM$, then for $\ v_p\in T_pM\ $ in the form
$v_p= v_p(x^i)\frac{\partial}{\partial x^i}\big|_p$ we have
From the definition of the differential it follows $v_p(x^i)=dx^i_p(v_p)$, so
$$\alpha_p(v_p)= \alpha_p\big(\frac{\partial}{\partial x^i}\big|_p\big)dx^i_p(v_p)=\Big[ \alpha_p\big(\frac{\partial}{\partial x^i}\big|_p\big)dx^i_p\Big](v_p),$$consequently
\begin{equation} \alpha_p= \alpha_p\Big( \frac{\partial}{\partial x^i}\big|_p\Big)dx^i_p. \label{} \tag{9.2} \end{equation}Thus every covector from $T_p^*M$ is a linear combination of $\{dx^i_p\}_{i=1}^n.$
Example 9.4
For example the differential of $f$ is a linear combination of $dx^0,dx^1,dx^2$ with coefficients
$\frac{\partial f}{\partial x^0},\frac{\partial f}{\partial x^1}, \frac{\partial f}{\partial x^2}.$
In SageMath Manifolds the index $p$ denoting the point is always dropped.
The function display
shows the differentials of functions and general linear forms as linear combinations of $dx^i.$
# continuation
dfp.disp() # show df_p
Example 9.5
Let us define a general linear form on the tangent space $T_pM$ of a 3-dimensional manifold.
N = 3 # dimension of manifold M
M = Manifold(N, 'M') # manifold M of dimension N
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # point of M
Tp = M.tangent_space(p) # tangent space at p
a = Tp.linear_form() # linear form on T_pM
a[:] = var('a', n=3) # coefficients in the basis dx^i
a.disp() # show a
The linear form applied to a tangent vector gives a scalar.
#continuation # variables wit superscripts:
vn = [var('v'+str(i), latex_name='v'+'^'+str(i)) for i in range(N)]
v = Tp(vn, name='v') # tangent vector v at p
a(v) # value of a on v
The value of a tangent vector $v\in T_pM$ on a linear form $a\in T_p^*M$ is by definition equal to $a(v)$.
v(a) # value of v on a
Recall, that if $V$ is a vector space or a module, by a multilinear or more precisely $k$-linear form we mean a function $t: V^k\to R$ which is linear in each of its arguments i.e., for $i=1,\ldots,k$
$$t(v_1\ldots,\alpha v_i+\beta w_i,\ldots v_k)= \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 V.$$where $T_pM$ is the tangent space at $p\in M$ and $T_p^*M$ is the corresponding cotangent space.
Since for linear forms $\alpha$ and tangent vectors $v$ the assignment $\alpha\to v(\alpha)$ defines a linear form $T_p^*M\to R$, the elements $v\in T_pM$ can be considered as elements of $T_p^{(1,0)}$. On the other hand $T^{(0,1)}_p$ as the space of linear forms on $T_pM$ is equal to $T_p^*M$. Thus, the tensor spaces generalize the tangent and cotangent spaces.
Example 9.6
Let us show how to define tensor modules of type (1,0) and (0,1) in SageMath Manifolds.
N = 3 # manifold dimension
M = Manifold(N, 'M') # manifold M
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # point on M
Tp = M.tangent_space(p) # tangent space at p
Tp.tensor_module(1,0) # T_p^(1,0)M
print(Tp.tensor_module(1,0)) # tensors (1,0) type are tangent vectors
Tangent space at Point p on the 3-dimensional differentiable manifold M
Tp.tensor_module(0,1) # tensors of type (0,1) are linear forms on T_pM
# SageMath output looks a little strange
# but note that the dual space to V is denoted by V*
print(Tp.tensor_module(0,1)) # SageMath naming is ready for arbitrary
# tensors, covector is just (0,1) tensor
Free module of type-(0,1) tensors on the Tangent space at Point p on the 3-dimensional differentiable manifold M
where $T_pM$ denotes the tangent space at $p\in M$.
For k=1 we obtain the space of covectors at $p$, i.e., linear forms on $T_pM.$
In $T^{(0,k)}_pM$ we introduce the vector space structure by
$$ (at_p+bs_p)(v_1\ldots,v_k)=at_p(v_1\ldots,v_k)+bs_p(v_1\ldots,v_k),$$where $t_p,s_p\in T^{(0,k)}_pM$, $v_1,\ldots,v_k\in T_pM$ and $a,b\in R$.
For $t_p\in T^{(0,k)}_pM,\, s_p\in T^{(0,m)}_pM$ we define the tensor product $t_p\otimes s_p\in T_p^{(0,k+m)}M$ by
\begin{equation} (t_p ⊗ s_p )(v_1 ,\ldots , v_{k+m} ) ≡ t_p (v_1 ,\ldots, v_k ) s_p (v_{k+1} , . . . , v_{k+m} ), \label{eq:tensor_product}\tag{9.3} \end{equation}for $v_1,\ldots,v_{k+m}\in T_pM$.
In SageMath Manifolds the symbol of tensor product is simply $*$.
If the tangent vectors $v_i$ are expressed as
$v_i=v_i(x^j)\frac{\partial}{\partial x^j}\big|_p=dx^j_p(v_i)\frac{\partial}{\partial x^j}\big|_p, \ \ i=1,\ldots k$, then by the multilinearity of $t_p$ and the definition (9.3) of the tensor product we have for $t_p\in T^{(0,k)}_p$:
$$t_p(v_1,\ldots,v_k)=t_p\big(dx^{i_1}_p(v_1)\frac{\partial}{\partial x^{i_1}}\big|_p,\ldots,dx^{i_k}_p(v_k)\frac{\partial}{\partial x^{i_k}}\big|_p\big)\\
=dx^{i_1}_p(v_1)\dots dx^{i_k}_p(v_k)t_p\big(\frac{\partial}{\partial x^{i_1}}\big|_p,\ldots,\frac{\partial}{\partial x^{i_k}}\big|_p\big)\\
=\Big[t_p\big(\frac{\partial}{\partial x^{i_1}}\big|_p,\ldots,\frac{\partial}{\partial x^{i_k}}\big|_p\big)dx^{i_1}_p\otimes\dots\otimes dx^{i_k}_p\Big](v_1,\ldots,v_k),
$$
so
where \begin{equation} t_{i_1\ldots i_k}=t_p\big(\frac{\partial}{\partial x^{i_1}}\big|_p,\ldots,\frac{\partial}{\partial x^{i_k}}\big|_p\big). \label{}\tag{9.5} \end{equation}
Example 9.7
Let us check the formula (9.3) in the case of two general tensors from $T^{(0,2)}_pM$ for a 2-dimensional manifold $M$.
N = 2 # dimension of manifold M
M2 = Manifold(N, 'M2') # manifold M2 of dimension 2
X = M2.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M2.point(X[:], name='p') # p -point with coordinates (x^0,x^1)
Tp = M2.tangent_space(p) # Tp -tangent space at p
t = Tp.tensor((0,2)) # t -tensor from T^{(0,2)}_pM
s = Tp.tensor((0,2)) # s -tensor from T^{(0,2)}_pM
First we define a list of components of four tangent vectors:
M = 4 # number of vectors
vv=[[var('v'+str(i)+str(j), # components of four vectors
latex_name='v'+'^{'+str(i)+'}_{'+str(j)+'}')
for i in range(N)] for j in range(M)]
vv # show four vectors components
and the vectors:
v=[Tp(vv[k]) for k in range(M)]; # list of 4 tangent vectors
v[0].disp() # show first tangent vector
Next we define the components of two (0,2)-type tensors $t\ $ and $s$.
tt=[[var('t'+str(i)+str(j)) # components of tensor t
for j in range(N)] for i in range(N)]
ss=[[var('s'+str(i)+str(j)) # components of tensor s
for j in range(N)] for i in range(N)]
t[:] = tt # define tensor t components t_{ij}
s[:] = ss # define tensor s components s_{ij}
t.disp() # show t
s.disp() # show s
Now we are ready to check the formula (9.3).
# check the formula (9.3)
bool((t*s)(v[0],v[1],v[2],v[3]) == t(v[0],v[1])*s(v[2],v[3]))
Tensor product has the following properties
$$ \begin{matrix} (a\,r_p + b\,s_p ) ⊗ t_p = a\,r_p ⊗ t_p + b\,s_p ⊗ t_p ,\\ r_p ⊗ (a\,s_p + b\,t_p ) = a\,r_p ⊗ s_p + b\,r_p ⊗ t_p ,\\ (r_p ⊗ s_p ) ⊗ t_p = r_p ⊗ (s_p ⊗ t_p ), \end{matrix} $$for $a,b\in R\ $ and for arbitrary covariant tensors $r_p,s_p,t_p$ (the addition is defined only for tensors of the same rank $(0,k)$).
To check the first formula, let us note that for $X_1,\ldots X_{k+l}\in T_pM$
and similarly for the second formula.
The associativity follows from
for $X_1 , . . . , X_{k+l+m} \in T_pM.$
Example 9.8
Let us show an example of a tensor $t\in T^{(0,3)}_pM$. First let us define the corresponding 3-dimensional table of components.
N = 2 # dimension of manifold
st=[[[var('t'+str(i0)+str(i1)+str(i2)) # components of t
for i2 in range(N)]
for i1 in range(N)]
for i0 in range(N)]
st
Now we define a manifold $M$, a point $p\in M$, tangent space $T_pM$ and the tensor $t\in T^{(0,3)}_pM$.
M = Manifold(N, 'M') # 2-dimensional manifold
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # point in M
Tp = M.tangent_space(p) # tangent space T_p
t = Tp.tensor((0,3), name='t') # tensor of type (0,3)
t[:] = st # define components of t
t.disp() # show t
Next we show how to define a tensor of type (0,3) on a 2-dimensional manifold with concrete components.
ct=range(1,9) # 1,...,8 -components of t
for i0 in range(N):
for i1 in range(N):
for i2 in range(N):
t[i0,i1,i2]=ct[i0*N*N+i1*N+i2]
t.disp() # show t
Define the local basis of $T_pM$.
Xf = X.frame() # default frame
Xfp = Xf.at(p); Xfp # default frame at p
Check that the component $t_{011}$ of the tensor from the previous example is equal to $t(\frac{\partial}{\partial x_0},\frac{\partial}{\partial x_1},\frac{\partial}{\partial x_1})$.
t(Xfp[0], Xfp[1], Xfp[1]) # value of t(d/dx0,d/dx1,d/dx1)
where $T_p^*M$ is the cotangent space at $p\in M$.
In $T^{(k,0)}_pM$ we introduce the vector space structure by
$$ (at_p+bs_p)(\alpha_1\ldots,\alpha_k)=at_p(\alpha_1\ldots,\alpha_k)+bs_p(\alpha_1\ldots,\alpha_k),$$where $t_p,s_p\in T^{(k,0)}_pM$, $\alpha_1,\ldots,\alpha_k\in T_p^*M$ and $a,b\in R$.
For $t_p\in T^{(k,0)}_pM,s_p\in T^{(m,0)}_pM$ we define the tensor product $t_p\otimes s_p$ by
\begin{equation} (t_p ⊗ s_p )(\alpha_1 ,\ldots , \alpha_{k+m} ) = t_p (\alpha_1 ,\ldots, \alpha_k ) s_p (\alpha_{k+1} , \ldots , \alpha_{k+m} ), \tag{9.6} \end{equation}for $\alpha_1,\ldots,\alpha_{k+m}\in T^*_pM$.
Let $t_p\in T^{(k,0)}_pM,\ \ α_1 , . . . , α_k ∈ T_p^∗M $ and let all covectors $\alpha_i$ be expressed as
$α_i = α_i \big(\frac{∂}{∂ x^j}\big|_p\big) dx^j_ p\ \ $ (cf. (9.2)). We have
Since $v_p(\alpha_p)=\alpha_p(v_p)$ we obtain
so \begin{equation} t_p=t^{i_1\ldots i_k}_p\frac{\partial}{\partial x^{i_1}}\big|_p\otimes\dots\otimes\frac{\partial}{\partial x^{i_k}}\big|_p, \label{}\tag{9.7} \end{equation}
\begin{equation} t_p^{i_1\ldots i_k}=t_p(dx^{i_1}_p,\ldots,dx^{i_k}_p). \label{}\tag{9.7'} \end{equation}Example 9.9
Let us give an example of a tensor $t_p\in T^{(3,0)}_pM$.
First we define the corresponding 3-dimensional table of components with upper indices.
N = 2 # dimension of manifold
st=[[[var('t'+str(i0)+str(i1)+str(i2),
latex_name='t'+'^'+'{'+str(i0)+str(i1)+str(i2)+'}')
for i2 in range(N)]
for i1 in range(N)] # components of t
for i0 in range(N)] # with superscripts
st
Now we define a two-dimensional manifold, the tangent space and the tensor $t_p\in T^{(3,0)}_pM$ t with component from the table st.
M = Manifold(N, 'M') # manifold M
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # point p in M
Tp = M.tangent_space(p) # tangent space at p
t = Tp.tensor((3,0), name='t') # tensor of type (3,0)
t[:] = st # tensor components
We are ready to display the general tensor of type (3,0) on a 2-dimensional manifold in components.
t.disp() # show t
Here is a tensor of type (3,0) on a 2-dimensional manifold with concrete components:
ct=range(1,9) # 1,...,8 - components of t
for i0 in range(N):
for i1 in range(N):
for i2 in range(N):
t[i0,i1,i2]=ct[i0*N*N+i1*N+i2]
t.disp() # show t
Let us define the basis of $T^*_pM$.
Xcf = X.coframe() # basis of cotangent space
Xcfp = Xcf.at(p); Xcfp # basis of cotangent space at p
Check that the component $\ t_{011}\ $ is equal to $\ t( dx^0,dx^1, dx^1)$.
t(Xcfp[0], Xcfp[1], Xcfp[1]) # value of t(dx0,dx1,dx1)
Since the definition of $T^{(k,m)}_pM$ was given above we start from definition of tensor product.
For $t_p\in T^{(k_1,m_1)},s_p\in T^{(k_2,m_2)}_pM$ we define the tensor product $t_p\otimes s_p\in T_p^{(k_1+k_2,m_1+m_2)}$ by
\begin{equation}
(t_p ⊗ s_p )(\alpha_1,\ldots\alpha_{k_1+k_2},v_1 ,\ldots , v_{m_1+m_2} )\\
=t_p (\alpha_1,\ldots,\alpha_{k_1},v_1 ,\ldots, v_{m_1} ) s_p (\alpha_{k_1+1},\ldots,\alpha_{k_1+k_2},v_{m_1+1},\ldots, v_{m_1+m_2} ),
\tag{9.8}
\end{equation}
for $\alpha_1,\ldots,\alpha_{k_1+k_2}\in T^*_pM$ and $v_1,\ldots,v_{m_1+m_2}\in T_pM$.
Generalizing the formulas (9.5) and (9.7) we obtain the following expression for the general tensor $t_p\in T^{(k,l)}_pM$ in local components
\begin{equation} t_p= t_p\big(dx^{i_1}_p,..,dx^{i_k}_p,\frac{\partial}{\partial x^{j_1}}\big|_p,..,\frac{\partial}{\partial x^{j_m}}\big|_p\big) \frac{\partial}{\partial x^{i_1}}\big|_p\otimes..\otimes\frac{\partial}{\partial x^{i_k}}\big|_p\otimes dx^{j_1}_p\otimes..\otimes dx^{j_m}_p. \label{}\tag{9.9} \end{equation}Very often the notation \begin{equation} t^{i_1\ldots i_k}_{j_1\ldots j_m}=t_p\big(dx^{i_1}_p,..,dx^{i_k}_p,\frac{\partial}{\partial x^{j_1}}\big|_p,..,\frac{\partial}{\partial x^{j_m}}\big|_p\big) \tag{9.10} \end{equation} is used and then \begin{equation} t_p=t^{i_1\ldots i_k}_{j_1\ldots j_m}\frac{\partial}{\partial x^{i_1}}\big|_p\otimes\dots\otimes\frac{\partial}{\partial x^{i_k}}\big|_p\otimes dx^{j_1}_p\otimes\ldots\otimes dx^{j_m}_p. \tag{9.11} \end{equation}
To check that the elements
\begin{equation} \frac{\partial}{\partial x^{i_1}}\big|_p\otimes\dots\otimes\frac{\partial}{\partial x^{i_k}}\big|_p\otimes dx^{j_1}_p\otimes\ldots\otimes dx^{j_m}_p \label{} \tag{9.12} \end{equation}are linearly independent, assume that the linear combination
$$a^{i_1\ldots i_k}_{j_1\ldots j_m}\frac{\partial}{\partial x^{i_1}}\big|_p\otimes\dots\otimes\frac{\partial}{\partial x^{i_k}}\big|_p\otimes dx^{j_1}_p\otimes\ldots\otimes dx^{j_m}_p $$vanishes. If we apply this combination to $\quad(dx^{q_1}_p,\ldots,dx^{q_k}_p,\frac{\partial}{\partial x^{r_1}}\big|_p,..,\frac{\partial}{\partial x^{r_m}}\big|_p\big)\ $ we get $\ \displaystyle a^{q_1\ldots q_k}_{r_1\ldots r_m}=0$.
Since previously we have checked that elements of the type (9.12) span $T^{(k,l)}_pM$ we have proved, that these elements form a basis for $T^{(k,m)}_pM$.
Example 9.10
To show an example of a tensor $t_p\in T^{(2,2)}_pM$, we first define a 4-dimensional table with lower and upper indices.
N = 2 # dimension of manifold
st=[[[[var('t'+str(i0)+str(i1)+str(i2)+str(i3),
latex_name='t'+'^'+'{'+str(i0)+str(i1)+'}'+'_'+'{'+str(i2)+str(i3)+'}')
for i3 in range(N)] for i2 in range(N)] # components of t with upper
for i1 in range(N)] for i0 in range(N)] # and lower indices
st
Now define a 2-dimensional manifold $M$, tangent space at $p$ and $\ t_p\in T^{(2,2)}_pM$.
M = Manifold(N, 'M') # manifold M
X = M.chart(' '.join(['x'+str(i)+':x^{'+str(i)+'}' for i in range(N)])) # chart on M
p = M.point(X[:], name='p') # point of M
Tp = M.tangent_space(p) # tangent space at p
t = Tp.tensor((2,2), name='t') # tensor of type (2,2)
t[:] = st # define tensor components
We can display a general tensor from $T_p^{(2,2)}M$ on a 2-dimensional manifold ($2^4$ components).
t.disp() # show t
#tt=t*t
#tt[:] very long output
A more concrete example can be defined as follows:
ct=range(1,17) # [1,...,16] consecutive components
for i0 in range(N):
for i1 in range(N):
for i2 in range(N):
for i3 in range(N):
t[i0,i1,i2,i3]=ct[i0*N*N*N+i1*N*N+i2*N+i3]
t.disp()
#(t*t).disp() - latex code
#(t*t)[:] # long output
Using the bases of $T_pM$ and $T^*_pM$,
Xf = X.frame() # frame (d/dx0,d/dx1)
Xfp = Xf.at(p); print("Xfp-", Xfp) # frame (d/dx0,d/dx1) at p
Xcf = X.coframe() # coframe (dx0,dx1)
Xcfp = Xcf.at(p); print("Xcfp-", Xcfp) # coframe (dx0,dx1) at p
Xfp- Basis (∂/∂x0,∂/∂x1) on the Tangent space at Point p on the 2-dimensional differentiable manifold M Xcfp- Dual basis (dx0,dx1) on the Tangent space at Point p on the 2-dimensional differentiable manifold M
one can check that the component $\ \ t^{10}_{01}\ \ $ is equal to $\ \ t(dx_1,dx_0,\frac{\partial}{\partial x_0},\frac{\partial}{\partial x_1})$:
t(Xcfp[1], Xcfp[0], Xfp[0], Xfp[1]) # value of t(dx1,dx0,d/dx0,d/dx1)
Take a look at the notebook Alternating forms on modules.