Creating New Notations in Mathematica
Mathematica understands most standard mathematical notations such as integrals, sums, products, etc. But in many mathematical fields, particularly pure mathematics, a variety of additional specific notations are used. The programmability of input and output in Mathematica makes it possible to introduce these kinds of notations, and to integrate them into your work.
The Notation package provides a variety of utilities allowing you to flexibly and extensively create and add your own notations to a Mathematica session. The full documentation for the package can be found here. Without the Notation package creating and defining your own notations can be laborious and problematic.
A Simple Example
Notation for the Wigner 3j Symbol
The Wigner 3j Symbol is used in the coupling of angular momenta in quantum mechanics. The 3j symbol is a more symmetric form of a corresponding Clebsch-Gordon coefficient. This section creates a notation for 3j symbols and illustrates the use of this notation with a few simple examples.
This notation consists of a 32 GridBox with round braces subscripted by 3j. There are many other notational forms that could have been chosen including ones with hidden TagBoxes.
This notation for the Wigner 3j symbol can now be freely used in calculations, greatly increasing readability in certain cases. Furthermore, for ease of input we can add an input-alias for the Wigner 3j symbol to the current notebook.
A blank template of a Wigner 3j symbol can now be created by typing 3j in any input cell.
The following is a short example illustrating an identity involving the Wigner 3j symbol.
There are many ways to represent spherical tensors. The following is a simple, though not general approach.
Bras, Kets and Operators in Quantum Mechanics
The following illustrates a notational system for the Dirac bra-ket notation used in quantum mechanics.
Modify Parenthesize and FullForm
The following code is used to fix the formatting of tag boxes and full form. This correction is not central to the points being illustrated in this notebook, but is necessary for correct formatting.
Declare the notation for Operators, Bras and Kets
The following notations for bras, kets, and brakets depend on specific styles that have been added to the style sheet of this notebook. These styles are necessary to give the bras, kets and brakets the correct visual and structural properties.
Entering Bras and Kets
To enter complex templates consisting of tag boxes and other underlying structures it is desirable to add input aliases to the current notebook. Creating input aliases for bras and kets is a perfect illustration of this.
What follows are some toy definitions and calculations to illustrate the functionality of the notation defined for Bras and Kets.
This subsection contains some simple definitions and calculations to illustrate angular momentum and raising and lowering operators in quantum mechanics.
To progress further we must add some basic properties to our NonCommutativeTimes. The following is a crude implementation of multiple linearity over addition and multiple linearity over constants, however it is sufficient for the purpose of illustration. The following rules state that constants can be factored out of a NonCommutativeTimes expression, and that NonCommutativeTimes distributes over addition.
In angular momentum theory the operator has the eigenvalue on eigenstates of angular momentum. It is usually a textbook calculation to show that the operator can be decomposed into operators involving , and . Let us verify that this is the case.
For those that know enough about quantized angular momentum it is evident that the calculation above shows that is equivalent to .
Let us extend our implementation of angular momentum a little further and note that the eigenstates of angular momentum are orthogonal.
We can now evaluate the decomposition of between different eigenstates of angular momentum.
Finally, for illustration let us calculate an expression involving products of operators between eigenstates.
Category Theory Diagrams
Some of the most complicated notation found anywhere occurs in category theory. This section gives some simple examples of how category theory diagrams can be set up as notations in Mathematica. The following example comes from the section on natural transformations in Birkhoff and MacLane's Algebra.
A look at the rules