Wichita State University, Dept. of Mathematics
Last changed: 31 Aug 2017
Authors: Justin M. Ryan,
This notebook contains sample code related to the lecture on Vector Fields and 1-Forms. Terse lecture notes may be found at
So future readers know what version we're using:
version()
Get outputs in LaTeX form
%display latex
We begin by defining a coordinate chart $\mathbb{U}$ in $\mathbb{R}^n$. The best way to do this is to define $\mathbb{U}$ to be a 3-dimensional real manifold with a single chart. (We will define manifolds in full rigor later in the semester.)
U = Manifold(3,'U',latex_name=r'\mathbb{U}',start_index=1)
print(U)
U
Next we define the coordinates.
coord.<x,y,z>=U.chart()
print(coord)
coord
p = U.point((1,-1,3),chart=coord);
print(p)
Defining coordinates automatically defines a basis for the tangent bundle to $\mathbb{U}$. This is called a frame field on $\mathbb{U}$.
coord.frame()
A vector field is an $\mathfrak{F}$-linear combination of these basis vectors.
X1 = U.vector_field(name='X1',latex_name=r'X_1')
X1[:]=[x^2,-y,2*x*y-z]
print(X1)
X1
X1.display()
Vector fields act on smooth functions. We must regard a function on $\mathbb{U}$ as a scalar field on $\mathbb{U}$.
f = U.scalar_field({coord:x+2*y-z})
f.display()
f(p)
We can now apply the vector field to the function
X1(f).display()
This should be the same answer that we get by applying the differential of $f$ to $X_1$, as in Calculus III
f.differential()(X1).display()
X1(f) == f.differential()(X1)
X1(f)(p)
We can also easily compute the Lie bracket of two vector fields
X2 = U.vector_field(name='X2',latex_name=r'X_2');
X2[:] = [0,3*x*y,tan(x*z)];
X1X2 = X1.bracket(X2);
print(X1X2)
X1X2.display()
Choosing coordinates on $\mathbb{U}$ also automatically defines a frame field for the cotangent bundle. This is called a coframe on $\mathbb{U}$.
coord.coframe()
A 1-form is an $\mathfrak{F}$-linear combination of these basis covectors.
t1 = U.diff_form(1,name='t1',latex_name=r'\theta_1')
t1[:] = [x,1/y,sin(z)]
print(t1)
t1
t1.display()
1-forms act on vector fields.
t1(X1)
t1(X1).display()
t1(X1)(p)