basis[- i]
ei
basis[ i]
ei
If there exist another nonnatural basis called basis but related to another coordinates only the first basis introduced use the name basis in order to write the basis. The second basis introduced needs the full name
ZZ[{coords,basis}][- i]
ei
ZZ[{coords,basis}] [ i]
ei
You can short by hand by a not used symbol , say e, assigning e= ZZ[{coords,basis}]. On the other hand, given a noncoordinate basis with a name {cc, bb}, the output of basis elements are represented by
ei
bb[-i]
ei
bb[i]
Having declared a noncoordinate basis, you can already do all the algebraic operationsdescribed in Tensor operations.
For instance, you can declare an orthonormal basis in polar coordinates
and
then compute the interior contraction
and
the symmetric part of the tensor
.
In[2]:= InputCoordinates[polar, {r, phi}];
In[3]:= InputBasis[{polar, ortho}]
Out[3]= {{polar, ortho}, {1, 2}}
In[4]:= ortho[2]
Out[4]= ortho[2]
In[5]:= InteriorContraction[ortho[-1], ortho[1, 2]]
Out[5]= ortho[2]
In[6]:= t = r ortho[1, 2] + r Sin[phi] ortho[2, 1]
Out[6]= r ortho[1]*.ortho[2] + r Sin[phi] ortho[2]*.ortho[1]
In[7]:= Symmetric[t]
r r Sin[phi]
Out[7]= (- + ----------) ortho[1]*.ortho[2] +
2 2
r r Sin[phi]
> (- + ----------) ortho[2]*.ortho[1]
2 2
As you can see, the output of InputBasis prints the full name
of the basis together with the list {1, 2}. This last element
appears because the complete syntax of InputBasis allows an optional
argument consisting of a list with the symbols you want TTC
labels the basis elements. If you do not input this argument, TTC
uses 1,
2, etc. as labels.
In order to use the differential operators LieD and ExteriorD, the relation between the noncoordinate and coordinate basis have to be given. This can be achieved with InputBasisChange
You can input any of the four possibles relations
![]()
and TTC inmediately computes the remaining ones. You can see these relations using BasisVectorChange and BasisFormChange.
Next, we give the relation
![]()
between the orthonormal and natural basis in polar coordinates using
vectors and obtain the same relation in all the alternative manners. Afterwards,
we compute the exterior derivative of the 1-form
In[8]:= InputBasisChange[{polar, ortho}, polar,
{ortho[-1] -> polar[-1], ortho[-2] -> polar[-2]/r}]
In[9]:= BasisFormChange[{polar, ortho}, polar] // ColumnForm
Out[9]= ortho[1] -> dr
ortho[2] -> r dphi
In[10]:= BasisVectorChange[polar, {polar, ortho}] // ColumnForm
Out[10]= Dr -> ortho[-1]
Dphi -> r ortho[-2]
In[11]:= BasisFormChange[polar, {polar, ortho}] // ColumnForm
Out[11]= dr -> ortho[1]
1
dphi -> - ortho[2]
r
In[12]:= w = (1 + Tan[phi]) ortho[1] + r^2 ortho[2];
In[13]:= ExteriorD[w]
2
Sec[phi]
Out[13]= (3 r - ---------) ortho[1]*^ortho[2]
r
Associated to every basis there exists a set of scalars named structure
coefficients and defined through the Lie braket
![]()
You can obtain one of them with StructureCoefficient and see the whole set with ShowStructureCoefficient.
In[16]:= ShowStructureCoefficient[{polar, ortho}]
Non null structure coefficients:
2 1
c = -(-)
1 2 r
where
is
the directional derivative of
in
the direction of
and
are
the structure coefficients just defined
with the last index lowered. The TTC function used to compute
this connection is Christoffel although in the literature this
name is reserved to the case of natural basis. ShowChristoffel
also works with noncoordinate basis. On the other hand, the expression
for the covariant derivative
becomes
![]()
but AbsoluteD and CovariantD are used as in section:Covariant derivative Finally, the components of the Riemann tensor are computed from
![]()
and Riemann, Ricci and Curvature are computed in the same way.
In the following examples the metric in the orthonormal basis of polar
coordinates is defined and the inverse metric computed. Then, we get the
dual and the covariant derivative of the form
previously
defined. Finally, we check that the Riemann tensor is null. (The examples
in this section are a continuation of those of section:
Definition and notation for noncoordinate basis
In[14]:= g = ortho[1, 1] + ortho[2, 2]
Out[14]= ortho[1]*.ortho[1] + ortho[2]*.ortho[2]
In[15]:= InputMetric[eucl, {polar, ortho}, g];
In[16]:= InverseMetric[eucl, {polar, ortho}]
Out[16]= ortho[-2]*.ortho[-2] + ortho[-1]*.ortho[-1]
In[17]:= InputMetricSign[eucl, {polar, ortho}, 1]
Out[17]= 1
In[18]:= Hodge[eucl][w]
2
Out[18]= -r ortho[1] + (1 + Tan[phi]) ortho[2]
In[19]:= ShowChristoffel[eucl, {polar, ortho}]
Non null Christoffel symbols:
1 1
K = -(-)
2 2 r
2 1
K = -
1 2 r
In[20]:= AbsoluteD[eucl][w]
2
Sec[phi]
Out[20]= (-r + ---------) ortho[1]*.ortho[2] + 2 r ortho[2]*.ortho[1] +
r
1 + Tan[phi]
> ------------ ortho[2]*.ortho[2]
r
In[24]:= Riemann[eucl, {polar, ortho}]
Out[24]= 0
Basis InputScalarBasis ScalarBasisQ BasisNames BasisSymbols Dimension ClearBasisBasis is used to get the basis in which a tensor has been expanded. When Basis acts upon a scalar it cannot find the basis and asks the user to input it. Since Basis is used internally, it can happen that TTC stops a computation and demands for the basis of a scalar. To avoid this nuisance and when one is going to use the same basis during the current session it can be established once and forever the basis of all the scalars that will appear with InputScalarBasis. To tell TTC whether to stop and ask or not, the variable ScalarBasisQ has to be set to True (to ask) or to False (to avoid the asking).
BasisNames, BasisSymbols and Dimension are merely informative commands. BasisNames is the analogous of CoordinateNames for basis. It shows the noncoordinate basis declared in the session along with the coordinates to which they are related and the symbols used to represent the basis elements. Likewise BasisSymbols returns a list of these symbols in the same way as Coordinates gives a list of the coordinates of a system. On the other hand, Dimension does what is expected: it gives the dimension of the specified basis.
ClearBasis serves to erase a declared basis but, like ClearCoordinates, it has other effects: it erases all objects builded from the erased basis. A more detailed explanation of how it works can be found in section How to clear
This page is maintained by XavierJaén.