Introduction
Total Page:16
File Type:pdf, Size:1020Kb
Classroom Tips and Techniques: Tensor Calculus with the Differential Geometry Package Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft Introduction The Tensor subpackage of the DifferentialGeometry package supplants the now-deprecated tensor package in Maple. The tensor package made essential use of the also-deprecated linalg package, so although worksheets that used these deprecated packages still work, it is imperative to move to using the new formalisms in the Tensor package. This article is a "survivor's guide" for implementing tensor calculus in the new Tensor package. It explains the constructs in this package from the perspective of classical (i.e., indicial) tensor notation. The DifferentialGeometry package itself contains some 34 command but also six subpackages, themselves contributing to a total of some 184 commands. These subpackages, and a measure of their "size" are listed in Table 1. Subpackage Number of Commands Tensor 61 Tools 21 JetCalculus GroupActions 9 Library 4 LieAlgebras 33 Table 1 Subpackages in the DifferentialGeometry package The complexity of mastering the DifferentialGeometry package is further increased when subpackages such as GroupActions themselves have subpackages (MovingFrames). A comprehensive tutorial in the complete DifferentialGeometry package would require more than a textbook, so clearly, this is not our ambition here. Fortunately, the package itself contains two sets of useful tutorials, a comprehensive collection of Lessons, and a set of Tutorials. The Lessons worksheets provide a systematic approach to learning the commands in the DifferentialGeometry, Tensor, LieAlgebras and JetCalculus subpackages. Each lesson also contains a set of exercises that range in difficulty from simple computations to programming problems. Solutions are given. The tutorials present specialized applications of the DifferentialGeometry package. Our more modest goal for this article is to show how to enter covariant and contravariant tensors, compute their covariant derivatives, obtain the equations of parallel transport and geodesics, and compute the basic tensors of general relativity. Initializations > > > Declaring the Frame in DifferentialGeometry Before a vector or tensor can be entered, a frame must be declared by stating its variables and giving it a name. For example, to declare as the Cartesian space with variables and , execute > > The default behavior for DifferentialGeometry is that from this point onward, the prompt would be modified to display the frame name for as long as that frame were the active one. Thus, without our having suspended this default with the Preferences command in the Initializations section, the prompt following the DGsetup command would be the one shown in Table 2. R2 > Table 2 The default modification of the prompt We have elected to suspend this default behavior for three reasons. First, interactive editing of a worksheet can create a confusing display. If in a section where one frame name appears in all prompts, a new frame is defined, the subsequent prompts that show the earlier name do not change to show the new name. Only a "new" prompt will display the new frame name. The result is a worksheet with prompts showing different frame names where they might not be relevant. Such misplaced prompts have to be deleted manually if they are not to provide incorrect information. Second, these modified prompts are persistent - they cannot be removed by any Maple command. They have to be removed by deletion. (The Maple interface command that modifies prompts does not cascade the change through existing prompts. It only modifies new prompts.) Finally, if the commands are executed in Document Blocks, and not at prompts, there will be no visible prompt to modify. Thus, the modified prompt is a worksheet paradigm that does not carry through all of Maple usage. For all these reasons, we will not have frame names visible in our prompts. The Contravariant/Covariant Paradigms Anyone who had taken even a perfunctory dip into the waters of tensor calculus knows there are two words, covariant and contravariant, that must be faced. We will not be able to enter a tensor in the Tensor package without making the distinction between these two terms. Using the Einstein summation convention (repeated indices, one raised and one lowered, are summed), Table 3 defines contravariant and covariant vectors. Vector Type Basis Type Transformation Law Contravariant Tangents to coordinate curves Covariant Gradients (Normal to coordinate surfaces) Table 3 Contravariant and covariant vectors In the rightmost column of Table 3 uses the notation and for components expressed in the -coordinate system, but and for components in the -coordinate system. Texts also denote the new coordinate system bu the use of an overbar on the component, or a prime on the left side of the variable. The components and are the contravariant and covariant components, respectively, of the vector V. The basis vectors and are reciprocal, so that . Thus, an orthonormal basis is self-reciprocal. That is why the distinction between contravariant and covariant basis does not matter in Cartesian spaces. If is the mapping from to via functions of the form , then the gradient vectors are the rows of the Jacobian matrix , where the upper index is interpreted as a row index, and the lower index , as a column index. If is the mapping from to via functions of the form , then the tangent vectors are the columns of the Jacobian matrix . To facilitate the implementation of the contravariant transformation law, writing the components as a column vector v means the sums with the Jacobian matrix are along a row and across the columns of the matrix. Hence, the matrix product implements the contravariant transformation. Writing the components as the row vector w means the sums with the Jacobian matrix are down a column but across the rows. Hence, the matrix product implements the covariant transformation. This inherent distinction between tangent bases and normal bases induces the distinction between contravariant and covariant. Using column and row vectors to express this difference is a convenient visual device in classical tensor calculus. The Tensor as a Multilinear Object If is a vector space, say, with basis , then a rank-two tensor is a multilinear object from , the direct product of with itself, having doubly-indexed basis objects . The tensor is actually the object linear in both indices. Of course, the are the contravariant components of the tensor; and just as for vectors, there would be the equivalent covariant components, . There are even mixed tensors that transform contravariantly in one index but covariantly in another. In actual practice, one manipulates just the components of the tensor, and almost never explicitly exhibits the basis objects. However, in the DifferentialGeometry package, vectors and tensors require an explicit use of the basis objects. Bases and Their Duals The basis for could be entered as > > or could be extracted from Maple with the DGinfo command from the Tools package. > > (To type the underscore in math (2D) mode, press the escape character (\) first. Alternatively, enter such expressions in text (linear, 1D) mode and convert to math mode via the Context Menu.) The reciprocal (or dual) basis is then > > or > > In actual fact, is considered a differential form, more in keeping with the modern approach to differential geometry. Representing Vectors as DifferentialGeometry Objects In the DifferentialGeometry package, the contravariant vector whose components are is given by > > or by > > The evalDG and the DGzip commands are two of the simpler ways to create an object whose data structure is intrinsic to the DifferentialGeometry package. When using the evalDG command, the asterisk is the explicit multiplication operator. If this vector had been entered in math mode, the echo of the asterisk would be a centered dot. The alternative to the asterisk would be the space. The covariant vector whose components are is entered as > > or as > > There does not seem to be a simple way to represent a vector as a column or row vector. The Tools subpackage provides the DGinfo command with which the components of a vector can be extracted. Its use is illustrated by > > or by > > Representing Tensors as DifferentialGeometry Objects A rank-two contravariant tensor would be entered as > > The construct corresponds to the dyadic basis element , etc. A rank-two covariant tensor would be entered as > > The construct corresponds to the dyadic basis element , etc. The components of a tensor can be recovered with the DGinfo command > > or with the convert command. > > The components of the rank-two tensor are often represented as the entries of a matrix. If a matrix is used for such a representation, it is possible to convert the matrix to a DifferentialGeometry tensor. > > Contraction of Indices Given two tensors of conformable dimensions, say and , forming the sum of products is the operation contraction of indices. Recall that the Einstein summation convention indicates a sum on the same index when it appears once raised and once lowered. This operation, implemented in the Tensor package with the command ContractIndices, is illustrated for the two tensors > > from the previous section. To simplify data entry, we rename the first as T and the second, as V. > > The four possible contractions that result in a rank-two tensor are given in Table 4, where their components are displayed as elements of matrices. Table 4 Four rank-two tensors formed by contraction of and Careful inspection of the four tensors in Table 4 (see especially the rightmost column) shows that they are all different. The Metric Tensor The geometry of a manifold is first captured in the covariant metric tensor or its contravariant counterpart . There is no "calculus" in tensor calculus without first obtaining this essential tensor. Hence, it is imperative that there be efficient ways to obtain this tensor. Several of these techniques will be illustrated for the Cartesian plane on which polar coordinates have been imposed.