The tensor Package Simplification Routines
Description
Examples
Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.
When doing computations involving tensor components, the size of a computation can grow quite rapidly due to the sheer number of quantities involved. Also, the amount and type of simplification depends on the particular computation and the metric of the geometry involved. Thus, it is necessary for simplification of quantities to be carried out with the computation of each new component or quantity. This is why each computation routine of the package uses its own simplification routine (where appropriate). By redefining the simplification routines for particular routines of the package, you can customize the way simplification is done at each step of computation.
For the most part, these simplification routines are named after the routine that they are used by. The name `tensor/xxxx/simp` would be used for the simplifier used by the `xxxx` routine of the package. However, because some of the operations are similar and because some operations call others, some of the simplification routines are shared by more than one routine of the package. For reference, here is a table of the simplifying routines used by each procedure of the package:
Package Routine | Simplifier
------------------------------------------------------
|
Christoffel1 | tensor/Christoffel1/simp
Christoffel2 | tensor/Christoffel2/simp
Einstein | tensor/Einstein/simp
Jacobian | tensor/partial_diff/simp
Killing_eqns | tensor/lin_com/simp,
| tensor/cov_diff/simp
Levi_Civita | ----
Lie_diff | tensor/Lie_diff/simp,
| tensor/partial_diff/simp
Ricci | tensor/Ricci/simp
Ricciscalar | tensor/Ricciscalar/simp
Riemann | tensor/Riemann/simp
RiemannF | tensor/RiemannF/simp *
Weyl | tensor/Weyl/simp
act | ----
antisymmetrize | tensor/lin_com/simp
change_basis | tensor/raise/simp
commutator | tensor/commutator/simp,
compare | tensor/compare/simp
connexF | tensor/connexF/simp *
contract | tensor/prod/simp
convertNP | tensor/lin_com/simp
cov_diff | tensor/cov_diff/simp
create | ----
d1metric | tensor/d1metric/simp
d2metric | tensor/d2metric/simp
directional_diff | tensor/dir_diff/simp
display_allGR | ----
displayGR | ----
dual | tensor/prod/simp
exterior_diff | tensor/lin_com/simp,
exterior_prod | tensor/lin_com/simp,
| tensor/prod/simp
frame | tensor/lin_com/simp
geodesic_eqns | ----
get_char | ----
get_compts | ----
invars | tensor/invars/simp
| tensor/invars/Msimp *
invert | tensor/invert/simp
lin_com | tensor/lin_com/simp
lower | tensor/raise/simp
npcurve | tensor/npcurve/simp
npspin | tensor/npspin/simp,
| tensor/npspin/spincoeff/simp *
partial_diff | tensor/partial_diff/simp
permute_indices | ----
petrov | tensor/petrov/simp
prod | tensor/prod/simp
raise | tensor/raise/simp
entermetric | ----
symmetrize | tensor/lin_com/simp
tensorsGR | ----
transform | tensor/raise/simp
The simplification routines must take a single algebraic argument and return something (presumably a simpler version of the argument) of an algebraic type.
To facilitate the initialization of all of these routines (except for the ones identified by an asterisk), they are all initialized to `tensor/simp`, which is itself initialized to:
`tensor/simp` := proc(a)
normal(a)
end proc:
If you find that you want to change the method of simplification done by each routine, but that most or all of the routines require the same method, you can cut down on the number of changes that need to be made by simply changing `tensor/simp` to suit the needs of most of the simplifiers, and then make any further changes for the few specific routines. Note that such automatic initialization is done only after either having defined all of the tensor functions using the command with(tensor), or having explicitly performed the initialization using the command with(tensor,name), where name is either one of the tensor package procedures or an empty list).
Once you have customized the simplification routines for a particular problem, they can be written to a file (see ?save) so that they are easily retrievable in subsequent sessions.
For more information on the simplifier used by a particular routine, refer to the "Simplification" section of the help for that particular routine.
with⁡tensor:
interface⁡verboseproc=2:
To what are the simplifiers initialized?
eval⁡`tensor/simp`
proca...end proc
eval⁡`tensor/cov_diff/simp`
eval⁡`tensor/Ricci/simp`
eval⁡`tensor/Riemann/simp`
Now suppose that you want to change all of the simplifiers so that they use the Maple simplify function instead of normal. You can accomplish this easily:
`tensor/simp`:=proc(x) simplify(x) end proc;
tensor/simp ≔ procxsimplify⁡xend proc
Notice that this single change affects all of the simplifiers.
procxsimplify⁡xend proc
Now suppose that for the Riemann procedure, you want to simplify each component, make the substitution cos(theta)^2 = 1 - sin(theta)^2, and then factor the result. You can do this by re-defining the `tensor/Riemann/simp` procedure:
`tensor/Riemann/simp`:=proc(x) local y; y:= simplify(x); y:= subs(cos(theta)^2 = 1 - sin(theta)^2, y); factor(y); end proc;
tensor/Riemann/simp ≔ procxlocaly;y ≔ simplify⁡x;y ≔ subs⁡cos⁡θ^2=1 − sin⁡θ^2,y;factor⁡yend proc
See Also
tensor(deprecated)
Download Help Document