SamplePublisher`GrassmannCalculus`
DeclareMetric |
|
| | ||||
|
| | ||||
|
| | ||||
Details and Options
Examples
(6)
Basic Examples
(6)
In[1]:=
<<GrassmannCalculus`
Establish the book default vector space.
In[1]:=
★A;
;
★ℬ |
3
The default metric is:
In[2]:=
Metric//MatrixForm
Out[2]//MatrixForm=
1 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 1 |
The following establishes a new metric. The book default vector space has among its user vector symbols. Otherwise, the symbols would have to be declared as scalars.
{a,b,c,d}
In[3]:=
DeclareMetric |
a | d | 0 |
d | b | 0 |
0 | 0 | c |
Out[3]//MatrixForm=
a | d | 0 |
d | b | 0 |
0 | 0 | c |
The operation will fail if the matrix is not symmetric. The metric will be left unchanged.
In[4]:=
DeclareMetric |
a | d | 0 |
0 | b | 0 |
0 | 0 | c |
DeclareMetric::nonsymmetric:The input is not a symmetric matrix.
Out[4]=
$Aborted
Out[4]//MatrixForm=
a | d | 0 |
d | b | 0 |
0 | 0 | c |
It will fail if it is not a proper matrix.
In[5]:=
DeclareMetric |
DeclareMetric::dimension:The input is not a matrix or of dimension 3
Out[5]=
$Aborted
Out[5]//MatrixForm=
a | d | 0 |
d | b | 0 |
0 | 0 | c |
And it will fail if it is not the correct dimension.
In[6]:=
DeclareMetric |
DeclareMetric::dimension:The input is not a matrix or of dimension 3
Out[6]=
$Aborted
Out[6]//MatrixForm=
a | d | 0 |
d | b | 0 |
0 | 0 | c |
The following sets a symbolic matrix. Notice that the matrix element pattern has been added to the list of scalars and the matrix is symmetrical.
In[7]:=
DeclareMetric |
Out[7]//MatrixForm=
g 1,1 | g 1,2 | g 1,3 |
g 1,2 | g 2,2 | g 2,3 |
g 1,3 | g 2,3 | g 3,3 |
Establish a book Point space and display the default metric.
In[1]:=
★A;
;Metric//MatrixForm
★ |
3
Out[1]//MatrixForm=
1 | 0 | 0 | 0 |
0 | 1 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 0 | 0 | 1 |
Establish a new metric. In this case we only have to supply a matrix.
33
In[2]:=
DeclareMetric |
Out[2]//MatrixForm=
1 | 0 | 0 | 0 |
0 | a | 0 | 0 |
0 | 0 | b | 0 |
0 | 0 | 0 | c |
The following is in error because nonscalar symbols are used in the metric.
In[3]:=
DeclareMetric |
DeclareMetric::notscalars:The matrix contains the following nonscalar expressions {xx,yy,zz}.
Out[3]=
$Aborted
Out[3]//MatrixForm=
1 | 0 | 0 | 0 |
0 | a | 0 | 0 |
0 | 0 | b | 0 |
0 | 0 | 0 | c |
The following establishes a symbolic metric based on the symbol .
h
In[4]:=
DeclareMetric |
Out[4]//MatrixForm=
1 | 0 | 0 | 0 |
0 | h 1,1 | h 1,2 | h 1,3 |
0 | h 1,2 | h 2,2 | h 2,3 |
0 | h 1,3 | h 2,3 | h 3,3 |
Establish a vector coordinate system.
In[1]:=
SetCoordinateVectorSpace |
Out[1]//MatrixForm=
1 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 1 |
Establish a new metric. Here the coordinates are scalar symbols so we can use them to form elements in the metric. If we used new symbols we would have to add them to the list of scalars.
In[2]:=
DeclareMetric |
2
x
2
y
Out[2]//MatrixForm=
2 x 2 y | 0 | 0 |
0 | y | 0 |
0 | 0 | z |
The following establishes a symbolic metric matrix. The coordinates are used as subscript indices. These symbols are metricGc expressions. The subscripts are Strings so substitution on the coordinates will not alter the metric symbols.
In[3]:=
DeclareMetric |
Out[3]//MatrixForm=
g x,x | g x,y | g x,z |
g x,y | g y,y | g y,z |
g x,z | g y,z | g z,z |
Number indices could be used if desired.
Establish a Point coordinate system and display the default metric.
Establish a new metric. Here the coordinates are scalar symbols so we can use them to form elements in the metric.
Declare a symbolic metric.
Most coordinate systems will come with a built-in non-Euclidean metric.
We could substitute a symbolic metric.