CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemanifolds

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: sagemanifolds/IntroToManifolds
Path: blob/main/12Manifold_VectorFields_cont.ipynb
Views: 235
Kernel: SageMath 9.6

12. Vector fields - continuation

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'

Vector fields defined in the intersection of two coordinate neighborhoods


The vector field which is defined in the intersection of two coordinate neighborhoods, can be expressed using two different charts and two different frames.


Example 12.1

Define a vector field vv in Cartesian coordinates in R2R^2. Check that if transition maps from Cartesian to polar and from polar to Cartesian coordinates are defined, then we have automatically the access to the representation of vv in both coordinate systems.

R2 = Manifold(2, 'R^2') # manifold R2 c_cart.<x,y> = R2.chart() # Cartesian coordinates on R2 c_pol.<r,ph> = R2.chart(r'r:(0,+oo) ph:(0,2*pi):\phi') # polar coord. # U is an open subset of R2, such that, the transition from Cart.to pol. # coord. and from polar to Cartesian coord. are smooth and bijective U = R2.open_subset('U',coord_def={c_cart:(y!=0,x<0),c_pol:(ph!=0)}); cart_to_pol = c_cart.transition_map(c_pol, # Cart. --> polar [sqrt(x^2 + y^2),arctan2(y, x) ]) # transition pol_to_cart = c_pol.transition_map(c_cart, # polar --> Cart. [r*cos(ph), r*sin(ph)]) # transition v = R2.vector_field(2*x*y, (1-x^2+y^2), name='v') # vector field v

Display vector field vv in default chart and default frame:

%display latex # display v in default chart v.display() # and frame

v=2xyx+(x2+y2+1)y\displaystyle v = 2 \, x y \frac{\partial}{\partial x } + \left( -x^{2} + y^{2} + 1 \right) \frac{\partial}{\partial y }

Display vv in polar frame, Cartesian chart:

v.display(c_pol.frame()) # v in polar frame, Cart.chart

v=(y3+(x2+1)yx2+y2)r+(x3+xy2xx2+y2)ϕ\displaystyle v = \left( \frac{y^{3} + {\left(x^{2} + 1\right)} y}{\sqrt{x^{2} + y^{2}}} \right) \frac{\partial}{\partial r } + \left( -\frac{x^{3} + x y^{2} - x}{x^{2} + y^{2}} \right) \frac{\partial}{\partial {\phi} }

# the same with factored components v.apply_map(factor,frame=c_pol.frame()) # apply factor to comp. v.display(c_pol.frame())

v=((x2+y2+1)yx2+y2)r+((x2+y21)xx2+y2)ϕ\displaystyle v = \left( \frac{{\left(x^{2} + y^{2} + 1\right)} y}{\sqrt{x^{2} + y^{2}}} \right) \frac{\partial}{\partial r } + \left( -\frac{{\left(x^{2} + y^{2} - 1\right)} x}{x^{2} + y^{2}} \right) \frac{\partial}{\partial {\phi} }

We can also display components separately:

v.display_comp(c_pol.frame()) # display components

vrr=(x2+y2+1)yx2+y2vϕϕ=(x2+y21)xx2+y2\displaystyle \begin{array}{lcl} v_{\phantom{\, r}}^{ \, r } & = & \frac{{\left(x^{2} + y^{2} + 1\right)} y}{\sqrt{x^{2} + y^{2}}} \\ v_{\phantom{\, {\phi}}}^{ \, {\phi} } & = & -\frac{{\left(x^{2} + y^{2} - 1\right)} x}{x^{2} + y^{2}} \end{array}

Now use the polar basis and polar coordinates:

v.display(c_pol.frame(),c_pol) # pol.chart, pol.frame

v=(r2sin(ϕ)+sin(ϕ))r+(r2cos(ϕ)cos(ϕ)r)ϕ\displaystyle v = \left( r^{2} \sin\left({\phi}\right) + \sin\left({\phi}\right) \right) \frac{\partial}{\partial r } + \left( -\frac{r^{2} \cos\left({\phi}\right) - \cos\left({\phi}\right)}{r} \right) \frac{\partial}{\partial {\phi} }

# the same with factored components v.apply_map(factor,frame=c_pol.frame(),chart=c_pol) v.display(c_pol.frame(),c_pol) # factor comp.

v=(r2+1)sin(ϕ)r(r+1)(r1)cos(ϕ)rϕ\displaystyle v = {\left(r^{2} + 1\right)} \sin\left({\phi}\right) \frac{\partial}{\partial r } -\frac{{\left(r + 1\right)} {\left(r - 1\right)} \cos\left({\phi}\right)}{r} \frac{\partial}{\partial {\phi} }

Polar components, separately:

v.display_comp(c_pol.frame(),c_pol) # display comp.

vrr=(r2+1)sin(ϕ)vϕϕ=(r+1)(r1)cos(ϕ)r\displaystyle \begin{array}{lcl} v_{\phantom{\, r}}^{ \, r } & = & {\left(r^{2} + 1\right)} \sin\left({\phi}\right) \\ v_{\phantom{\, {\phi}}}^{ \, {\phi} } & = & -\frac{{\left(r + 1\right)} {\left(r - 1\right)} \cos\left({\phi}\right)}{r} \end{array}


Module X(M)\mathfrak{X}(M)


Let X(M)\mathfrak{X}(M) be the set of all smooth vector fields on a smooth manifold MM.

The set X(M)\mathfrak{X}(M) is a module (over C(M) C^\infty(M)\ ) if we define the operations

(X+Y)p=Xp+Yp,(fX)p=f(p)Xp,(X+Y)_p=X_p+Y_p,\\ (fX)_p=f(p)X_p,

for X,YX(M),  fC(M).X,Y\in \mathfrak{X}(M),\ \ f\in C^\infty(M).

One can check that the just defined operations have the properties

(aX+bY)f=aXf+bYf,(gX)f=g(Xf),(aX+bY)f=aXf+bYf,\\ (gX)f=g(Xf),

for X,YX(M),  a,bR.  f,gC(M).X,Y\in \mathfrak{X}(M),\ \ a,b\in R.\ \ f,g\in C^\infty(M).


Lie bracket


For X,YX(M)X,Y\in \mathfrak{X}(M) the Lie bracket is defined by

[X,Y]f=X(Yf)Y(Xf),forfC(M).[X,Y]f=X(Yf)-Y(Xf),\quad\mbox{for}\quad f\in C^\infty(M).

From this definition it follows that [X,Y]=[Y,X].[X,Y]=-[Y,X].

One can also prove that [X,Y]X(M)[X,Y]\in\mathfrak{X}(M) and the Lie bracket is bilinear.

In fact if X,YX(M)X,Y\in\mathfrak{X}(M) and fC(M)f ∈ C^∞ (M), then  X(Yf) \ X(Y f )\ and  Y(Xf) \ Y(X f )\ also belong to C(M)C^∞ (M). We need to show that [X,Y][X,Y] has the derivation property. For that purpose let us note that for  f,gC(M), pM\ f,g\in C^\infty(M),\ p\in M

[X,Y]p(fg)=Xp(Yp(fg))Yp(Xp(fg))=Xp(f(p)Yp(g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z f ) − aZ(X f ) − bZ(Y f )\\ = a[X, Z] f + b[Y, Z] f.

From the antisymmetry it follows that the linearity in the first argument implies the linearity in the second argument.


Jacobi identity


The following Jacobi identity holds true

[X,[Y,Z]]+[Y,[Z,X]]+[Z,[X,Y]]=0.[X, [Y, Z]] + [Y, [Z, X]] + [Z, [X, Y]] = 0.

Note that

([X,[Y,Z]]+[Y,[Z,X]]+[Z,[X,Y]])f=X([Y,Z]f)[Y,Z]Xf+Y([Z,X]f)[Z,X]Yf+Z([X,Y]f)[X,Y]Zf=X(Y(Zf))X(Z(Yf))Y(Z(Xf))+Z(Y(Xf))+Y(Z(Xf))Y(X(Zf))Z(X(Yf))+X(Z(Yf))+Z(X(Yf))Z(Y(Xf))X(Y(Zf))+Y(X(Zf))=0.([X, [Y, Z]] + [Y, [Z, X]] + [Z, [X, Y]]) f\\ = X([Y, Z] f ) − [Y, Z]X f + Y([Z, X] f ) − [Z, X]Y f + Z([X, Y] f ) − [X, Y]Z f\\ = X (Y(Z f )) − X(Z(Y f )) − Y (Z(X f )) + Z( Y(X f ))\\ +Y (Z(X f )) − Y(X(Z f )) − Z (X(Y f )) + X(Z(Y f ))\\ +Z( X(Y f )) − Z(Y(X f )) − X (Y(Z f )) + Y (X(Z f )) = 0.

Lie bracket of vector fields multiplied by functions


For X,YX(M)X,Y\in\mathfrak{X}(M) and f,gC(M)f,g\in C^\infty(M) we have

[fX,gY]=fg[X,Y]+f(Xg)Yg(Yf)X.[ f X, gY] = f g[X, Y] + f \cdot(Xg)Y − g\cdot(Y f )X.

To prove this equality let us observe that for hC(M)h \in C^\infty(M)

[fX,gY]h=fX(gYh)gY(fXh)=f(gX(Yh)+(Xg)Yh)g(fY(Xh)+(Yf)Xh)=fg[X,Y]h+f(Xg)Yhg(Yf)Xh.[ f X, gY]h = f X(gYh) − gY( f Xh) = f \cdot(gX(Yh) + (Xg)Yh )− g\cdot (f Y(Xh) + (Y f )Xh)\\ = f g[X, Y]h + f \cdot(Xg)Yh − g\cdot(Y f )Xh.

Lie bracket for the local basis vector fields


If (U,φ)(U, φ) is a chart on MM with coordinates x1,x2,,xnx^1 , x^2 ,\ldots , x^n , then we have [xi,xj]=0.\Big[\frac{\partial}{\partial x^i},\frac{\partial}{\partial x^j}\Big]=0.

Recall that from definition (8.3) it follows xif=[Di(fϕ1)]ϕ.\quad \frac{\partial}{\partial x^i}f= [D_i(f\circ\phi^{-1})]\circ\phi.\quad Note that if we set F={[Dj(fϕ1)]ϕ}F=\{[D_j(f\circ\phi^{-1})]\circ \phi\}, then xi{[Dj(fϕ1)]ϕ}=xiF=[Di(Fϕ1)]ϕ={[Di[Dj(fϕ1)]ϕ]ϕ1}ϕ=Di(Dj(fϕ1)ϕ). \frac{\partial}{\partial x^i}\{[D_j(f\circ\phi^{-1})]\circ \phi\} =\frac{\partial}{\partial x^i}F=[D_i(F\circ\phi^{-1})]\circ\phi\\ =\{[D_i[D_j(f\circ\phi^{-1})]\circ\phi]\circ\phi^{-1}\}\circ\phi =D_i(D_j(f\circ\phi^{-1})\circ\phi). Therefore [xi,xj]f=xi{[Dj(fϕ1)]ϕ}xj{[Di(fφ1)]φ}={DiDj(fφ1)DjDi(fφ1)}φ=0.\Big[\frac{\partial}{\partial x^i},\frac{\partial}{\partial x^j}\Big]f = \frac{\partial}{\partial x^i}\{[D_j(f\circ\phi^{-1})]\circ \phi\} -\frac{∂}{∂ x^j}\{[D_i ( f ◦ φ^{−1} )] ◦ φ\}\\ = \{{D_i D_j ( f ◦ φ^{−1} ) − D_j D_i ( f ◦ φ^{−1} )}\} ◦ φ = 0.


Lie bracket in components


If X,YX(M)X,Y\in\mathfrak{X}(M) are expressed in local coordinates: X=Xixi,Y=Yjxj,X=X^i\frac{\partial}{\partial x^i},\quad Y=Y^j\frac{\partial}{\partial x^j},\quad then [X,Y]=(XYiYXi)xi.[X,Y]=(XY^i-YX^i)\frac{\partial}{\partial x^i}.

The components of the Lie bracket [X,Y][X, Y] are obtained by applying the vector field [X,Y][X, Y] to the coordinates xix^i (cf. (8.5)), so

[X,Y]xi=X(Yxi)Y(Xxi)=XYiYXi.[X, Y]x^i = X(Yx^i ) − Y(Xx^i ) = XY^i − YX^i.

Therefore  [X,Y]=(XYiYXi)xi.\ [X, Y] = (XY^i − YX^i ) \frac{∂}{∂ x^i}.



Example 12.2

Compute the Lie bracket for vector fields X=xyx+1zy3yz3z,Y=x+(x+y)z.X=xy\frac{\partial}{\partial x} +\frac{1}{z}\frac{\partial}{\partial y} -3yz^3\frac{\partial}{\partial z},\quad Y=\frac{\partial}{\partial x}+(x+y)\frac{\partial}{\partial z}.


According to the general formula, the components of [X,Y][X,Y] are XY1YX1=X(1)Y(xy)=x(xy)=y,XY^1-YX^1=X(1)-Y(xy)=-\frac{\partial}{\partial x}(xy)=-y, XY2YX2=X(0)Y(1/z)=(x+y)z(1/z)=x+yz2,XY^2-YX^2=X(0)-Y(1/z)=-(x+y)\frac{\partial}{\partial z}(1/z)=\frac{x+y}{z^2}, XY3YX3=X(x+y)Y(3yz3)XY^3-YX^3=X(x+y)-Y(-3yz^3) =xyx(x+y)+1zy(x+y)3yz3z(x+y)= xy\frac{\partial}{\partial x}(x+y) +\frac{1}{z}\frac{\partial}{\partial y}(x+y) -3yz^3\frac{\partial}{\partial z}(x+y) [x+(x+y)z](3yz3)=xy+1z+(x+y)(9yz2).-[\frac{\partial}{\partial x}+(x+y)\frac{\partial}{\partial z}](-3yz^3) =xy+\frac{1}{z}+(x+y)(9yz^2).

Define the corresponding vector fields and their Lie bracket in SageMath.

R3 = Manifold(3, 'R^3') # manifold R3 c_cart.<x,y,z> = R3.chart() # Cart. coord X = R3.vector_field(x*y, 1/z, -3*y*z^3, name='X') # X v.field Y = R3.vector_field(1, 0, x+y, name='Y') # Y v.field %display latex v=X.bracket(Y) # [X,Y] v.display()

[X,Y]=yx+(x+yz2)y+(9(xy+y2)z3+xyz+1z)z\displaystyle \left[X,Y\right] = -y \frac{\partial}{\partial x } + \left( \frac{x + y}{z^{2}} \right) \frac{\partial}{\partial y } + \left( \frac{9 \, {\left(x y + y^{2}\right)} z^{3} + x y z + 1}{z} \right) \frac{\partial}{\partial z }

We can make some simplifications to all components using apply_map:

v.apply_map(expand) v.display()

[X,Y]=yx+(xz2+yz2)y+(9xyz2+9y2z2+xy+1z)z\displaystyle \left[X,Y\right] = -y \frac{\partial}{\partial x } + \left( \frac{x}{z^{2}} + \frac{y}{z^{2}} \right) \frac{\partial}{\partial y } + \left( 9 \, x y z^{2} + 9 \, y^{2} z^{2} + x y + \frac{1}{z} \right) \frac{\partial}{\partial z }

The above hand-made computations can be replaced by:

Xx=R3.scalar_field(x*y,name='Xx') # x-coordinate of X Yx=R3.scalar_field(1,name='Yx') # x-coordinate of Y Xy=R3.scalar_field(1/z,name='Xy') # y-coordinate of X Yy=R3.scalar_field(0,name='Yy') # y-coordinate of Y Xz=R3.scalar_field(-3*y*z^3,name='Xz') # z-coordinate of X Yz=R3.scalar_field(x+y,name='Yx') # z-coordinate of Y # use the general formula to compute the coordinates of [X,Y] [(X(Yx)-Y(Xx)).expr(),(X(Yy)-Y(Xy)).expr(), (X(Yz)-Y(Xz)).expr().expand()]

[y,x+yz2,9xyz2+9y2z2+xy+1z]\displaystyle \left[-y, \frac{x + y}{z^{2}}, 9 \, x y z^{2} + 9 \, y^{2} z^{2} + x y + \frac{1}{z}\right]

To obtain the components of [X,Y][X,Y], one can also compute the values of Lie bracket [X,Y][X,Y] on coordinate functions x,y,zx,y,z.

fx=R3.scalar_field(x,name='fx') # fx(x,y,z)=x fy=R3.scalar_field(y,name='fy') # fy(x,y,z)=y fz=R3.scalar_field(z,name='fz') # fz(x,y,z)=z [(X.bracket(Y))(fx).expr(),(X.bracket(Y))(fy).expr(), (X.bracket(Y))(fz).expr().expand()] # [X,Y] on fx,fy,fz

[y,x+yz2,9xyz2+9y2z2+xy+1z]\displaystyle \left[-y, \frac{x + y}{z^{2}}, 9 \, x y z^{2} + 9 \, y^{2} z^{2} + x y + \frac{1}{z}\right]


Example 12.3

Compute [X,Y], [X,Z][X,Y],\ [X,Z] and  [Y,Z] \ [Y,Z]\ for

X=(1+r2)sin(θ)r+1r2rcos(θ)θ,Y=(1+r2)cos(θ)r+1r2rsin(θ)θ,Z=θ.X=(1+r^2)\sin(\theta)\frac{\partial}{\partial r} + \frac{1-r^2}{r}\cos(\theta) \frac{\partial}{\partial \theta}, \\ Y=-(1+r^2)\cos(\theta)\frac{\partial}{\partial r} + \frac{1-r^2}{r}\sin(\theta) \frac{\partial}{\partial \theta},\\ Z=\frac{\partial}{\partial \theta}.
R2 = Manifold(2, 'R^2') # manifold R2 # polar coordinates: c_pol.<r,th> = R2.chart(r'r:(0,+oo) th:(0,2*pi):\theta') # vector fields X,Y,Z: X=R2.vector_field((1+r^2)*sin(th),(1-r^2)/r*cos(th),name='X') Y=R2.vector_field(-(1+r^2)*cos(th),(1-r^2)/r*sin(th),name='Y') Z=R2.vector_field(0,1,name='Z') v1=X.bracket(Y) # [X,Y] v1.display() # show [X,Y]

[X,Y]=4θ\displaystyle \left[X,Y\right] = -4 \frac{\partial}{\partial {\theta} }

v2=X.bracket(Z) # [X,Z] v2.display() # show [X,Z]

[X,Z]=(r2+1)cos(θ)r(r21)sin(θ)rθ\displaystyle \left[X,Z\right] = -{\left(r^{2} + 1\right)} \cos\left({\theta}\right) \frac{\partial}{\partial r } -\frac{{\left(r^{2} - 1\right)} \sin\left({\theta}\right)}{r} \frac{\partial}{\partial {\theta} }

v3=Y.bracket(Z) # [Y,Z] v3.display() # show [Y,Z]

[Y,Z]=(r2+1)sin(θ)r+(r21)cos(θ)rθ\displaystyle \left[Y,Z\right] = -{\left(r^{2} + 1\right)} \sin\left({\theta}\right) \frac{\partial}{\partial r } + \frac{{\left(r^{2} - 1\right)} \cos\left({\theta}\right)}{r} \frac{\partial}{\partial {\theta} }

Components of the last result can be also obtained by applying [Y,Z][Y,Z] to coordinate functions r,θr,\theta:

fr=R2.scalar_field(r,name='fr') # fr(r,th)=r # [Y,Z]r v3(fr).display() # [Y,Z](fr)

[Y,Z](fr):R2R(r,θ)(r2+1)sin(θ)\displaystyle \begin{array}{llcl} \left[Y,Z\right]\left(fr\right):& R^2 & \longrightarrow & \mathbb{R} \\ & \left(r, {\theta}\right) & \longmapsto & -{\left(r^{2} + 1\right)} \sin\left({\theta}\right) \end{array}

fth=R2.scalar_field(th,name='fth') # fth(r,th)=th # [Y,Z] theta v3(fth).display() # [Y,Z](fth)

[Y,Z](fth):R2R(r,θ)(r21)cos(θ)r\displaystyle \begin{array}{llcl} \left[Y,Z\right]\left(fth\right):& R^2 & \longrightarrow & \mathbb{R} \\ & \left(r, {\theta}\right) & \longmapsto & \frac{{\left(r^{2} - 1\right)} \cos\left({\theta}\right)}{r} \end{array}

What's next?

Take a look at the notebook Tensor fields.