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 left-hand side is such a function or name with free indices and the right-hand 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;
differentiation and simplification of contracted indices in products using Einstein's summation convention for repeated indices;
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 Fμ,ν=∂μ⁡Aν−∂ν⁡Aμ. For this purpose, as shown in the Examples section, use Define(A = tensorial expression), where the free indices of the left-hand side are expected to be the same as the free indices of the right-hand side, that can include, in addition, other repeated (contracted) indices. The right-hand side can also be a procedure that, when applied to the indices of the left-hand 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 left-hand 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 right-hand 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: Aμ,ν,ρ,τ 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, Aμ,ν,ρ,τ=Aν,μ,ρ,τ =−Aν,μ,τ,ρ.
clear
Clear previous definitions. If given with no additional information, clear removes all definitions in the current session.
If given with tensors A,B,…, clear removes the specified definitions.
query
Query about previous definitions in the current session. For example, Define(query), where query is any of query, history, indices, functionality, and structure.
quiet
Proceed without displaying messages on the screen.
redo
To re-define 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
with⁡Physics:
Setup⁡mathematicalnotation=true
mathematicalnotation=true
When called with no arguments, Define returns a set of all tensors defined at the moment.
Define⁡
Defined as tensors
γμ,σμ,∂μ,gμ,ν,εα,β,μ,ν
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 D-dimensional LeviCivita tensor, the spacetime metrics g_, the Pauli matrices, and the Dirac matrices.
The simplest way to define a tensor, say B, by passing B, Bμ or Bμ⁡X to Define, as in
Define⁡B
Defined objects with tensor properties
B,γμ,σμ,∂μ,gμ,ν,εα,β,μ,ν
Unlike passing Bμ or Bμ⁡X , when passing only B as in the above, nothing is known about the number of indices of B. To query about the structure of a defined tensor, use
Define⁡B,query
Tensor structured as name,indices,variables :
B,0,0,0,0
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 B 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 B
LeviCivitaα,β,μ,ν⁢Bμ⁢Bν
εα,β,μ,ν⁢B⁢μ⁢μ⁢B⁢ν⁢ν
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
Simplify⁡
0
diff⁡Bμ,B~nu
gμ,ν
To differentiate with respect to the covariant components, pass Bν instead of ⁢Bν as differentiation variable. Define a system of coordinates for experimentation
Coordinates⁡X
⁢Systems of spacetime coordinates are:⁢X=x1,x2,x3,x4
X
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 Aμ⁡X
PDEtools:-declare⁡F⁡X,A⁡X
F⁡x1,x2,x3,x4⁢will now be displayed as⁢F
A⁡x1,x2,x3,x4⁢will now be displayed as⁢A
Fμ,ν=d_μ⁡Aν⁡X−d_ν⁡Aμ⁡X
Fμ,ν=∂μ⁡Aν−∂ν⁡Aμ
Aμ,B⁢ν⁢ν,γμ,Fμ,ν,σμ,∂μ,gμ,ν,εα,β,μ,ν,Xμ
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 Fμ,ν as a tensorial equation instead of passing just the left-hand side of (11), the natural symmetries of the expression in the right-hand side of (11) are from herein automatically taken into account when computing with Fμ,ν - each occurrence of it gets automatically normalized
Fν,μ
−Fμ,ν
Fμ,ν+Fν,μ
These natural symmetry properties of the right-hand side of (11) are also used when simplifying expressions involving contracted products of F[mu,nu]. For example:
Aμ⁢Aν⁢Fμ,ν
Fμ,ν⁢A⁢μ⁢μ⁢A⁢ν⁢ν
Defining Fμ,ν using an equation with a tensorial equation on the right-hand side, you can also see the components of F all at once, as with the other tensors of Physics
F
Fμ,ν=
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
Fnonzero
Fμ,ν=1,2=A2x1−A1x2,1,3=A3x1−A1x3,1,4=A4x1−A1x4,2,1=A1x2−A2x1,2,3=A3x2−A2x3,2,4=A4x2−A2x4,3,1=A1x3−A3x1,3,2=A2x3−A3x2,3,4=A4x3−A3x4,4,1=A1x4−A4x1,4,2=A2x4−A4x2,4,3=A3x4−A4x3
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
F1,1
F1,2
A2x1−A1x2
F1,~2
A⁢2⁢2x1+A1x2
F~1,2
−A2x1−A⁢1⁢1x2
The defining equation can also have a Matrix or Array in the right-hand side; for example:
F~mu,~nu=Matrix⁡4,4,1,2=E__1,1,3=E__2,1,4=E__3,2,3=H__3,2,4=−H__2,3,4=H__1,shape=antisymmetric
F⁢μ,ν⁢μ,ν=
Aμ,B⁢ν⁢ν,γμ,F⁢μ,ν⁢μ,ν,σμ,∂μ,gμ,ν,εα,β,μ,ν,Xμ
E__1
−E__1
Fμ,ν,matrix
F~mu,ν,matrix
F⁢μν⁢μν=
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
Define⁡redo,Aμ,ν,ρ,σ⁡x,y,z,symmetric=μ,ρ,antisymmetric=ν,σ
Aμ,ν,ρ,σ,B⁢ν⁢ν,γμ,F⁢μ,ν⁢μ,ν,σμ,∂μ,gμ,ν,εα,β,μ,ν,Xμ
Define⁡A,query
Tensor with symmetry properties defined as: A1,2,3,4 , where antisymmetric=2,4,symmetric=1,3, and structured as name,indices,variables :
A,4,0,0,3
Define⁡indices
Used as indices in tensors:
α,β,μ,ν,ρ,σ
Define⁡functionality
Used as variables in tensor functions:
x,x1,x2,x3,x4,y,z
Define⁡history
History of definitions of tensors:
B,Aμ,ν,ρ,σ,Bμ,γμ,F⁢μ,ν⁢μ,ν,σμ,∂μ,gμ,ν,εα,β,μ,ν,B⁢μ⁢μ,B⁢ν⁢ν,εα,β,μ,ν,Xμ
See Also
Coordinates, d_, PDEtools[declare], Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup
Download Help Document