Informatica 36 (2012) 91-102 91
Physics Markup Approaches Based on Geometric Algebra Representations
Kuo-pao Yang and Wendy Zhang
Computer Science & Industrial Technology Department, Southeastern Louisiana University, USA E-mail: {kyang, wzhang}@selu.edu, http://www2.selu.edu/Academics/Faculty/{kyang, wzhang}
Frederick Petry
Naval Research Laboratory, Stennis Space Center, USA http://www7440.nrlssc.navy.mil
Keywords: geometric algebra, markup languages, MathML, OpenMath, content dictionary Received: January 20, 2012
This paper presents an approach for a physics markup language using Geometric Algebra which is a unifying language for the mathematics of physics and is useful in an exceptionally wide range of physics problems, particularly those that involve rotations, phases or imaginary numbers. MathML and OpenMath are discussed as potential ways to implement a markup system. Using OpenMath, content dictionaries for Geometric Algebra were developed and used to illustrate the markup of the physics of the rotor which is used in 3-dimansional rotations.
Povzetek: Članek predstavi na XMLju temelječ jezik za zapisovanje fizikalnih izrazov.
1 Introduction
In large environmental models, a significant issue is how to effectively integrate the physics used in diverse system components such as found in oceanographic and atmospheric forecasting. A major problem for component integration lies in the implicit assumptions made about the semantics of the physics being used. Usually in such systems the semantics of the physics is only "roughly" described and certainly not in any formal manner. Computational systems lack the ability to use context to understand the semantics of a mathematical denotation. If we wish such meanings to be reliably communicated between such systems, we must mark up the document to provide extra semantic information. A Physics Markup Language (PML) could allow these components to be formally described, tested and used to aid in integration [7], [37].
As physics must be represented mathematically there is a question as to how to consistently deal with various physics concepts. First one must consider the specific mathematical concepts necessary in expressing physical semantics so that they may be handled separately. This separation allows experts, specializing in representing mathematical semantics, to aid in the development of PML by expanding mathematical semantic representations, a pre-requisite in expressing a large body of physical models. A mathematical approach that is able to encompass much of this in a uniform fashion is called Geometric Algebra (GA). GA [35] is a unifying language for the mathematics of physics and is useful in an exceptionally wide range of physics problems, particularly those that involve rotations, phases or
imaginary numbers. Geometric Algebra more compactly and intuitively describes classical mechanics, quantum mechanics, electromagnetic theory and relativity than standard methods do [6], [23]. Our research uses Geometric Algebra to provide a uniform representation of physics concepts.
In order to effectively utilize Geometric Algebra, we need to evaluate which mark-up language to use, as the World Wide Web Consortium (W3C) has proposed a large number of standards for these [36]. Mathematical Markup Language (MathML) [25] is an Extensible Markup Language (XML) application for describing mathematical notation and capturing both its structure and content. MathML deals principally with the presentation of mathematical objects. MathML can be used to encode both mathematical notation and mathematical content. About thirty-eight of the MathML tags describe abstract notational structures, while about one hundred and seventy provide a way of unambiguously specifying the intended meaning of an expression [3]. MathML aims at integrating mathematical formulae into web documents but the semantic contents of mathematical formulae are limited.
OpenMath [30] is a standard aimed at supporting a semantically rich interchange of mathematics among varied computational software tools such as computer algebra systems, theorem provers, and tools for visualizing or editing mathematical text [4]. Open Mathematical Documents (OMDoc) [29] is a semantic markup format for mathematical documents that we use for the Physics Markup Language. OMDoc is used for
92 Informatica 36 (2012) 91-102
K-p. Yang et al.
mathematical knowledge representation with numerous applications such as creation of customized modules for e-learning, data exchange between different theorem provers, web services, and more. This research focuses on building Content Dictionaries in OpenMath [20] format for Geometric Algebra [21], [38]. Content Dictionaries for Geometric Algebra have not been previously created to interpret semantics of documentations.
2 Background 2.1 Markup Languages
A markup language is a system for annotating a document for processing, defining, and presenting text syntactically [3]. Hyper Text Markup Language (HTML) is a widely used webpage markup language with predefined structural markers for communicating presentational semantics [24]. These HTML tags markup the document in order to denote the presentation specifications for text and other data. An example of an HTML tag is '
' to indicate the heading beginning for a document and '' to indicate the end of the heading.
XML has become as important as HTML for structuring, storing, and transporting information, extensively used in representing arbitrary data structures [13]. XML provides strong support with simplicity, while exclusively regarding the data's meaning, instead of how the data is displayed. Similarly to HTML, XML is a set of standardized rules for encoding documents with structural markers, known as XML tags. Unlike HTML, XML tags do not have predefined semantics, permitting the author to establish unique and specific XML tags and document structure. Commonly applied together, HTML formats and displays data, while XML stores and transports.
Markup languages based on XML have been developed for a number of specific areas. The Chemical Markup Language (CML) is an approach to supporting interoperable capabilities for a wide variety of chemical concepts such as molecular information, chemical reactions, spectra and analytical data and other information [27], [28]. In the area of biology the Systems Biology Markup Language (SBML) can represent models of biological processes such as metabolic networks, cell-signaling pathways and many others [14], [19]. A Geometry Description Markup Language (GDML) is an XML structured language for describing detector geometries for physics experimental configurations [5]. As it based on pure XML it can be useful for geometry interchange among different applications. In this paper we are concerned with the development of an XML based markup language for the semantics of physics (PML).
Now we discuss MathML and OpenMath as existing approaches that are used to represent mathematics concepts and can be used a basis for PML. MathML, illustrating mathematical notations and capturing their
structures and contents, enables one to display, manipulate, and share mathematical expressions over the web [26], [32]. MathML expressions can be evaluated in computer mathematical systems, rendered in web browsers, edited in word processors, and sent to printers. The XML-based MathML language consists of presentation markups and content markups. The presentation elements, depicting mathematical notations, are used to visually display. The content elements, describing the structures of mathematical expressions, explain what the mathematics means.
The mathematical expression (X2 + 3X - 4) shown in Figure 1 is implemented in MathML markup language. The presentation element tags, , , , , and , help lay out the mathematical expression. The entity reference, "⁢" indicates it is invisible and "3" and "X" are multiplied. Giving additional information about the meaning of the equation is useful in creating complex mathematical expressions and also in evaluating the markup of computer algebra system. The XSLT stylesheet, "mathml.xsl," transforms the XML-based implementation into presentation markups and then displays in a Firefox web browser shown in Figure 2.
A Simple Quadratic Polynomial
Figure 1: MathML for a Mathematical Expression (X2 + 3X - 4).
OpenMath, a general representation XML-based language for communicating mathematical objects, is about semantic definitions and is used to complement MathML, which determines how expressions are elegantly rendered [10]. OpenMath is an emerging standard for representing mathematical objects with their semantics, allowing them to be exchanged between computer programs, stored in databases, or published on the World Wide Web. The first OpenMath standard [4] encoded in an XML-based markup language was released in 2000. OpenMath consists of the definition of OpenMath Objects, abstract data types for describing the logical structures of mathematical formulae, and the
PHYSICS MARKUP APPROACHES BASED ON.
Informatica 36 (2012) 91-102 93
definition of OpenMath Content Dictionaries, collections of symbol names for mathematical concepts. OpenMath provides XML encodings that meet these requirements to describe the logical structures, and a set of specific Content Dictionaries [9], [20] for some areas of mathematics, in particular covering the K-14 education fragment [22].
Figure 2: Displaying the MathML Presentation (X2 + 3X - 4) in Mozilla Firefox.
While the original designers were mainly developers of computer algebra systems, it is now attracting interest from other areas of scientific computation and from many publishers of electronic documents with a significant mathematical content [4]. OpenMath is solely concerned with mathematical objects' semantic meaning or content.
OpenMath Content Dictionaries can be embedded and referenced in the content of MathML to define the meaning of mathematical formulae. Strict Content MathML is designed to be an XML encoding of OpenMath Objects. Formal semantics of mathematical expressions in MathML [20] will be fully supported in terms of OpenMath Content Dictionaries. Several applications based on OMDoc were developed in recent years [18], [34], [37].
2.2 Geometric Algebra
Geometric Algebra is a consistent computational framework to define geometric primitives and their relationships. This algebraic approach contains geometric operators and permits specification of constructions in a coordinate-free manner. Geometric Algebra gives a geometric extension of the real number system to provide a complete algebraic representation of geometric notations of direction and magnitude. Geometric Algebra provides for a mechanism linking magnitudes and numbers and lends themselves neatly to the representation of physical problems and of reality as we know it. The use of the geometric algebra can provide a unified language for problems in fields such as physics and engineering. GA is often referred to as a unified mathematical language for physics and engineering in the 21st century [15]. Current applications of Geometric Algebra include computer vision, biomechanics and robotics, and distributed data representations [11], [31]. In mathematical physics, a Geometric Algebra is a multilinear algebra described technically as a Clifford algebra over a real vector space equipped with a non-degenerate quadratic form.
The basics concepts leading to the development of geometric algebra occurred during the late 1800's [16] Geometric algebra is a Clifford algebra which has been
used with great success in the modeling of a wide variety of physical phenomena. Clifford algebra is considered a more general algebraic framework than geometric algebra.
However the introduction of the standard Gibbs vector calculus, although having certain limitations, became the major formalism used. One issue addressed by geometric algebra is the limitation of the vector cross product which is only valid in 3 dimensions. The outer product of two vectors, a, b, denoted by a a b, replaces it and is termed a bivector. A bivector extended by a third vector, (a a b) a c, is a directed volume element called a trivector. The outer product actually works in all dimensions.
The structure of geometric algebra is based on k-blades, where k is called the grade and refers to the dimension of the subspace the blade spans. Vectors are 1-blades bivectors, 2-blades, trivectors, 3-blades and similarly in higher dimensional spaces. A key insight of Clifford was the introduction of a new product, geometric product, ®, combining the inner or dot product and the outer product:
a ® b = a ® b + a ® b
Since the other products can be expressed in terms of the single geometric product, it can then enable the unification of formalisms across several areas.
3 Content Dictionaries for Geometric Algebra
3.1 Content Dictionaries in Open Math
Content Dictionaries are used to assign semantics to all symbols used in the OpenMath objects. They define the symbols used to represent concepts arising in a particular area of mathematics. The Content Dictionaries represent the actual common knowledge among OpenMath applications. These provide the "meaning" of objects independently of the application. The application receiving the object may then recognize whether or not, according to the semantics of the symbols defined in the CDs, the object can be transformed to the corresponding internal representation used by the application [1].
A Content Dictionary has been designed to hold two types of information, a header followed by a number of CD Definitions. Each definition is placed inside of the CDDefinition element. It consists of a description, the Commented Mathematical Properties (CMP), and the Formal Mathematical Properties (FMP). A Content Dictionary head consists of the following pieces of information:
1. A CDname gives the name of the Content Dictionary
2. A description of the Content Dictionary
3. A revision date, the date of the last change to the Content Dictionary (Dates should be stored in the ISO-compliant format YYYY-MM-DD, e.g. 1966-02-03, and a review date, a date until
94 Informática 36 (2012) 91-102
K-p. Yang et al.
which the content dictionary is guaranteed to remain unchanged)
4. A version number which consists of a major and minor part
5. A status of CD
6. A CD base which, when combined with the CD name, forms a unique identifier for the Content Dictionary. It may or may not refer to an actual location from which it can be retrieved
7. CDURL should be a valid URL where the source file for the Content Dictionary encoding can be found
8. CDComment which can be used in the Content Dictionary header to report the author of the Content Dictionary and to log change information
A CD Definition contains information restricted to a particular symbol definition. This includes a name, a description in natural language, commented and formal properties satisfied by this symbol, and examples of the use of this symbol. A symbol definition consists of the following pieces of information:
1. A mandatory name for the symbol, a mandatory description of the symbol, which can be as formal or informal as the author likes, and an optional role.
2. Zero or more commented mathematical properties which are mathematical properties of the symbol expressed in a mechanism other than OpenMath and zero or more formal mathematical properties which are mathematical properties of the symbol expressed in OpenMath. It is common for commented and formal mathematical properties to be introduced in pairs, with the former describing the latter.
3. A Formal Mathematical Property may be given an optional kind attribute. An author of a Content Dictionary may use this to indicate whether, for example, the property provides an algorithm for evaluation of the concept it is associated with.
4. Zero or more examples which are intended to demonstrate the use of the symbol within an OpenMath object.
3.2 Content Dictionaries in Open Math
This section gives an example of the inner product using OpenMath CD shown in Figure 3.
A. Head of the CD
The CD header contains information pertinent to the whole CD. This includes the name, a description, a date when the CD will next be reviewed, the status of the CD (official, experimental, private, obsolete), and an optional list of CDs on which it depends. The CDName here gives the name of the Content Dictionary as GA-Products.
Author: Joseph B. Collins and Fred Petry (2009), Naval Research Laboratory. Copyright Notice: This is a work of the U.S. Government and is not subject to copyright protection in the United States. Foreign copyrights may apply. ga_product1http://www.openmath.org/cd
http://www.openmath.org/
cd/ga_product1.ocd 2 009-07-18experimental2009-07-1811
This content dictionary defines the fundamental products of Geometric Algebra (GA)
such as inner product, outer product, geometric product, and scalar product.
This CD also presents a set of axioms for GA associated with the products.
Figure 3: CD Head of GA_Product.
B. CD definition
The CD in the Appendix gives the definition of inner-product in GA. It defines the name as inner-product, role of inner-product as application, and the commented and formal mathematical property of inner-product. For the purposes of use of the inner-product with GAs, we assume a version of a linear algebra CD for which the vector-selector has the capability to select the blade. This means the inner-product can map two blades to a blade. Formal properties are expressed as an XML encoded OpenMath object, whereas commented properties are expressed in natural language. Scalable Vector Graphics (SVG) is a family of specifications of an XML-based file format for describing two-dimensional vector graphics [32]. To better represent the geometric feature of inner-product, instead of using XML text to give examples of the enclosing symbol, a SVG file is used to give graphic features as examples.
C. Signature Dictionary
A Small Type System, called STS, has been designed to give semi-formal signatures to OpenMath
PHYSICS MARKUP APPROACHES BASED ON.
Informatica 36 (2012) 91-102 95
symbols [8]. Using the same mechanism, the following example shows how data type in GA systems can be employed to assign types to OpenMath symbols. The following is the STS of inner_product shown in Figure 4.
D. Display on the Web
The XML-base CD implementation can be transformed by OpenMath XSLT stylesheets into presentation markups and can be displayed in the Firefox web browser. Figure 5 shows the inner_product Content Dictionary in Firefox with hyper links and graphics.
Figure 4: Small Type System of Inner_Product (ga_product.sts).
Notice how the elements of each do not directly align. The 'inner_product' CD components were not a straightforward integration from the given GA description. A systematic methodology needed to be constructed to allow GA elements to be transformed into CDs. Once this transformation is complete the GA elements can be provided with a method for standardizing their semantics. By ascertaining an extensive knowledge of GA elements and CD components, a one-to-one mapping was established enabling the required transformations.
The symbol name developed for the inner product was logically formed by simply substituting '_' for the space. Supplemental information regarding the inner product's role was given as 'application' to further define how the GA element acts. 'Application' was decided upon since the inner product is applied upon two n-dimensional vectors. The description for 'inner_product' was obtained through various resources including, but not limited to the papers: [12], [16], [17]. By gathering a comprehensive understanding of the GA element inner_ product from these resources, a concise and basic definition was composed. This enabled us to develop the Commented Mathematical Property (CMP) by expressing the given property for inner product Ar-Bs = (r-s) in plain text, correctly communicating the property's meaning. The Formal Mathematical Property was constructed by representing the given property, previously expressed within the CMP, in MathML encoding. The image presented in the example for the 'inner_product' was also selected after reviewing several resources, and chosen for its proper communication of the inner product's semantics in a simple and clear
manner, to even further enhance the understanding of the meaning by the scientists. Lastly, a STS signature file was developed and linked for the 'inner product', showing data types within the GA CDs and assigning semi-formal signatures to the OpenMath object, inner_product. Figure 4 shows the STS of inner_product.
inner_product
Eoli
apfslicafeoli j V l ^i'.rfjf ■:■ l r: >T I
the generalisation ofthe scalar product, defined in-iS^E1 l±nalj££\l„ cli'.T-'' 11i ^ll'■/' 111 l tit 1 v i/31 ' X1 it
'iy.^.-.^i' f:.' ■:.■ 1.11s : d^^ot^tliCs-^Ji iratef.
The iiiiiei iOt '-^LlLiri t iL:- J'.t-U .I'^/.A^iiii»'.
' l ,!T
. F LTTi} T'.'T.-iLh n':t'lT^-J Mi Irjl pT J M ^r^Vl'j-
l^ir" any li%'n±o.^erierrn_i!tr.7e ct'J'i^ grade
wrH^l- iilf+1 J- .'1'%-r :■ Ell-i» '¿v.lll
lower the grade :t;: 'Tr' i± ffi. l:: isft and Cr'
jr^'. .'Tit rr-ji;1r pi.': 'P?.: t T-V
xml prefix math ml
) = (>1,- CB) JJ_.)r~ ■
Example:
The inner productijS^&o vectors^ and b, denoted by a ■ b, projects.a onto b resulting in theys cala^^iSgnitude of the projecti^ii Relative to b's magnitude.
Scalable V i:i:I'^i Graphics (SVG):
Signatures
Figure 5: Inner_Product Content Dictionary in Firefox.
The 'inner_product' is expressed as a specialized form of the 'geometric product', Ar-Bs = (r-s), above. Currently OpenMath does not contain the GA element 'geometric product', standardizing the semantics. Due to this fact and that CDs must be self-contained, the 'geometric product' was defined within the same CD as 'inner_product' and denoted '®'. This only further exemplifies and supports the desire for standardizing GA semantics in an effort to avoid such notational differences, as seen above in expressing the 'geometric product'.
Only through a collection of various resources lending to a comprehensive understanding of GA element components and CD components, was a correlation made identifying the required mapping from GA elements to CDs. This mapping, which was previously explored for the 'inner_product' in the example above, becomes the generalized translation approach for all GA elements into OpenMath CDs. This approach was done for several types of GA elements, of which four CDs were produced for the areas of GA Basics, GA Products, GA Spaces, and GA Multivectors. A total of twenty-nine terms were defined within the CDs, all with enabled links and embedded images, verifying that the defined OpenMath mapping between CDs and GA elements were reasonably effective in
96 Informática 36 (2012) 91-102
K-p. Yang et al.
standardizing GA semantics, even though human reasoning was necessary.
3.3 Representation of Content Dictionaries
This section gives an example of the inner product using OpenMath CD. Content Dictionaries for Geometric Algebra are established and added into OpenMath library. For example, a comprehensive set of basic axioms for GA in terms of the fundamental geometric products such as inner, outer, geometric, and scalar products is implemented in OpenMath format. The developed XML-based Content Dictionary (ga_product1.ocd) for GA products shown in Figure 6.
ga_product1geometric_product
For any multivectors A, B, and C, geometric product is associative. ...
... inner_product .
outer_product .
scalar_product.
Figure 6: Content Dictionary for Geometric Algebra Products (ga_product1.ocd).
Knowledge of GA is placed inside CDDefinition element of OpenMath. The symbol elements, geometric product for instance, are added to introduce concepts. For the geometric product, one the formal mathematical properties, defining logical laws of the GA theory, is written in prefix notation and is associative: (A ® B) ® C = A ® (B ® C). The XSLT style sheet (ga_product1.xsl)
for GA products describes how presentation markups display in web browsers as follows:
⊗
To display infix form, the OpenMath symbol, geometric_product, in Content Dictionary (ga_product1.ocd) calls the infix stylesheet template. The MathML presentation element tag, , helps layout ® or x2297 in hexadecimal.
The Content Dictionary for GA products (ga_product1.ocd), using its stylesheet (ga_product1.xsl) and OpenMath stylesheets, is transformed into XHTML format (ga_product1.xhtml) by Apache Ant, a Java-based build tool. This Content Dictionary for GA products displayed in Firefox browser shown in Figure 7. Each Formal Mathematical Property (FMP) has three toggle switch buttons to display XML code, prefix form, and MathML presentation. Each content dictionary is linked to its signature file.
The new stylesheets of GA enable one to write external references and vector graphics in OpenMath Content Dictionary (OCD) files after modifying the original stylesheets of OpenMath. Foreign Objects are containers for non-OpenMath structures according to the OpenMath 2.0 standard. Content Dictionaries for Geometric Algebra should allow us to enable graphics using the OMFOREIGN tag of OpenMath. However Scalable Vector Graphics could not be successfully implemented based on the original stylesheets of OpenMath. To make external reference in XHML file, it is required to write tags in OCD file, for example:
Geometric Algebra
This external link, Geometric Algebra, is enabled in web browser after transferring this OCD file into XHTML file.
Developers of Content Dictionaries can write in Scalable Vector Graphics [2], an open XML- based standard that has been under the development of the World Wide Web Consortium since 1999. It is required to write