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

# Online Help

###### All Products    Maple    MapleSim

Physics:-Library - A programming language for Physics

 Calling Sequence Physics:-Library:-Command(arguments, options)

Parameters

 Command - a Command of the Physics Library; could be any of those shown via with(Physics:-Library) arguments - the arguments of Command options - Most Library Commands accept optional arguments of the form name = value

Description

 • This Physics Library got introduced in Maple 17 with 96 programming commands and 58 specialized Physics types, all key elements of the programming language used at Maplesoft to construct Physics. This library has been growing; in Maple 2019 there are 159 programming commands and 98 Physics types. These commands and types can be useful to program your own extensions of Physics. Many of these commands are useful interactively too, like for instance AntiCommute, Commute, Degree for noncommutative variables, IsTensorialAntisymmetric, IsTensorialSymmetric, MinimizeTensorComponents for tensors, Backup and Restore to explore with different settings for algebra rules, spacetime dimensions, and so on.
 • To load this Library of programming commands, enter:
 > with(Physics): with(Library):
 You can also use any of these commands without loading the Library by using the long form, as in Library:-Command.
 • To see a complete list of the Physics types available, because PhysicsType is one of the commands of the Library, and a module itself, you can enter exports(PhysicsType), or instead list them alphabetically using another Library command, ListPhysicsTypes:
 > ListPhysicsTypes();
 $\left[{\mathrm{AnnihilationCreationOperator}}{,}{\mathrm{AnnihilationOperator}}{,}{\mathrm{AppliableProcedure}}{,}{\mathrm{AppliedQuantumOperator}}{,}{\mathrm{AtProcedure}}{,}{\mathrm{BosonAnnihilationCreationOperator}}{,}{\mathrm{BosonAnnihilationOperator}}{,}{\mathrm{BosonCreationOperator}}{,}{\mathrm{Bra}}{,}{\mathrm{Bracket}}{,}{\mathrm{CommutativeMapping}}{,}{\mathrm{CompositeDifferentiationOperator}}{,}{\mathrm{Contravariant}}{,}{\mathrm{ContravariantGreek}}{,}{\mathrm{Covariant}}{,}{\mathrm{CreationOperator}}{,}{\mathrm{D_}}{,}{\mathrm{DifferentialOperator}}{,}{\mathrm{DifferentialOperatorIndexed}}{,}{\mathrm{DifferentialOperatorSymbol}}{,}{\mathrm{DiracSpinor}}{,}{\mathrm{DiracSpinorWithoutIndices}}{,}{\mathrm{DoublyIndexedPhysicsMatrix}}{,}{\mathrm{EntirelyNotNestedIntegral}}{,}{\mathrm{EuclideanIndex}}{,}{\mathrm{EuclideanTensor}}{,}{\mathrm{ExpandableProduct}}{,}{\mathrm{ExtendedBra}}{,}{\mathrm{ExtendedDifferentialOperator}}{,}{\mathrm{ExtendedDifferentialOperatorIndexed}}{,}{\mathrm{ExtendedDifferentialOperatorSymbol}}{,}{\mathrm{ExtendedKet}}{,}{\mathrm{ExtendedMatrix}}{,}{\mathrm{ExtendedMatrixRequiringEval}}{,}{\mathrm{ExtendedPhysicsMatrix}}{,}{\mathrm{ExtendedProjector}}{,}{\mathrm{ExtendedProjectorKind}}{,}{\mathrm{ExtendedQuantumOperator}}{,}{\mathrm{ExtendedTensor}}{,}{\mathrm{ExtendedVectorDifferentialOperator}}{,}{\mathrm{FermionAnnihilationCreationOperator}}{,}{\mathrm{FermionAnnihilationOperator}}{,}{\mathrm{FermionCreationOperator}}{,}{\mathrm{FullyCommutative}}{,}{\mathrm{HalfInteger}}{,}{\mathrm{HermitianOperator}}{,}{\mathrm{IdentityMatrix}}{,}{\mathrm{InertSymbol}}{,}{\mathrm{Ket}}{,}{\mathrm{LeviCivitaNonGalilean}}{,}{\mathrm{LeviCivitaTensor}}{,}{\mathrm{LinearOperatorFunction}}{,}{\mathrm{LiteralSubscript}}{,}{\mathrm{NegativePower}}{,}{\mathrm{NonCommutativeProduct}}{,}{\mathrm{NonTensorFunction}}{,}{\mathrm{NotNestedIntegral}}{,}{\mathrm{NumericalIndex}}{,}{\mathrm{P_indexed}}{,}{\mathrm{P_suffixed}}{,}{\mathrm{PhysicsD3_2}}{,}{\mathrm{PhysicsD_2}}{,}{\mathrm{PhysicsFunction}}{,}{\mathrm{PhysicsKnownFunction}}{,}{\mathrm{PhysicsMatrix}}{,}{\mathrm{PhysicsMatrixWithMatrixIndices}}{,}{\mathrm{PhysicsTensor}}{,}{\mathrm{PhysicsVectors}}{,}{\mathrm{Physicsd_2}}{,}{\mathrm{Polynomial}}{,}{\mathrm{Procedure}}{,}{\mathrm{Projector}}{,}{\mathrm{ProjectorCore}}{,}{\mathrm{ProjectorInt}}{,}{\mathrm{ProjectorKind}}{,}{\mathrm{ProjectorKindDot}}{,}{\mathrm{ProjectorKindStar}}{,}{\mathrm{ProjectorSum}}{,}{\mathrm{QuantumNumber}}{,}{\mathrm{QuantumObject}}{,}{\mathrm{QuantumOperator}}{,}{\mathrm{QuantumOperatorFunction}}{,}{\mathrm{SpaceNumericalIndex}}{,}{\mathrm{SpaceTimeVectorApplied}}{,}{\mathrm{SpacetimeNumericalIndex}}{,}{\mathrm{Spinor}}{,}{\mathrm{SpinorWithoutIndices}}{,}{\mathrm{SumOfNegatives}}{,}{\mathrm{SymbolicTensorIndex}}{,}{\mathrm{Tensor}}{,}{\mathrm{TensorAllowWithoutIndices}}{,}{\mathrm{TensorInCurrentCoordinates}}{,}{\mathrm{TensorIndex}}{,}{\mathrm{TensorInternalRepresentation}}{,}{\mathrm{TensorQuantumOperator}}{,}{\mathrm{TensorStructure}}{,}{\mathrm{TensorVector}}{,}{\mathrm{TensorWithAbstractIndices}}{,}{\mathrm{TensorWithIndices}}{,}{\mathrm{TensorWithNumericalIndices}}{,}{\mathrm{TensorWithoutIndices}}{,}{\mathrm{TensorialExpression}}{,}{\mathrm{TripleProduct}}{,}{\mathrm{UnitaryOperator}}{,}{\mathrm{VectorDifferentialOperator}}{,}{\mathrm{VectorOperator}}{,}{\mathrm{VectorOperatorApplied}}{,}{\mathrm{Vectorial}}{,}{\mathrm{X_mu}}{,}{\mathrm{dg_dg}}{,}{\mathrm{genericindex}}{,}{\mathrm{p_P_indexed}}{,}{\mathrm{p_P_suffixed}}{,}{\mathrm{p_indexed}}{,}{\mathrm{p_suffixed}}{,}{\mathrm{spaceindex}}{,}{\mathrm{spacetimeindex}}{,}{\mathrm{spinorindex}}{,}{\mathrm{su2index}}{,}{\mathrm{su2matrixindex}}{,}{\mathrm{su3index}}{,}{\mathrm{su3matrixindex}}{,}{\mathrm{tetradindex}}{,}{\mathrm{x_mu}}\right]$ (1)
 You can see the definition of these types in two different ways. First, using the option showdefinition of ListPhysicsTypes. For example:
 > ListPhysicsTypes(AnnihilationCreationOperator, showdefinition);
 $\left[{\mathrm{AnnihilationCreationOperator}}{=}\left({\mathrm{AnnihilationOperator}}{\vee }{\mathrm{CreationOperator}}\right)\right]$ (2)
 Secondly, the definition for each PhysicsType can be retrieved using TypeTools:-GetType, for example:
 > TypeTools:-GetType(PhysicsType:-AnnihilationCreationOperator);
 ${\mathrm{AnnihilationOperator}}{\vee }{\mathrm{CreationOperator}}$ (3)
 • If you load the package of types via with(PhysicsType), you can also see this definition entering just TypeTools:-GetType(AnnihilationCreationOperator). Recall however that by entering with(PhysicsType) you will populate the space of working names with the names of all the Physics types.
 • These types are used as in type(A, PhysicsType:-TypeKeyword) or using the long forms Library:-PhysicsType:-TypeKeyword or Physics:-Library:-PhysicsType:-TypeKeyword, depending on whether you have already loaded Physics or Physics:-Library using with. In all cases A can be anything, and TypeKeyword is any of the types returned above by ListPhysicsTypes() or exports(PhysicsType). Note that you do not need to list these types before using them.
 • Mathematical notation: When Physics or Physics:-Vectors are loaded in the Standard Graphical User Interface, by entering
 > with(Physics): Setup(mathematicalnotation = true);
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (4)
 you have anticommutative and noncommutative variables displayed in different colors, non-projected vectors and unit vectors are respectively displayed with an arrow and a hat on top, the vectorial differential operators (such as Nabla, Laplacian) with an upside down triangle, and most of the other Physics commands are displayed as in textbooks.
 • Examples: illustrating the use of the package's commands in Analytical Geometry, Mechanics, Electrodynamics, Special and General Relativity, and Quantum Mechanics are found in Physics examples (this page opens only in the Standard Graphical User Interface).
 • Instead of providing a help page for each of these Library programming tools, below there is an alphabetical listing of them, linking to sections within this single page, where their calling sequence, parameters, description, and examples are shown.

List of the Physics Library Commands

Add

 Calling Sequence
 Physics:-Library:-Add(f, k = m..n)
 Parameters
 f    : algebraic expression
 k    : name; summation index
 m, n : integers or arbitrary expressions, indicate the summation range
 Description
 Add unifies the standard add and sum commands into one that uses a more modern handling of arguments, is free of premature evaluation problems, and implements multi-index summation. The functionality and handling of arguments of Add can be plugged directly into the sum command using the option redefinesum of Physics:-Setup.
 Examples
 > restart: with(Physics): with(Library):
 Consider this multi-index summation.
 > Add(f[i, j], 1 <= i+j and i+j <= n);
 ${\sum }_{{1}{\le }{i}{+}{j}{\le }{n}}{}{{f}}_{{i}{,}{j}}$ (5)
 For instance, for $n=2$,
 > eval((5), n = 2);
 ${{f}}_{{0}{,}{1}}{+}{{f}}_{{1}{,}{0}}{+}{{f}}_{{0}{,}{2}}{+}{{f}}_{{1}{,}{1}}{+}{{f}}_{{2}{,}{0}}$ (6)
 The formula for the integer power of a sum is:
 > (a+b+c)^n = Add(factorial(n)*a^p*b^q*c^r/(factorial(p)*factorial(q)*factorial(r)), p+q+r = n);
 ${\left({a}{+}{b}{+}{c}\right)}^{{n}}{=}{\sum }_{{p}{+}{q}{+}{r}{=}{n}}{}{n}{!}{}{{a}}^{{p}}{}{{b}}^{{q}}{}{{c}}^{{r}}{}\frac{{1}}{{p}{!}{}{q}{!}{}{r}{!}}$ (7)
 > eval((7), n = 3);
 ${\left({a}{+}{b}{+}{c}\right)}^{{3}}{=}{{a}}^{{3}}{+}{3}{}{{a}}^{{2}}{}{b}{+}{3}{}{{a}}^{{2}}{}{c}{+}{3}{}{a}{}{{b}}^{{2}}{+}{6}{}{a}{}{b}{}{c}{+}{3}{}{a}{}{{c}}^{{2}}{+}{{b}}^{{3}}{+}{3}{}{{b}}^{{2}}{}{c}{+}{3}{}{b}{}{{c}}^{{2}}{+}{{c}}^{{3}}$ (8)
 A more modern handling of its arguments, consider a typical problem where a name, say $j$, is assigned a value, and $j$ is used as dummy summation variable
 > a, b, j := 1, 2, 3;
 ${a}{,}{b}{,}{j}{≔}{1}{,}{2}{,}{3}$ (9)
 The value just assigned, $j=3$, is not expected to interfere with the summation
 > Add(f[j], j = a..b);
 ${{f}}_{{1}}{+}{{f}}_{{2}}$ (10)
 while for this example, sum interrupts with an error message due to a premature evaluation of the summation index $j$. Another frequent case: a procedure that returns a value according to the value of the summation index.
 > g := k -> if k::odd then G[k] else 0 end if;
 ${g}{≔}{k}{↦}{\mathbf{if}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{k}{::}{\mathrm{odd}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{G}}_{{k}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{else}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{0}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{end}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{if}}$ (11)
 Without giving a value to the summation limit $f$, the following summation cannot be performed.
 > Add(g(k), k = 1 .. f);
 ${\sum }_{{k}{=}{1}}^{{f}}{}{g}{}\left({k}\right)$ (12)
 For this example, add interrupts with an error message while sum returns 0, again due to a premature evaluation of $g\left(k\right)$ before $k$ has a numerical value. Using a more modern handling of arguments Add returns unevaluated instead, as seen above, which permits evaluating the summation at a later moment, for instance attributing a value to $f$.
 > eval((12), f = 3);
 ${{G}}_{{1}}{+}{{G}}_{{3}}$ (13)
 See Also

AntiCommute

 Calling Sequence
 Physics:-Library:-AntiCommute(a, b)
 Parameters
 a    : any Maple algebraic expression
 b    : any Maple algebraic expression
 Description
 AntiCommute returns true or false according to whether a and b anticommute, that is, a*b = -b*a.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(anticommutativepre = A):
 $\mathrm{* Partial match of \text{'}}\mathrm{anticommutativepre}\mathrm{\text{'} against keyword \text{'}}\mathrm{anticommutativeprefix}\text{'}$
 $\mathrm{_______________________________________________________}$ (14)
 > AntiCommute(A1, A2);
 ${\mathrm{true}}$ (15)
 See Also

ApplyCommandUsingImplicitAssumptions

 Calling Sequence
 Physics:-Library:-ApplyCommandUsingImplicitAssumptions(command, ee)
 Parameters
 command : a maple command to be applied to ee
 ee      : a Maple object, typically an algebraic expression or equation or set of them, containing definite integrals, sums, or products
 Description
 ApplyCommandUsingImplicitAssumptions applies any command to expressions containing sums, integrals or products such that the command is applied to the summand (integrand or 1st argument of the product) taking into account the assumptions implicit in the summation (integration or product) range.
 Any additional argument passed to ApplyCommandUsingImplicitAssumptions is passed as an optional argument for command when performing the operation.
 Examples
 > restart: with(Physics): with(Library):
 > Sum((a*b)^k, k = a .. b);
 ${\sum }_{{k}{=}{a}}^{{b}}{}{\left({a}{}{b}\right)}^{{k}}$ (16)
 expand will not expand the power in the summand: it does not know about $k$ being an integer (implicit assumption in the Sum structure)
 > expand((16));
 ${\sum }_{{k}{=}{a}}^{{b}}{}{{a}}^{{k}}{}{{b}}^{{k}}$ (17)
 The following makes expand be aware of the implicit assumptions on $k$ and so expand the power
 > ApplyCommandUsingImplicitAssumptions(expand, (16));
 ${\sum }_{{k}{=}{a}}^{{b}}{}{{a}}^{{k}}{}{{b}}^{{k}}$ (18)
 See Also

ApplyProductsOfDifferentialOperators

 Calling Sequence
 Physics:-Library:-ApplyProductsOfDifferentialOperators(ee)
 Parameters
 e : any valid Maple object, possibly an expression, that may contain products involving differential operators
 Description
 Given an algebraic expression ee, or any Maple object (e.g. set, list or Matrix) containing such expressions, ApplyProductsOfDifferentialOperators applies the differential operators found in the products to the operands appearing to their right.
 Examples
 > restart: with(Physics): with(Library): with(Vectors):
 Consider the commutator between a scalar $A\left(x,y,z\right)$ and the $\nabla$ operator; use CompactDisplay for convenience
 > CompactDisplay(A(x, y, z), B_(x, y, z));
 ${A}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{will now be displayed as}}{}{A}$
 $\stackrel{{\to }}{{B}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{will now be displayed as}}{}\stackrel{{\to }}{{B}}$ (19)
 > Commutator(Nabla, A(x, y, z));
 ${\left[{\nabla }{,}{A}\right]}_{{-}}$ (20)
 The expanded form of this commutator has the correct operatorial meaning:
 > expand((20));
 ${\nabla }{}{A}{-}{A}{}{\nabla }$ (21)
 • So all the algebra is performed taking $\nabla$ as a noncommutative operator, as we do when computing with paper and pencil. You can apply the differential operators at any time using the ApplyProductsOfDifferentialOperators
 > ApplyProductsOfDifferentialOperators((21));
 ${{A}}_{{x}}{}\stackrel{{\wedge }}{{i}}{+}{{A}}_{{y}}{}\stackrel{{\wedge }}{{j}}{+}{{A}}_{{z}}{}\stackrel{{\wedge }}{{k}}{-}{A}{}{\nabla }$ (22)
 The differentiation variables associated to $\nabla$ are the coordinates of the Cartesian cylindrical and spherical systems of coordinates: $\left[x,y,z,\mathrm{\rho },\mathrm{\phi },r,\mathrm{\theta }\right]$. The same concept is implemented for the differential operators of special and special and general relativity, d_ and D_. Define system of coordinates, $X$, then $A$ and $B$ as a tensors and for convenience use a CompactDisplay
 > Coordinates(X);
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 $\left\{{X}\right\}$ (23)
 > Define(A[mu], B[mu]);
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{{A}}_{{\mathrm{\mu }}}{,}{{B}}_{{\mathrm{\mu }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}\right\}$ (24)
 > CompactDisplay((A, B)(X));
 ${A}{}\left({\mathrm{x1}}{,}{\mathrm{x2}}{,}{\mathrm{x3}}{,}{\mathrm{x4}}\right){}{\mathrm{will now be displayed as}}{}{A}$
 ${B}{}\left({\mathrm{x1}}{,}{\mathrm{x2}}{,}{\mathrm{x3}}{,}{\mathrm{x4}}\right){}{\mathrm{will now be displayed as}}{}{B}$ (25)
 The commutator of ${\partial }_{\mathrm{\mu }}$ and ${A}_{\mathrm{\nu }}$ multiplied by ${B}_{\mathrm{\alpha }}$, representing the application of ${\partial }_{\mathrm{\mu }}$ can now be represented as
 > Commutator(d_[mu], A[nu](X))*B[alpha](X);
 ${\left[{{\partial }}_{{\mathrm{\mu }}}{,}{{A}}_{{\mathrm{\nu }}}\right]}_{{-}}{}{{B}}_{{\mathrm{\alpha }}}$ (26)
 > expand((26));
 ${{\partial }}_{{\mathrm{\mu }}}{}{{A}}_{{\mathrm{\nu }}}{}{{B}}_{{\mathrm{\alpha }}}{-}{{A}}_{{\mathrm{\nu }}}{}{{\partial }}_{{\mathrm{\mu }}}{}{{B}}_{{\mathrm{\alpha }}}$ (27)
 Note that to the right of ${\partial }_{\mathrm{\mu }}$ in the first term there is the product ${A}_{\mathrm{\nu }}{B}_{\mathrm{\alpha }}$, so that when applying the operator to the product, two terms result, one of which cancels the second term in the above:
 > Library:-ApplyProductsOfDifferentialOperators((27));
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{{\mathrm{\nu }}}\right){}{{B}}_{{\mathrm{\alpha }}}$ (28)
 ApplyProductsOfDifferentialOperators also applies differential operators that you define as such using Setup. This is particularly useful in quantum mechanics.
 > Setup(differentialoperators = {[p_, [x, y, z]]}, hermitianoperators = {p, x, y, z}, algebrarules = {%Commutator(x, y) = 0, %Commutator(x, z) = 0, %Commutator(y, z) = 0}, quiet);
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{x}{,}{y}\right]}_{{-}}{=}{0}{,}{\left[{x}{,}{z}\right]}_{{-}}{=}{0}{,}{\left[{y}{,}{z}\right]}_{{-}}{=}{0}\right\}{,}{\mathrm{differentialoperators}}{=}\left\{\left[\stackrel{{\to }}{{p}}{,}\left[{x}{,}{y}{,}{z}\right]\right]\right\}{,}{\mathrm{hermitianoperators}}{=}\left\{{p}{,}{x}{,}{y}{,}{z}\right\}\right]$ (29)
 > alias(:-X = (x, y, z)):
 > CompactDisplay(F(X)):
 ${F}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{will now be displayed as}}{}{F}$ (30)
 > %Commutator(F(X), p_)*Ket(psi, X);
 ${\left[{F}{,}\stackrel{{\to }}{{p}}\right]}_{{-}}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩$ (31)
 Note that $\stackrel{\to }{{p}}$, $F\left(X\right)$ and the ket $\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathrm{\psi }}_{x,y,z}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩$ are operands in the products above and that they do not commute: we indicated that the coordinates $X$ are the differentiation variables of $\stackrel{\to }{{p}}$. This emulates what we do when computing with these operators with paper and pencil, where we represent the application of a differential operator as a product operation.
 This representation can be transformed into the (traditional in computer algebra) application of the differential operator when desired, as follows:
 > (31) = expand((31));
 ${\left[{F}{,}\stackrel{{\to }}{{p}}\right]}_{{-}}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩{=}{F}{}\stackrel{{\to }}{{p}}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩{-}\stackrel{{\to }}{{p}}{}{F}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩$ (32)
 > (31) = ApplyProductsOfDifferentialOperators(rhs((32)));
 ${\left[{F}{,}\stackrel{{\to }}{{p}}\right]}_{{-}}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩{=}{F}{}\stackrel{{\to }}{{p}}{}\left(\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩\right){-}\stackrel{{\to }}{{p}}{}\left({F}{}\left|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{{\mathrm{\psi }}}_{{x}{,}{y}{,}{z}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\right⟩\right)$ (33)
 See Also -(lead=indent) CompactDisplay, Coordinates, Define, d_, D_, Setup, Physics:-Vectors, Physics:-Vectors:-Nabla

Backup

 Calling Sequence
 Physics:-Library:-Backup()
 Parameters
 : no parameters
 Description
 Backup saves in memory a copy of the current Physics Setup, so that it can be restored at a later moment, during the same Maple session, using the Physics:-Library:-Restore; command. Backup returns NULL.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(noncommutativeprefix);
 $\left[{\mathrm{noncommutativeprefix}}{=}{\mathrm{none}}\right]$ (34)
 > Backup();
 > Setup(noncommutativeprefix = Z);
 $\left[{\mathrm{noncommutativeprefix}}{=}\left\{{Z}\right\}\right]$ (35)
 > Commute(Z1, Z2);
 ${\mathrm{false}}$ (36)
 > Restore();
 > Setup(noncommutativeprefix);
 $\left[{\mathrm{noncommutativeprefix}}{=}{\mathrm{none}}\right]$ (37)
 > Commute(Z1, Z2);
 ${\mathrm{true}}$ (38)
 See Also

BelongToDifferentDisjointedSpaces

 Calling Sequence
 Physics:-Library:-BelongToDifferentDisjointedSpaces(A, B)
 Parameters
 A, B      : quantum operators set as such using Setup, or Bras or Kets
 Description
 Given A and B as quantum operators or Bras or Kets, BelongToDifferentDisjointedSpaces returns true or false according to whether A and B below to different (disjointed) Hilbert spaces. products, correctly handling the case of noncommutative products and powers and using Glauber's formula for combining exponentials when the exponents commute with their commutator. Note that this functionality, including taking into account the possibly noncommutative character of the operands and powers in a product, is already present in the standard combine command that makes calls to CombinePowersOfSameBase, so you can directly use combine.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(op = {A, B});
 $\mathrm{* Partial match of \text{'}}\mathrm{op}\mathrm{\text{'} against keyword \text{'}}\mathrm{quantumoperators}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumoperators}}{=}\left\{{A}{,}{B}\right\}\right]$ (39)
 > A^n * A^m + exp(A) * exp(B);
 ${{A}}^{{m}}{}{{A}}^{{n}}{+}{{ⅇ}}^{{A}}{}{{ⅇ}}^{{B}}$ (40)
 In this expression, the exponentials in the product ${ⅇ}^{A}{ⅇ}^{B}$ cannot be combined because neither $A$ nor $B$ are commutative:
 > CombinePowersOfSameBase((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}}{}{{ⅇ}}^{{B}}$ (41)
 If, however, A and B commute with their commutator,
 > Setup(%Commutator(A, B) = C, %Commutator(A, C) = 0, %Commutator(B, C) = 0);
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{A}{,}{B}\right]}_{{-}}{=}{C}{,}{\left[{A}{,}{C}\right]}_{{-}}{=}{0}{,}{\left[{B}{,}{C}\right]}_{{-}}{=}{0}\right\}\right]$ (42)
 > CombinePowersOfSameBase((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}{+}{B}{+}\frac{{C}}{{2}}}$ (43)
 This functionality is already present in the standard combine command that makes calls to CombinePowersOfSameBase.
 > combine((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}{+}{B}{+}\frac{{C}}{{2}}}$ (44)
 See Also

CombinePowersOfSameBase

 Calling Sequence
 Physics:-Library:-CombinePowersOfSameBase(ee)
 Parameters
 ee      : a Maple object, typically an algebraic expression or equation or a set of them
 Description
 CombinePowersOfSameBase combines powers of same base in products, correctly handling the case of noncommutative products and powers and using Glauber's formula for combining exponentials when the exponents commute with their commutator. Note that this functionality, including taking into account the possibly noncommutative character of the operands and powers in a product, is already present in the standard combine command that makes calls to CombinePowersOfSameBase, so you can directly use combine.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(op = {A, B});
 $\mathrm{* Partial match of \text{'}}\mathrm{op}\mathrm{\text{'} against keyword \text{'}}\mathrm{quantumoperators}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumoperators}}{=}\left\{{A}{,}{B}\right\}\right]$ (45)
 > A^n * A^m + exp(A) * exp(B);
 ${{A}}^{{m}}{}{{A}}^{{n}}{+}{{ⅇ}}^{{A}}{}{{ⅇ}}^{{B}}$ (46)
 In this expression, the exponentials in the product ${ⅇ}^{A}{ⅇ}^{B}$ cannot be combined because neither $A$ nor $B$ are commutative:
 > CombinePowersOfSameBase((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}}{}{{ⅇ}}^{{B}}$ (47)
 If, however, A and B commute with their commutator,
 > Setup(%Commutator(A, B) = C, %Commutator(A, C) = 0, %Commutator(B, C) = 0);
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{A}{,}{B}\right]}_{{-}}{=}{C}{,}{\left[{A}{,}{C}\right]}_{{-}}{=}{0}{,}{\left[{B}{,}{C}\right]}_{{-}}{=}{0}\right\}\right]$ (48)
 > CombinePowersOfSameBase((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}{+}{B}{+}\frac{{C}}{{2}}}$ (49)
 This functionality is already present in the standard combine command that makes calls to CombinePowersOfSameBase.
 > combine((40));
 ${{A}}^{{m}{+}{n}}{+}{{ⅇ}}^{{A}{+}{B}{+}\frac{{C}}{{2}}}$ (50)
 See Also

Commute

 Calling Sequence
 Physics:-Library:-Commute(a, b)
 Parameters
 a    : any Maple algebraic expression
 b    : any Maple algebraic expression
 Description
 Commute returns true or false according to whether a and b commute, that is, $ab=ba$.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(noncommutativepre = A, %Commutator(A1, A2) = 0):
 $\mathrm{* Partial match of \text{'}}\mathrm{noncommutativepre}\mathrm{\text{'} against keyword \text{'}}\mathrm{noncommutativeprefix}\text{'}$
 $\mathrm{_______________________________________________________}$ (51)
 > Commute(A1, A2);
 ${\mathrm{true}}$ (52)
 > Commute(A1, A3);
 ${\mathrm{false}}$ (53)
 See Also

Contravariant

 Calling Sequence
 Physics:-Library:-Contravariant(mu)
 Parameters
 mu    : any Maple algebraic expression
 Description
 Contravariant receives an algebraic expression representing a tensor index, and returns its corresponding contravariant index according to: if mu is a symbol (not already prefixed with ~), or a non-negative integer smaller or equal to the spacetime dimension, then prefix it with (that is, concatenate) ~; else if mu is a sum of such indices, then prefix all of them with ~; otherwise return mu unchanged.
 Examples
 > restart: with(Physics): with(Library):
 > Contravariant(mu);
 ${\mathrm{~μ}}$ (54)
 > Contravariant(mu + nu);
 ${\mathrm{~μ}}{+}{\mathrm{~ν}}$ (55)
 > Setup(dimension);
 $\left[{\mathrm{dimension}}{=}{4}\right]$ (56)
 > Contravariant(3);
 ${\mathrm{~3}}$ (57)
 > Contravariant(5);
 ${5}$ (58)
 See Also

CoordinatesINFO

 Calling Sequence
 Physics:-Library:-CoordinatesINFO()
 Parameters
 : no parameters
 Description
 CoordinatesINFO returns information about systems of spacetime coordinates set using Coordinates or Setup, as a list with four equations, where in the left-hand sides are the local variables of Physics where the information about the coordinates is saved and in the right-hand sides are the actual value of these variables. This information is of use in various parts of the library that need to handle spacetime coordinates.
 Examples
 > restart: with(Physics): with(Library):
 > CoordinatesINFO();
 $\left[{\mathrm{Coordinates/X}}{=}{\varnothing }{,}{\mathrm{Coordinates/xyz}}{=}{\varnothing }{,}{\mathrm{Coordinates/X_equal_xyz}}{=}{\varnothing }{,}{\mathrm{Coordinates/with_macros}}{=}{\varnothing }\right]$ (59)
 > Coordinates(X=spherical);
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\left\{{X}\right\}$ (60)
 Remove the alias X to turn visible the information in the next input line
 > alias(X = X):
 > CoordinatesINFO();
 $\left[{\mathrm{Coordinates/X}}{=}\left\{{X}\right\}{,}{\mathrm{Coordinates/xyz}}{=}\left\{\left[{r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}{,}{t}\right]\right\}{,}{\mathrm{Coordinates/X_equal_xyz}}{=}\left\{{X}{=}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}{,}{t}\right)\right\}{,}{\mathrm{Coordinates/with_macros}}{=}\left\{{X}{=}\left[{\mathrm{x1}}{,}{\mathrm{x2}}{,}{\mathrm{x3}}{,}{\mathrm{x4}}\right]\right\}\right]$ (61)
 See Also

Covariant

 Calling Sequence
 Physics:-Library:-Covariant(mu)
 Parameters
 mu    : a symbol or an algebraic expression
 Description
 Covariant receives an algebraic expression representing a tensor index, and returns its corresponding covariant index according to: if mu is a symbol prefixed with ~, then remove the ~, otherwise return mu unchanged.
 Examples
 > restart: with(Physics): with(Library):
 > Covariant(~mu);
 ${\mathrm{\mu }}$ (62)
 > Covariant(mu);
 ${\mathrm{\mu }}$ (63)
 See Also

Degree

 Calling Sequence
 Physics:-Library:-Degree()
 Parameters
 EE  : any Maple algebraic object, or equation or a set or list of them
 X   : a name or a set of them
 minmax : optional, can be min, max (default), or both, to request the minimal (equivalent to the lower degree), maximal degree with respect to X, or both (returns a sequence of two numbers)
 Description
 Degree computes the maximum degree of a set of equations EE with respect to variable(s) X, possibly not commutative.
 NOTE: if all the equations are equal to 0, the value returned is 0, not -infinity. When the degree cannot be computed, Degree returns FAIL.
 Examples
 > restart: with(Physics): with(Library):
 > Degree({a, b^2, c^3}, {a, b, c});
 ${3}$ (64)
 See Also

FlattenPowersInProduct

 Calling Sequence
 Physics:-Library:-FlattenPowersInProduct(A0)
 Parameters
 A0  : any algebraic object or a table
 Description
 FlattenPowersInProduct receives an expression, and if it is a power, where the base can be not commutative and the exponent an integer, returns the corresponding product of operands. If A0 is a table, it maps over its elements.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(op = A);
 $\mathrm{* Partial match of \text{'}}\mathrm{op}\mathrm{\text{'} against keyword \text{'}}\mathrm{quantumoperators}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumoperators}}{=}\left\{{A}\right\}\right]$ (65)
 > FlattenPowersInProduct(A^3);
 ${A}{}{A}{}{A}$ (66)
 See Also

FlipCharacter

 Calling Sequence
 Physics:-Library:-FlipCharacter(mu,{ignorefailure: truefalse := false})
 Parameters
 mu              : a tensor index, covariant or contravariant
 ignorefailure   : optional, when given, if mu is not a covariant/contravariant index, return mu itself instead of FAIL
 Description
 FlipCharacter flips the covariant or contravariant character of a given index, or returns FAIL when mu is not an index or the covariant/contravariant character cannot be determined.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(spacetimeindices = greek);
 $\left[{\mathrm{spacetimeindices}}{=}{\mathrm{greek}}\right]$ (67)
 > FlipCharacter(mu);
 ${\mathrm{~μ}}$ (68)
 > FlipCharacter(~mu);
 ${\mathrm{\mu }}$ (69)
 See Also

Forget

 Calling Sequence
 Physics:-Library:-Forget()
 Parameters
 : no parameters
 Description
 Forget clears all the remember tables of the internal subroutines of the Physics package, as well as those of simplify, expand, diff, normal, and int. This command is automatically used by all the Physics commands when appropriate, for example, when defining new algebras or tensors, so that computations performed before that with the same mathematical objects, and stored in remember tables, are cleared to permit the next computations take into account the new properties of the objects.
 Examples
 > restart;
 > expand(A*(B+C));
 ${A}{}{B}{+}{A}{}{C}$ (70)
 Expand swaps operands in products.
 > expand((B+C)*A);
 ${A}{}{B}{+}{A}{}{C}$ (71)
 Expand keeps results in a remember table.
 > op(4, eval(expand));
 ${table}{}\left(\left[{A}{}\left({B}{+}{C}\right){=}{A}{}{B}{+}{A}{}{C}{,}{B}{+}{C}{=}{B}{+}{C}\right]\right)$ (72)
 > with(Physics): with(Library):
 > Setup(op = {A, B, C});
 $\mathrm{* Partial match of \text{'}}\mathrm{op}\mathrm{\text{'} against keyword \text{'}}\mathrm{quantumoperators}\text{'}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{quantumoperators}}{=}\left\{{A}{,}{B}{,}{C}\right\}\right]$ (73)
 The remember table got cleared to permit products with noncommutative operands.
 > op(4, eval(expand));
 No swapping of operands and no interference of the previous remember table.
 > expand((B+C)*A);
 ${B}{}{A}{+}{C}{}{A}$ (74)
 See Also

FromCoordinatesToLabel

 Calling Sequence
 Physics:-Library:-FromCoordinatesToLabel([X], {disregardordering: truefalse := false})
 Parameters
 [X]             : a list of spacetime coordinates set using Coordinates or Setup
 disregardordering   : optional, true or false (default), to disregard the ordering of the spacetime variables within the list [X]
 Description
 FromCoordinatesToLabel receives a list of spacetime coordinates and returns the corresponding label assigned previously by the Coordinates command, when the system of coordinates got defined either using Setup or using Coordinates.
 Examples
 > restart: with(Physics): with(Library):
 > Coordinates(X):
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$ (75)
 > FromCoordinatesToLabel([x1, x2, x3, x4]);
 ${X}$ (76)
 See Also

FromGeneralRelativityTensorFunctionalForm

 Calling Sequence
 Physics:-Library:-FromGeneralRelativityTensorFunctionalForm(A, {evaluatetensor: truefalse := true}, $)  Parameters  A : an algebraic expression involving tensors in a nongalilean spacetime, where the metric depends on the spacetime coordinates and the Christoffel symbols are different from zero  evaluatetensor : optional, true (default) or false, to evaluate the tensor after removing the spacetime functionality  Description  FromGeneralRelativityTensorFunctionalForm receives an expression A containing general relativity tensors with functionality and returns the same expression after removing the functionality of these tensors, followed by a set with the substitution equations used. This is useful when intermediate computations should take into account (or not) this functionality.  Examples  > restart: with(Physics): with(Library):  Set the metric to be nongalilean, for example:  > g_[sc];  ${}\mathrm{_______________________________________________________}$  ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$  ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$  $\mathrm{Setting}\mathrm{lowercaselatin_is}\mathrm{letters to represent}\mathrm{space}\mathrm{indices}$  ${}\mathrm{The Schwarzschild metric in coordinates}{}\left[r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right]$  $\mathrm{Parameters:}\left[m\right]$  $\mathrm{Signature:}\left(\mathrm{- - - +}\right)$  ${}\mathrm{_______________________________________________________}$  ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (77)  > e1 := Riemann[alpha, beta, mu,nu](X) + g_[mu,nu](X);  ${\mathrm{e1}}{≔}{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){+}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right)$ (78)  > FromGeneralRelativityTensorFunctionalForm(e1);  ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{+}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}\left\{{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){=}{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){=}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (79)  See Also FromLabelToCoordinates  Calling Sequence  Physics:-Library:-FromLabelToCoordinates(X)  Parameters  X : a capital Letter that is the label of a system of spacetime coordinates set using Coordinates or Setup  Description  FromLabelToCoordinates receives a capital letter that is the label of a system of spacetime coordinates previously set with Coordinates or Setup and returns the corresponding list of coordinates.  Examples  > restart: with(Physics): with(Library):  > Coordinates(X):  ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$ (80)  > ee := FromLabelToCoordinates(:-X);  ${\mathrm{ee}}{≔}{X}$ (81)  > map(, [ee]);  $\left[\left({\mathrm{x1}}\right){,}\left({\mathrm{x2}}\right){,}\left({\mathrm{x3}}\right){,}\left({\mathrm{x4}}\right)\right]$ (82)  See Also FromMetricToLineElement  Calling Sequence  Physics:-Library:-FromMetricToLineElement(g_info := Physics:-GetSetupINFO(metric), X := Physics:-GetSetupINFO(differentiationvariables), dim := Physics:-GetSetupINFO(dimension), {used_: truefalse := false})  Parameters  g_info : optional, the default value is the current spacetime metric as returned by Setup(differentiationvariables), it can also be any equivalent set of array elements  X : optional, the default value is the list of the current differentiation variables as returned by Setup(differentiationvariables)  dim : optional, the default value is the current dimension of the spacetime as returned by Setup(dimension)  used_ : optional, can be true or false (default), to represent the differential of the spacetime coordinates using d_, or just concatenating the symbol d with the coordinate  Description  FromMetricToLineElement computes the line element representation for the spacetime metric, an expression quadratic in the differentials of the spacetime coordinates, expressed by default concatenating the letter d with the coordinate, a visual representation, or applying d_ to the coordinate, a real mathematical representation that Physics understands with the correct meaning.  Examples  > restart: with(Physics): with(Library):  > Coordinates(X):  ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$ (83)  > FromMetricToLineElement();  ${-}{{\mathrm{dx1}}}^{{2}}{-}{{\mathrm{dx2}}}^{{2}}{-}{{\mathrm{dx3}}}^{{2}}{+}{{\mathrm{dx4}}}^{{2}}$ (84)  > FromMetricToLineElement(used_);  ${-}{{\mathbf{ⅆ}}{}\left({\mathrm{x1}}\right)}^{{2}}{-}{{\mathbf{ⅆ}}{}\left({\mathrm{x2}}\right)}^{{2}}{-}{{\mathbf{ⅆ}}{}\left({\mathrm{x3}}\right)}^{{2}}{+}{{\mathbf{ⅆ}}{}\left({\mathrm{x4}}\right)}^{{2}}$ (85)  See Also FromSpaceTimeVector  Calling Sequence  Physics:-Library:-FromSpaceTimeVector(ee)  Parameters  ee : a mathematical expression possibly involving the SpaceTimeVector command of Physics  Description  FromSpaceTimeVector converts all occurrences of SpaceTimeVector[mu](X) into X[mu], where X is a sequence of spacetime coordinates.  Examples  > restart: with(Physics): with(Library):  > Coordinates(X):  ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$ (86)  > X_mu := FromSpaceTimeVector(SpaceTimeVector[mu](X));  ${\mathrm{X_mu}}{≔}{{X}}_{{\mathrm{\mu }}}$ (87)  > map(, [op(0, X_mu)]);  $\left[\left({\mathrm{x1}}\right){,}\left({\mathrm{x2}}\right){,}\left({\mathrm{x3}}\right){,}\left({\mathrm{x4}}\right)\right]$ (88)  See Also FromTensorFunctionalForm  Calling Sequence  Physics:-Library:-FromTensorFunctionalForm(A,{evaluatetensor: truefalse := true},$)
 Parameters
 A               : an algebraic expression involving tensors that have functional dependency, either because they were defined as such, or because it is one of the general relativity tensors and the spacetime is nongalilean, with the metric depending on the spacetime coordinates
 evaluatetensor  : optional, true (default) or false, to evaluate the tensor after removing the spacetime functionality
 Description
 FromTensorFunctionalForm receives an expression A containing tensors with functionality - say T[i,j](x,y), and returns the same expression after removing the functionality of these tensors - say as in T[i,j] - followed by a set with the substitution equations used. This is useful when intermediate computations should take into account (or not) this functionality. In this sense, FromTensorFunctionalForm is a generalization of the Maple 17 FromGeneralRelativityTensorFunctionalForm command that also handles user defined tensor functions, and performs the reverse operation of ToTensorFunctionalForm.
 Examples
 > restart: with(Physics): with(Library):
 Define a system of coordinates and tensor depending on some variables.
 > Coordinates(X = Cartesian);
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(x{,}y{,}z{,}t\right)\right\}$
 $\left\{{X}\right\}$ (89)
 > Define(p[mu] = [m*v__1(t), m*v__2(t), m*v__3(t), p__0(t)]);
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{p}}_{{\mathrm{\mu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}\right\}$ (90)
 The system now knows about this dependency on $t$ and $m$, so that the derivatives of ${p}_{\mathrm{\mu }}$ are not zero.
 > [p[mu], diff(p[mu], t), d_[nu](p[mu])];
 $\left[{{p}}_{{\mathrm{\mu }}}{,}\frac{{\partial }}{{\partial }{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{p}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\nu }}}{}\left({{p}}_{{\mathrm{\mu }}}\right)\right]$ (91)
 Put and remove the functionality.
 > ToTensorFunctionalForm((91));
 $\left[{{p}}_{{\mathrm{\mu }}}{}\left({t}{,}{m}\right){,}{\stackrel{{\mathbf{.}}}{{p}}}_{{\mathrm{\mu }}}{}\left({t}{,}{m}\right){,}{{\partial }}_{{\mathrm{\nu }}}{}\left({{p}}_{{\mathrm{\mu }}}{}\left({t}{,}{m}\right)\right)\right]{,}\left\{{{p}}_{{\mathrm{\mu }}}{=}{{p}}_{{\mathrm{\mu }}}{}\left({t}{,}{m}\right)\right\}$ (92)
 > FromTensorFunctionalForm((92)[1]);
 $\left[{{p}}_{{\mathrm{\mu }}}{,}\frac{{\partial }}{{\partial }{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{p}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\nu }}}{}\left({{p}}_{{\mathrm{\mu }}}\right)\right]{,}\left\{{{p}}_{{\mathrm{\mu }}}{}\left({t}{,}{m}\right){=}{{p}}_{{\mathrm{\mu }}}\right\}$ (93)
 Set the metric to be nongalilean, for example:
 > g_[sc];
 ${}\mathrm{_______________________________________________________}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\mathrm{Setting}\mathrm{lowercaselatin_is}\mathrm{letters to represent}\mathrm{space}\mathrm{indices}$
 ${}\mathrm{The Schwarzschild metric in coordinates}{}\left[r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right]$
 $\mathrm{Parameters:}\left[m\right]$
 $\mathrm{Signature:}\left(\mathrm{- - - +}\right)$
 ${}\mathrm{_______________________________________________________}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (94)
 > e1 := Riemann[alpha, beta, mu,nu](X) + g_[mu,nu](X);
 ${\mathrm{e1}}{≔}{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){+}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right)$ (95)
 > FromTensorFunctionalForm(e1);
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{+}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}\left\{{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){=}{{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({X}\right){=}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (96)
 See Also

FromTensorInternalRepresentation

 Calling Sequence
 Physics:-Library:-FromTensorInternalRepresentation(expr,{evaluatetensor: truefalse := true})
 Parameters
 expr             : a mathematical expression containing tensors in the Physics internal representation
 evaluatetensor   : optional, it can be true (default) or false, to evaluate the tensors after having restored their natural (not internal) representation
 Description
 FromTensorInternalRepresentation replaces, in the given expression, all tensors expressed using the Physics internal representation by the same tensors expressed in the natural representation used at user level. The tensors being restored are evaluated before returning, so that they get normalized taking into account their symmetry properties. To override that evaluation use the option evaluatetensor = false.
 Examples
 > restart: with(Physics): with(Library):
 > Coordinates(X):
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$ (97)
 > Define(A):
 $\mathrm{Defined objects with tensor properties}$ (98)
 > ir := ToTensorInternalRepresentation(d_[mu](A[nu](X)));
 ${\mathrm{ir}}{≔}\left\{{{\mathrm{_tenop}}{}\left({{\partial }}_{{{\mathrm{_dotidx}}}_{{1}}}{,}\left[\left[{{A}}_{{{\mathrm{_dotidx}}}_{{2}}}{}\left({X}\right){,}\left[{X}\right]\right]\right]\right)}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}{,}{{\mathrm{_tenop}}{}\left({{\partial }}_{{{\mathrm{_dotidx}}}_{{1}}}{,}\left[\left[{{A}}_{{{\mathrm{_dotidx}}}_{{2}}}{}\left({X}\right){,}\left[{X}\right]\right]\right]\right)}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (99)
 > FromTensorInternalRepresentation(ir[2]);
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{{\mathrm{\nu }}}{}\left({X}\right)\right)$ (100)
 See Also

GetAlgebraRuleName

 Calling Sequence
 Physics:-Library:-GetAlgebraRuleName(A)
 Parameters
 A  : a mathematical object supposed to be part of the definition of an algebra rule of Commutators or AntiCommutators
 Description
 GetAlgebraRuleName applies a := GetNameWithIndices(A), and when a enters the internal representation of an algebra rule of Commutators or AntiCommutators, returns a Otherwise, if a is indexed it returns op(0, a). This command is used inside Commutator and AntiCommutator when computing, in order to determine whether an algebra rule already exists for the objects being manipulated.
 Examples
 > restart: with(Physics): with(Library):
 > Define(A, B):
 $\mathrm{Defined objects with tensor properties}$ (101)
 > Setup('Commutator(A[mu], B[nu])' = KroneckerDelta[mu,nu]);
 ${\mathbit{Warning, since Maple 2019 KroneckerDelta is not implemented as a tensor unless the indices are of type indices, not space or spacetime. Thus, the right-hand side of the algebra rule}}\left({\left[{{\mathbit{A}}}_{{\mathbf{\mu }}}{\mathbf{,}}{{\mathbit{B}}}_{{\mathbf{\nu }}}\right]}_{{\mathbf{-}}}{\mathbf{=}}{{\mathbf{\delta }}}_{{\mathbf{\mu }}{\mathbf{,}}{\mathbf{\nu }}}\right){\mathbit{has for free tensor indices}}{\mathbit{\varnothing }}{\mathbit{, while the left-hand side has}}\left\{{\mathbf{\mu }}{,}{\mathbf{\nu }}\right\}{\mathbit{, of which}}\left\{{\mathbf{\mu }}{,}{\mathbf{\nu }}\right\}{\mathbit{appear in}}\left\{{{\mathbf{\delta }}}_{{\mathbf{\mu }}{\mathbf{,}}{\mathbf{\nu }}}\right\}{\mathbit{. To resolve this problem you can: 1. If the dimension of the tensor indices on the left-hand side is 3, then use su2indices that you can define via}}{\mathbit{Setup}}{}\left({\mathbit{su2indices}}{\mathbf{=}}{\mathbit{greek}}\right){\mathbit{. 2. Use the spacetime metric g_, or the space metric gamma_, instead of KroneckerDelta. If so, check the value of:}}{\mathbit{Setup}}{}\left({\mathbit{signature}}\right){\mathbit{. 3. Enter:}}{\mathbit{macro}}{}\left({\mathbit{KroneckerDelta}}{\mathbf{=}}{\mathbit{g_}}\right){\mathbit{; or use gamma_ instead of g_. 4. Define a Kronecker}}{\mathbf{\delta }}{\mathbit{tensor. In the following, type \text{'}delta\text{'} on the left and \text{'}KroneckerDelta\text{'} on the right, or copy and paste:}}{\mathbit{Define}}{}\left({{\mathbf{\delta }}}_{{\mathbf{\alpha }}{\mathbf{,}}{\mathbf{\beta }}}{\mathbf{=}}{\mathbit{Matrix}}{}\left({\mathbf{4}}{,}{\mathbf{4}}{,}\left({\mathbit{j}}{,}{\mathbit{k}}\right){\mathbf{↦}}{{\mathbf{\delta }}}_{{\mathbit{j}}{\mathbf{,}}{\mathbit{k}}}\right)\right){\mathbit{. After any of the above it is recommended that you set this algebra rule again, with the corrected right-hand side, to avoid problems due to having different free indices on each side of the rule.}}$
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{{A}}_{{\mathrm{\mu }}}{,}{{B}}_{{\mathrm{\nu }}}\right]}_{{-}}{=}{{\mathrm{\delta }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}\right]$ (102)
 > GetAlgebraRuleName(A[mu]);
 ${A}$ (103)
 See Also

GetAlgebraRules

 Calling Sequence
 Physics:-Library:-GetAlgebraRules(A, B, {cackind:list(identical(Physics:-Commutator, Physics:-AntiCommutator)) := [Physics:-Commutator, Physics:-AntiCommutator]})
 Parameters
 A, B     : two mathematical objects supposed to be related to the operands of a previous definition of an algebra rule of a Commutator or an AntiCommutator
 cackind  : optional, a list with either or both of Commutator and AntiCommutator, to search in the corresponding tables of previously defined algebra rules
 Description
 GetAlgebraRules checks the internal tables for algebra rules of Commutators or AntiCommutators set using Setup, that are related to the objects A and B given. The output consists of a sequence of two lists, each containing lists of two elements, respectively defining Commutator and AntiCommutator algebra rules.
 Examples
 > restart: with(Physics): with(Library):
 > Define(A, B):
 $\mathrm{Defined objects with tensor properties}$ (104)
 > Setup('Commutator(A[mu], B[nu])' = KroneckerDelta[mu,nu]);
 ${\mathbit{Warning, since Maple 2019 KroneckerDelta is not implemented as a tensor unless the indices are of type indices, not space or spacetime. Thus, the right-hand side of the algebra rule}}\left({\left[{{\mathbit{A}}}_{{\mathbf{\mu }}}{\mathbf{,}}{{\mathbit{B}}}_{{\mathbf{\nu }}}\right]}_{{\mathbf{-}}}{\mathbf{=}}{{\mathbf{\delta }}}_{{\mathbf{\mu }}{\mathbf{,}}{\mathbf{\nu }}}\right){\mathbit{has for free tensor indices}}{\mathbit{\varnothing }}{\mathbit{, while the left-hand side has}}\left\{{\mathbf{\mu }}{,}{\mathbf{\nu }}\right\}{\mathbit{, of which}}\left\{{\mathbf{\mu }}{,}{\mathbf{\nu }}\right\}{\mathbit{appear in}}\left\{{{\mathbf{\delta }}}_{{\mathbf{\mu }}{\mathbf{,}}{\mathbf{\nu }}}\right\}{\mathbit{. To resolve this problem you can: 1. If the dimension of the tensor indices on the left-hand side is 3, then use su2indices that you can define via}}{\mathbit{Setup}}{}\left({\mathbit{su2indices}}{\mathbf{=}}{\mathbit{greek}}\right){\mathbit{. 2. Use the spacetime metric g_, or the space metric gamma_, instead of KroneckerDelta. If so, check the value of:}}{\mathbit{Setup}}{}\left({\mathbit{signature}}\right){\mathbit{. 3. Enter:}}{\mathbit{macro}}{}\left({\mathbit{KroneckerDelta}}{\mathbf{=}}{\mathbit{g_}}\right){\mathbit{; or use gamma_ instead of g_. 4. Define a Kronecker}}{\mathbf{\delta }}{\mathbit{tensor. In the following, type \text{'}delta\text{'} on the left and \text{'}KroneckerDelta\text{'} on the right, or copy and paste:}}{\mathbit{Define}}{}\left({{\mathbf{\delta }}}_{{\mathbf{\alpha }}{\mathbf{,}}{\mathbf{\beta }}}{\mathbf{=}}{\mathbit{Matrix}}{}\left({\mathbf{4}}{,}{\mathbf{4}}{,}\left({\mathbit{j}}{,}{\mathbit{k}}\right){\mathbf{↦}}{{\mathbf{\delta }}}_{{\mathbit{j}}{\mathbf{,}}{\mathbit{k}}}\right)\right){\mathbit{. After any of the above it is recommended that you set this algebra rule again, with the corrected right-hand side, to avoid problems due to having different free indices on each side of the rule.}}$
 $\left[{\mathrm{algebrarules}}{=}\left\{{\left[{{A}}_{{\mathrm{\mu }}}{,}{{B}}_{{\mathrm{\nu }}}\right]}_{{-}}{=}{{\mathrm{\delta }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}\right]$ (105)
 > GetAlgebraRules(A[mu], B[nu]);
 $\left[\left[{A}{,}{B}\right]\right]{,}\left[\right]$ (106)
 See Also

GetAntiCommutativeSymbol

 Calling Sequence
 Physics:-Library:-GetAntiCommutativeSymbol(x,n := 1)
 Parameters
 x  : any Maple object such that the anticommutative symbols returned are not already contained in x
 n  : optional, default value is 1, indicates how many anticommutative symbols are to be returned
 Description
 GetAntiCommutativeSymbol returns anticommutative symbols (variables of type symbol) taking into account the anticommutative prefix of the moment, set using Setup(anticommutativeprefix). By default it returns 1 symbol; optionally returning as many as the number n passed as second argument. These symbol variables are not found in x, are not assigned, have no attributes previously set, are not local variables and are not visually identical to any local variables found in x; they are also not visually equivalent to the variables used during calls to assuming. This commands is thus a convenient way of getting variables of this type for internal computations within subroutines, that at the same time do not collide with the global variables already present in the computation. If no anticommutative prefix is defined then _Q_ is used as prefix.
 Examples
 > restart: with(Physics): with(Library):
 > GetAntiCommutativeSymbol(x);
 ${{\mathrm{_Q_}}}_{{1}}$ (107)
 > type(_lambda1, anticommutative);
 ${\mathrm{false}}$ (108)
 > GetAntiCommutativeSymbol([_lambda5], 2);
 ${{\mathrm{_Q_}}}_{{1}}{,}{{\mathrm{_Q_}}}_{{2}}$ (109)
 See Also

GetBasisContinuityInfo

 Calling Sequence
 Physics:-Library:-GetBasisContinuityInfo(A)
 Parameters
 A    : a Bra, Ket, or a name
 Description
 GetBasisContinuityInfo receives a Bra, a Ket, or a name, and returns the name itself (or, the first argument of the Bra or the Ket) when this name was previously set as a label for quantum continuous basis using Setup(quantumcontinuousbasis = {...}), indicating that indeed the input A is related to a quantum continuous basis. If A is not related to any quantum continuous basis already set, the GetBasisContinuityInfo returns the string "unknown".
 Examples
 > restart: with(Physics): with(Library):
 > Setup(quantumcontinuousbasis = A);
 $\left[{\mathrm{quantumcontinuousbasis}}{=}\left\{{A}\right\}\right]$ (110)
 > GetBasisContinuityInfo(A);
 $\left\{{A}\right\}$ (111)
 > GetBasisContinuityInfo(B);
 ${"unknown"}$ (112)
 > GetBasisContinuityInfo(Bra(A));
 $\left\{{A}\right\}$ (113)
 See Also

GetBasisDimension

 Calling Sequence
 Physics:-Library:-GetBasisDimension(A)
 Parameters
 A    : a Bra, Ket, or a name
 Description
 GetBasisDimension receives a Bra, a Ket, or a name, and returns an equation with the name itself (or, the first argument of the Bra or the Ket) in the left-hand side and the dimension of the basis of quantum states in the right-hand side, when this name in the left-hand side was previously set as a label for quantum basis of some dimension n using Setup(quantumbasisdimension = {A = n, ...}). If A is not related to any quantum continuous basis with dimension already set, the command returns the string "unknown".
 Examples
 > restart: with(Physics): with(Library):
 > Setup(quantumbasisdimension = {A = 2});
 $\left[{\mathrm{quantumbasisdimension}}{=}\left\{{A}{=}{2}\right\}\right]$ (114)
 > GetBasisDimension(A);
 $\left\{{A}{=}{2}\right\}$ (115)
 > GetBasisDimension(B);
 ${"unknown"}$ (116)
 > GetBasisDimension(Bra(A));
 $\left\{{A}{=}{2}\right\}$ (117)
 See Also

GetCommutativeSymbol

 Calling Sequence
 Physics:-Library:-GetCommutativeSymbol(x, n := 1)
 Parameters
 x  : any Maple object such that the commutative symbols returned are not already contained in x
 n  : optional, default value is 1, indicates how many commutative symbols are to be returned
 Description
 GetAntiCommutativeSymbol returns commutative symbols (variables of type symbol) that start with a capital letter, and taking into account the anticommutative and noncommutative prefixes of the moment, set using Setup(anticommutativeprefix) and Setup(noncommutativeprefix). By default, it returns 1; optionally returning as many as the number n passed as second argument. These symbol variables are not found in x, are not assigned, have no attributes that are previously set, are not local variables, and are not visually identical to any local variables found in x; they are also not visually equivalent to the variables used during calls to assuming. This command is thus a convenient way of getting variables of this type for internal computations within subroutines, which at the same time do not collide with the global variables already present in the computation.
 Examples
 > restart: with(Physics): with(Library):
 > Setup(noncommutativeprefix = Z, anticommutativeprefix = theta);
 $\left[{\mathrm{anticommutativeprefix}}{=}\left\{{\mathrm{\theta }}\right\}{,}{\mathrm{noncommutativeprefix}}{=}\left\{{Z}\right\}\right]$ (118)
 > GetCommutativeSymbol(x);
 ${\mathrm{F1}}$ (119)
 > GetCommutativeSymbol([F5]);
 ${\mathrm{F6}}$ (120)
 > Setup(additionally, noncommutativeprefix = F);
 $\left[{\mathrm{noncommutativeprefix}}{=}\left\{{F}{,}{Z}\right\}\right]$ (121)
 > GetCommutativeSymbol(x);
 ${\mathrm{A1}}$ (122)
 See Also

GetCoordinateSystem

 Calling Sequence
 Physics:-Library:-GetCoordinateSystem([X])
 Parameters
 [X]   : a list of spacetime coordinates of a system of coordinates previously defined with Setup(coordinatesystems = X) or with Coordinates
 Description
 GetCoordinateSystem searches among the previously defined systems of coordinates to find one that has the same coordinates found in [X], not necessarily with the same ordering. If it finds only one of such a system, it returns it, otherwise it returns FAIL.
 Examples
 > restart: with(Physics): with(Library):
 > Coordinates(Y = spherical);
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{Y=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\left\{{Y}\right\}$ (123)
 > GetCoordinateSystem([theta,phi,r,t]);
 $\left[{Y}\right]$ (124)
 See Also

GetCoordinatesAlias

 Calling Sequence
 Physics:-Library:-GetCoordinatesAlias(x)
 Parameters
 x : any variable of a system of spacetime coordinates previously set using Setup.
 Description
 GetCoordinatesAlias receives a coordinate and searches the previously defined systems of spacetime coordinates for a system containing that coordinate. If it finds none, it returns the empty set, {}, Otherwise, the set contains equations, where the left-hand side contains the sequence of coordinates (one of which is the given x), and the right-hand side is the label for this system used in an alias definition to refer to it.
 Examples
 > restart: with(Physics): with(Library):
 > Coordinates(Y = spherical);
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{Y=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\left\{{Y}\right\}$ (125)
 > GetCoordinatesAlias(phi);
 $\left\{{Y}{=}{Y}\right\}$ (126)
 See Also

GetDefineINFO

 Calling Sequence
 Physics:-Library:-GetDefineINFO(keyword)
 Parameters
 keyword : a string, one of the indices of the table of information Define:-INFO; that is, one of the strings returned by indices(Define:-INFO)
 ...     : other keywords
 Description
 GetDefineINFO(keyword, ...) gets the value of Define:-INFO[keyword, ...] without fully evaluating it, so as in eval(Define:-INFO[keyword, ...], 1). To see all the possible values of keyword, enter indices(Define:-INFO).
 Examples
 > restart: with(Physics): with(Library):
 > indices(Define:-INFO);
 $\left[{"tetradtensors"}\right]{,}\left[{"properties"}{,}{\mathrm{ElectromagneticFieldStrength}}\right]{,}\left[{"%PhysicsTensors"}\right]{,}\left[{"tetradnullvectors"}\right]{,}\left[{"properties"}{,}{\mathrm{\delta }}\right]{,}\left[{"properties"}{,}\mathbit{R}\right]{,}\left[{"properties"}{,}{G}\right]{,}\left[{"properties"}{,}{\mathrm{antisymmetric}}\right]{,}\left[{"properties"}{,}{{\mathbf{𝕎}}}^{{\mathrm{+}}}\right]{,}\left[{"properties"}{,}\mathrm{f__su3}\right]{,}\left[{"properties"}{,}{g}\right]{,}\left[{"threeplusonetensors"}\right]{,}\left[{"default_indices_used"}{,}{"su3indices"}\right]{,}\left[{"properties"}{,}{R}\right]{,}\left[{"properties"}{,}{G}\right]{,}\left[{"default_indices_used"}\right]{,}\left[{"properties"}{,}{\mathrm{ZFieldStrength}}\right]{,}\left[{"properties"}{,}{\mathrm{WPlusFieldStrength}}\right]{,}\left[{"default_indices_used"}{,}{"su3matrixindices"}\right]{,}\left[{"properties"}{,}{\mathrm{\eta }}\right]{,}\left[{"properties"}{,}{\mathrm{Τ}}\right]{,}\left[{"feynmandiagramstensors"}\right]{,}\left[{"properties"}{,}\mathbf{\Gamma }\right]{,}\left[{"standardmodeltensors"}\right]{,}\left[{"GeneralRelativityTensors"}\right]{,}\left[{"defined_%PhysicsTensors"}\right]{,}\left[{"history"}\right]{,}\left[{"properties"}{,}{\mathrm{\delta }}\right]{,}\left[{"properties"}{,}{\mathrm{\lambda }}\right]{,}\left[{"properties"}{,}{\mathbf{𝔽}}\right]{,}\left[{"tensors_in_internal_representation"}\right]{,}\left[{"properties"}{,}{R}\right]{,}\left[{"properties"}{,}{\mathrm{Christoffel}}\right]{,}\left[{"properties"}{,}{\mathrm{WFieldStrength}}\right]{,}\left[{"defined"}\right]{,}\left[{"cannotbeerased"}\right]{,}\left[{"properties"}{,}{\mathrm{lambda_}}\right]{,}\left[{"properties"}{,}{\mathbf{𝔾}}\right]{,}\left[{"properties"}{,}{\mathrm{FSU3}}\right]{,}\left[{"properties"}{,}{\mathrm{e_}}\right]{,}\left[{"properties"}{,}{{\mathbf{𝕎}}}^{{\mathrm{-}}}\right]{,}\left[{"properties"}{,}\mathbf{\gamma }\right]{,}\left[{"properties"}{,}{\mathrm{BFieldStrength}}\right]{,}\left[{"names"}\right]{,}\left[{"properties"}{,}{\mathrm{symmetric}}\right]{,}\left[{"minimizetensorcomponents"}\right]{,}\left[{"properties"}{,}{\mathrm{\Gamma }}\right]{,}\left[{"PhysicsTensors"}\right]{,}\left[{"properties"}{,}{\mathrm{WMinusFieldStrength}}\right]{,}\left[{"default_indices_used"}{,}{"su2matrixindices"}\right]{,}\left[{"indices"}\right]{,}\left[{"properties"}{,}{C}\right]{,}\left[{"linear_operators"}\right]{,}\left[{"properties"}{,}{\mathrm{\gamma }}\right]{,}\left[{"properties"}{,}\mathbit{R}\right]{,}\left[{"properties"}{,}{\mathrm{\gamma }}\right]{,}\left[{"properties"}{,}{C}\right]{,}\left[{"properties"}{,}{\mathrm{Τ}}\right]{,}\left[{"flipcharacterofindices"}\right]{,}\left[{"default_indices_used"}{,}{"spaceindices"}\right]{,}\left[{"PhysicsTensorNames"}\right]{,}\left[{"properties"}{,}{\mathrm{noncommutative}}\right]{,}\left[{"properties"}{,}{R}\right]{,}\left[{"properties"}{,}{g}\right]{,}\left[{"typeoftensorindices"}\right]{,}\left[{"properties"}{,}{\mathrm{GluonFieldStrength}}\right]{,}\left[{"properties"}{,}{\mathbf{𝔹}}\right]{,}\left[{"properties"}{,}{\mathbf{ℤ}}\right]{,}\left[{"properties"}{,}\mathbf{Κ}\right]{,}\left[{"functionality"}\right]{,}\left[{"default_indices_used"}{,}{"su2indices"}\right]{,}\left[{"properties"}{,}{\mathbf{𝕎}}\right]{,}\left[{"properties"}{,}{𝔢}\right]{,}\left[{"linear_tensor_operators"}\right]{,}\left[{"properties"}{,}{R}\right]{,}\left[{"properties"}{,}{\mathrm{eta_}}\right]{,}\left[{"properties"}{,}{\mathrm{\gamma }}\right]{,}\left[{"structure"}\right]$ (127)
 > GetDefineINFO("GeneralRelativityTensors");
 $\left\{{\mathrm{Lapse}}{,}{R}{,}{\mathrm{Ricci3}}{,}{\mathrm{Shift}}{,}{C}{,}{\mathrm{e_}}{,}{\mathrm{\gamma }}{,}{\mathrm{l_}}{,}{\mathrm{m_}}{,}{\mathrm{mb_}}{,}{\mathrm{n_}}{,}\mathbf{\alpha }{,}{R}{,}\mathbit{R}{,}{R}{,}\mathbf{\beta }{,}{C}{,}{𝔢}{,}\mathbf{\gamma }{,}{\mathrm{\gamma }}{,}{l}{,}{\mathrm{\lambda }}{,}{m}{,}\stackrel{{&conjugate0;}}{{m}}{,}{n}{,}{\mathrm{\Gamma }}{,}{\mathrm{Christoffel3}}{,}{G}{,}{R}{,}{\mathrm{Riemann3}}{,}{\mathrm{TimeVector}}{,}{\mathrm{gamma3_}}{,}{\mathrm{lambda_}}{,}{\mathrm{\Gamma }}{,}\mathbf{\Gamma }{,}{G}{,}\mathbit{R}{,}\mathbit{t}{,}{\mathrm{ExtrinsicCurvature}}{,}{\mathrm{UnitNormalVector}}{,}\mathbf{Κ}{,}\mathbit{n}\right\}$ (128)
 See Also

GetDimensionOfIndex

 Calling Sequence
 Physics:-Library:-GetDimensionOfIndex(idx)
 Parameters
 idx : an index, of space, spacetime, spinor, or gauge kind
 Description
 GetDimensionOfIndex gets the current dimension for the index idx as set using Setup. If idx is not an index of those kinds, GetDimensionOfIndex returns FAIL.
 Examples
 > restart: with(Physics): with(Library):
 > GetDimensionOfIndex(mu);
 ${4}$ (129)
 > GetDimensionOfIndex(j);
 ${\mathrm{FAIL}}$ (130)
 > Setup(spaceindices = lowercaselatin);
 $\left[{\mathrm{spaceindices}}{=}{\mathrm{lowercaselatin}}\right]$ (131)
 > GetDimensionOfIndex(j);
 ${3}$ (132)
 > Setup(dimension = 3);
 ${\mathbit{Warning, unable to define the Pauli sigma matrices \left(Psigma\right) as a tensor in a spacetime with dimension =}}{\mathbf{3}}{\mathbit{where the metric is not Euclidean. You can still refer to the Pauli matrices using}}{{\mathbit{Psigma}}}_{{\mathbit{x}}}{\mathbit{,}}{{\mathbit{Psigma}}}_{{\mathbit{y}}}{\mathbit{and}}{{\mathbit{Psigma}}}_{{\mathbit{z}}}$
 $\mathrm{The dimension and signature of the tensor space are set to}\left[3{,}{}{}\left(\mathrm{- - +}\right)\right]$
 $\left[{\mathrm{dimension}}{=}{3}\right]$ (133)
 > GetDimensionOfIndex(mu);
 ${3}$ (134)
 > GetDimensionOfIndex(j);
 ${2}$ (135)
 See Also

GetDimensionOfTypeOfIndex

 Calling Sequence
 Physics:-Library:-GetDimensionOfTypeOfIndex(t_idx, j := not given)
 Parameters
 t_idx : a type of index, one of spacetimeindex, spaceindex, tetradindex, spinorindex, genericindex, su2index, su3index, su2matrixindex, su3matrixindex.
 Description
 GetDimensionOfTypeOfIndex returns the dimension of the type of index t_idx. If this dimension is not defined, or if the type of index is not previously set using Setup, the command returns FAIL.
 Examples
 > restart: with(Physics): with(Library):
 > GetDimensionOfTypeOfIndex(spacetimeindex);
 ${4}$ (136)
 > GetDimensionOfTypeOfIndex(spaceindex);
 ${3}$ (137)
 See Also

GetDimensionRange

 Calling Sequence
 Physics:-Library:-GetDimensionRange(dim, continuous_basis, U)
 Parameters
 dim              : an integer or an algebraic expression, or a range of them
 continuous_basis : true or false
 U                : a label of a basis of quantum states, possibly anticommutative (fermionic states)
 Description
 GetDimensionRange returns a range to be used as a dimension range for the label U of quantum states. When dim is not a range, if continuous_basis = true, this dimension is the range dim..dim, otherwise, if U is anticommutative, the range from 0 to 1, else from 0 to dim-1. When dim is a range, if continuous_basis = false and the first operand of the range dim is half-integer, the range is from 0 to the second operand of dim minus that half integer, otherwise, the range is dim itself.
 Examples
 > restart: with(Physics): with(Library):
 > GetDimensionRange(2, true, U);
 ${-2}{..}{2}$ (138)
 > GetDimensionRange(2, false, U);
 ${0}{..}{1}$ (139)
 > Setup(anticommutativepre = Q, quiet):
 > GetDimensionRange(2, true, Q);
 ${-2}{..}{2}$ (140)
 > GetDimensionRange(2, false, Q);
 ${0}{..}{1}$ (141)
 > GetDimensionRange(1/2, true, Q);
 ${-}\frac{{1}}{{2}}{..}\frac{{1}}{{2}}$ (142)
 > GetDimensionRange(3/2, true, Q);
 ${-}\frac{{3}}{{2}}{..}\frac{{3}}{{2}}$ (143)
 > GetDimensionRange(1/2, false, Q);
 ${0}{..}\frac{{1}}{{2}}$ (144)
 > GetDimensionRange(3/2, false, Q);
 ${0}{..}{1}$ (145)
 See Also

GetExistingAnnihilationCreationOperator

 Calling Sequence
 Physics:-Library:-GetExistingAnnihilationCreationOperator(notation, fingerprint)
 Parameters
 notation    : one of implicit, explicit, or anything
 fingerprint : a list with an annihilation or creation internal Physics fingerprint; that is, a list with four elements, for example, as in ["annihilation", "label" = psi, "quantum_numbers" = [1, 2, 3], "boson"]
 Description
 GetExistingAnnihilationCreationOperator searches, among the annihilation and creation operators already set with Annihilation and Creation, for one that has the given fingerprint and got defined with the given notation.
 Examples