Define - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

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

Define

Defined as tensors

γμ,σμ,μ,gμ,ν,εα,β,μ,ν

(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 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

DefineB

Defined objects with tensor properties

B,γμ,σμ,μ,gμ,ν,εα,β,μ,ν

(3)

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

DefineB,query

Tensor structured as name,indices,variables :

B,0,0,0,0

(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 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νν

(5)

DefineB,query

Tensor structured as name,indices,variables :

B,0,0,0,0

(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

Simplify

0

(7)

diffBμ,B~nu

gμ,ν

(8)

To differentiate with respect to the covariant components, pass Bν instead of Bν as differentiation variable. Define a system of coordinates for experimentation

CoordinatesX

Systems of spacetime coordinates are:X=x1,x2,x3,x4

X

(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 AμX 

PDEtools:-declareFX,AX

Fx1,x2,x3,x4will now be displayed asF

Ax1,x2,x3,x4will now be displayed asA

(10)

Fμ,ν=d_μAνXd_νAμX

Fμ,ν=μAννAμ

(11)

Define

Defined objects with tensor properties

Aμ,Bνν,γμ,Fμ,ν,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ

(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 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μ,ν

(13)

Fμ,ν+Fν,μ

0

(14)

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νν

(15)

Simplify

0

(16)

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μ,ν=

(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

Fnonzero

Fμ,ν=1,2=A2x1A1x2,1,3=A3x1A1x3,1,4=A4x1A1x4,2,1=A1x2A2x1,2,3=A3x2A2x3,2,4=A4x2A2x4,3,1=A1x3A3x1,3,2=A2x3A3x2,3,4=A4x3A3x4,4,1=A1x4A4x1,4,2=A2x4A4x2,4,3=A3x4A4x3

(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

F1,1

0

(19)

F1,2

A2x1A1x2

(20)

F1,~2

A22x1+A1x2

(21)

F~1,2

A2x1A11x2

(22)

The defining equation can also have a Matrix or Array in the right-hand side; for example:

F~mu,~nu=Matrix4,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μ,νμ,ν=

(23)

Define

Defined objects with tensor properties

Aμ,Bνν,γμ,Fμ,νμ,ν,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ

(24)

F1,2

E__1

(25)

F~1,2

E__1

(26)

Fμ,ν,matrix

Fμ,ν=

(27)

F~mu,ν,matrix

Fμνμν=

(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

Defineredo,Aμ,ν,ρ,σx,y,z,symmetric=μ,ρ,antisymmetric=ν,σ

Defined objects with tensor properties

Aμ,ν,ρ,σ,Bνν,γμ,Fμ,νμ,ν,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ

(29)

DefineA,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

(30)

Defineindices

Used as indices in tensors:

α,β,μ,ν,ρ,σ

(31)

Definefunctionality

Used as variables in tensor functions:

x,x1,x2,x3,x4,y,z

(32)

Definehistory

History of definitions of tensors:

B,Aμ,ν,ρ,σ,Bμ,γμ,Fμ,νμ,ν,σμ,μ,gμ,ν,εα,β,μ,ν,Bμμ,Bνν,εα,β,μ,ν,Xμ

(33)

See Also

Coordinates, d_, PDEtools[declare], Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup