Physics[Define]  define a Physics tensor, its structure, and the (anti)symmetry of its indices under permutation

Calling Sequence


Define( )
Define(A, B, ..., options)
Define(A[], symmetric = {{}, {}, ...}, antisymmetric = {{}, {}, ...}, options)


Parameters


A, B, ...



functions or names, indexed or not, being defined as objects having tensorial properties in the frame of the Physics package. A can also be an equation, where the lefthand side is such a function or name with free indices and the righthand side is a tensorial expression with the same free indices

symmetric = {{}, ...}



(optional) specifies that the objects being defined are symmetric (don't change value) under the interchange of positions between the indices in each of the subsets indicated

antisymmetric = {{}, ...}



(optional) specifies that the objects being defined are antisymmetric under the interchange of positions between the indices in each of the subsets indicated

options



(optional) arguments given in any order; any of: symmetric, antisymmetric, query, clear, redo, and quiet





Description


•

Define is used to define a name or a function as a tensor in the context of the Physics package. After this definition:

–

the display of contracted indices, one covariant and the other one contravariant;

–

a check of the number of indices against the number of indices in its definition;

–

simplification taking into account the symmetry properties that may have been indicated during the definition of the tensor;


will happen automatically or when using Simplify, diff and other differential operators of Physics, and will happen only for these names or functions defined using Define. In brief, the Physics package will compute using the rules of tensor algebra only with these objects.

•

The command Define() with no argument returns the tensors defined in that moment.

•

The typical use of Define, for instance to define a tensor, say A[mu] with one index, is as in Define(A) or Define(A[mu]), Define(A[mu](X)). The second and third manners also tell the system that A has only one index, otherwise the number of indices will be automatically derived and recorded the first time A appears in an expression handled by commands of Physics.

•

A different, also typical, situation happens when defining a tensor in terms of an arbitrary tensorial expression, say as in . For this purpose, as shown in the Examples section, use Define(A = tensorial expression), where the free indices of the lefthand side are expected to be the same as the free indices of the righthand side, that can include, in addition, other repeated (contracted) indices. The righthand side can also be a procedure that, when applied to the indices of the lefthand side, returns a tensorial expression with the same free indices, or just a Matrix or Array with the same dimension as the number of indices of the lefthand side (the tensor being defined).

•

When defining a tensor using a defining equation you can also pass to Define additional information indicating symmetry properties as explained in the Options section below related to the simpler definitions as in Define(A[mu]).

•

Defining tensors using tensorial equations has the following advantages, none of which exist when defining tensors the other ways:

–

the natural symmetry properties of the tensorial expression in the righthand side, even when not indicated explicitly, will automatically be taken into account when A enters expressions, as it happens for all the tensors predefined in Physics

–

when A has numerical indices, covariant or contravariant (numbers prefixed with ~), it will automatically return the expression used in its definition with the values of these indices.

–

the keywords matrix, nonzero and others explained in g_ for the spacetime metric and other tensors predefined in Physics are all automatically keywords of the newly defined tensor A as well.

•

If you define an object already defined, Define performs a check for consistency between the previous and the given definitions, and interrupts with an error if there are inconsistencies. To clear previous definitions, use the optional argument clear; if given alone, it will clear all the previous definitions, otherwise it will clear only the definitions of the tensors specified. To clear and redefine a previously defined tensor (that is, define it ignoring previous definitions of it), use the optional argument redo, together with the new definition.

•

When the dimension of the spacetime is changed in the middle of a session, all definitions previously made by using Define are automatically cleared.



Options


•

antisymmetric and symmetric


To define symmetry properties for some or all of the indices of an object being defined with the Define command, use the following guidelines:

–

To define the indices as totally symmetric or antisymmetric with respect to permutations, add the keyword symmetric or antisymmetric,respectively, to the calling sequence. For example, Define(A[mu, nu, rho, tau], symmetric), or just Define(A, symmetric).


If many objects are being defined at once with any of these two keywords, the symmetry properties are assumed to hold for all of them.

–

To define more detailed symmetry properties (for one Tensor at a time) use, for example, Define(A[mu, nu, rho, tau], symmetric = {{mu,nu}, {rho,tau}}),


so that: is symmetric with respect to permuting the indices , and also permuting the indices . In the same way, you can simultaneously define symmetric and antisymmetric properties of different kinds. For example, Define(A[mu,nu,rho,tau], symmetric = {mu,nu}, antisymmetric = {rho,tau}), so that for the commands in the Physics package, .


Clear previous definitions. If given with no additional information, clear removes all definitions in the current session.


If given with tensors , clear removes the specified definitions.


Query about previous definitions in the current session. For example, Define(query), where query is any of query, history, indices, functionality, and structure.


Proceed without displaying messages on the screen.


To redefine an object that has already been defined, where the new definition is not the same as the old, use either the clear option and then define the object again, or do both in one go using the redo option.



Examples


>


>


 (1) 
When called with no arguments, Define returns a set of all tensors defined at the moment.
>


 (2) 
In the above, since no tensors have been defined yet, the output shows just those predefined in Physics: the differentiation tensor operator d_, the antisymmetric Ddimensional LeviCivita tensor, the KroneckerDelta, the spacetime metrics g_, the Pauli matrices, and the Dirac matrices.
The simplest way to define a tensor, say , by passing , or to Define, as in
>


 (3) 
Unlike passing or , when passing only as in the above, nothing is known about the number of indices of . To query about the structure of a defined tensor, use
>


 (4) 
where in this output, the second list explains the structure of the indices, meaning: "0 spacetime index, 0 spinor indices, and 0 gauge indices"; the third element in the output above tells the number of variables (arguments) on which depends up to this point in the session.
The first time B enters a computation, the system performs a background check and derives the number of indices and functionality of
>


 (5) 
>


 (6) 
After defining a tensor with Define, and only for these tensors, simplification and differentiation automatically takes into account Einstein's sum rule for repeated indices
>


 (7) 
>


 (8) 
To differentiate with respect to the covariant components, pass instead of as differentiation variable. Define a system of coordinates for experimentation
>


 (9) 
Define now a totally antisymmetric tensor, where the antisymmetry is implicit in the tensorial expression that defines the tensor. Use the PDEtools declare facility to avoid redundant display of functionality as in
>


 (10) 
>


 (11) 
>


 (12) 
Note that the definition above simultaneously defines F and A (also, defining any of them or both in advance is not a problem). Because of defining as a tensorial equation instead of passing just the lefthand side of (11), the natural symmetries of the expression in the righthand side of (11) are from herein automatically taken into account when computing with  each occurrence of it gets automatically normalized
>


 (13) 
>


 (14) 
These natural symmetry properties of the righthand side of (11) are also used when simplifying expressions involving contracted products of F[mu,nu]. For example:
>


 (15) 
>


 (16) 
Defining using an equation with a tensorial equation on the righthand side, you can also see the components of all at once, as with the other tensors of Physics
>


 (17) 
and to see the contravariant components, enter F with contravariant indices, prefixed by ~, as in F[~mu, ~nu, matrix].
To see all the nonzero components use
>


 (18) 
Note the display of derivatives indexed due to the use of declare lines above. You can always see what is behind of this compact display using show.
You can also see each covariant or contravariant or mixed components giving numerical values to the indices
>


 (19) 
>


 (20) 
>


 (21) 
>


 (22) 
The defining equation can also have a Matrix or Array in the righthand side; for example:
>


 (23) 
>


 (24) 
>


 (25) 
>


 (26) 
>


 (27) 
>


 (28) 
When a tensor got defined indicating the indices, or after its first use with indices, the system knows the number of indices expected and will interrupt computations with an error message in case the tensor is found in expressions with a different number of indices. To reuse the name of the tensor with a different number of indices, use the redo option of Define (equivalent to using first the clear option, and then Define again). Define here A now as a tensor with four indices and some new symmetry properties
>


 (29) 
>


 (30) 
>


 (31) 
>


 (32) 
>


 (33) 
>



