GrassmannCalculus`
DeclareUserScalarSymbols (★S) |
|
| | ||||
Details and Options
Examples
(1)
Basic Examples
(1)
In[1]:=
<<GrassmannCalculus`
Set the GrassmannPlane coordinate system.
In[2]:=
SetCoordinateBoundVectorSpace |
The following are then the user scalar symbols and patterns and the complete set of scalar symbols.
In[3]:=
UserScalarSymbolsScalarSymbols
Out[3]=
{a,b,c,d}
Out[3]=
{a,b,c,d,x,y}
The following clear the user scalar symbols. The coordinates are still included on the list.
ScalarSymbols
In[4]:=
DeclareUserScalarSymbols[{}]UserScalarSymbolsScalarSymbols
Out[4]=
{}
Out[4]=
{x,y}
It is not permitted to declare existing vector quantities as scalars.
In[5]:=
DeclareUserScalarSymbols[★,,dx,p,ω]
e
x
::vector
::form
::basis
e
x
Out[5]=
DeclareUserScalarSymbols[★,,dx,p,ω]
e
x
p
p
In[6]:=
★★vDeclareUserVectorSymbols[{q,r,s}]★★vDeclareUserScalarSymbols[{a,b,c,p}]★★s
Out[6]=
{p,q,r,s}
Out[6]=
{q,r,s}
Out[6]=
{a,b,c,p}
It's possible to declare patterns as symbols, and also include lists of symbols.
In[7]:=
DeclareUserScalarSymbols[{,},{a,b}]
a
g
_,_
The following quantities are then all treated as scalars.
In[8]:=
Array[&,3]
[%]
a
#
ScalarSymbolQ |
Out[8]=
{,,}
a
1
a
2
a
3
Out[8]=
{True,True,True}
In[9]:=
metric=Table[,{i,{x,y}},{j,{x,y}}]/./;!OrderedQ[{a,b}]//MatrixForm
[metric]Clear[metric]
g
i,j
g
a_,b_
g
b,a
ScalarSymbolQ |
Out[9]//MatrixForm=
g x,x | g x,y |
g x,y | g y,y |
Out[9]=
{{True,True},{True,True}}
Add some extra scalar symbols using . The existing user scalar symbols are retained.
DeclareExtraScalarSymbols
In[10]:=
★★S |
Out[10]=
{a,b,,,,,}
a
g
_,_
Out[10]=
{a,b,x,y,,,,,}
a
g
_,_
Declare a new set of UserScalarSymbols. These replace the previous user scalar symbols, which then combine with the coordinate symbols to form .
ScalarSymbols
In[11]:=
DeclareUserScalarSymbols[,,,]UserScalarSymbolsScalarSymbols
Out[11]=
{,,,}
Out[11]=
{x,y,,,,}
|
""

