Processing math: 100%

Table of Contents

Setting up matrix objects


Simplest case

Matrices are tensors with a subset of indices marked as matrix indices. These indices have nonmetric types, which means that raising and lowering are forbidden. The typical examples of matrix objects are Dirac γμ-matrices, SU(N) matrices, spinors etc.

In Redberry for example to define G_m as γ-matrix one can do as follows:

defineMatrices 'G_a', Matrix1.matrix
Here the first argument is matrix itself, while the second is type of matrix (see next subsection). With this line Redberry will treat all specified objects as matrices and will automatically insert additional matrix indices. For example, to input product γaγb one can just input it as is:
println 'G_a*G_b'.t
   > G_a*G_b
To input a trace Tr[γaγb] one can proceed in the same way:
println 'Tr[G_a*G_b]'.t
   > Tr[G_a*G_b]
Internally, Redberry inserts special matrix indices for matrix object when parsing strings. These matrix indices are not printed by default; in order to print them one should explicitly specify OutputFormat:
println 'G_a*G_b'.t.toString(OutputFormat.Redberry)
   > G_a^a'_b'*G_b^b'_c'
println 'Tr[G_a*G_b]'.t.toString(OutputFormat.Redberry)
   > G_a^a'_b'*G_b^b'_a'
If one use the default output format then Redberry will print matrices in that order in which they appear in the inputting string.

Details

The rules of matrix multiplication can be formulated as follows. Suppose we have two tensors Aμu1unul1lnlandBν˜u1˜uku˜l1˜lkl. where ui and li denotes matrix upper and matrix lower indices respectively, and μ and ν denotes a whole subset of other indices. Then the product Tμν=AμBν has the following form: Tμνu1unu˜unl+1˜uku˜l1˜lkl=Aμu1unuc1cnlBνc1cnl˜unl+1˜uku˜l1˜lklifnlku,Tμνu1unulku+1lnl˜l1˜lkl=Aμu1unuc1ckulku+1lnlBνc1cku˜l1˜lklifnl>ku,

These definitions becomes especially clear in a particular cases. Consider, for example, three matrices: matrix vi with one upper matrix index (vector), matrix γμij with one upper and one lower index, and matrix ˉvi with one lower matrix index (covector). Then using the above rules, one can obtain the well-known expressions: Tμν=γμγνTμνij=γμicγνcj(matrix)Tμ=γμvTμνi=γμicvc(vector)Tμ=ˉvγμTμνi=ˉvcγμci(covector)Tμν=ˉvγμγνvTμν=ˉviγμicγνcjvj(scalar)

To specify Redberry what tensors should be considered as matrices and allow it to automatically insert additional matrix indices according to the formulated rules one can do:

defineMatrices 'G_a', 'G', Matrix1.matrix,
          'v', Matrix1.vector, 'cv', Matrix1.covector
Method defineMatrices takes a set of string representations of matrices, where the corresponding matrix signature (type and number of upper/lower matrix indices) is specified after each set. By default, Redberry provides four predefined nonmetric types: Matrix1 (Latin lower case letters with strokes), Matrix2 (Latin upper case letters with strokes), Matrix3 (Greek lower case letters with strokes), Matrix4 (Greek upper case letters with strokes). The number of upper and lower indices of matrix type is specified using the corresponding property: vector means one upper index, covector means one lower index, matrix means one upper and one lower index.

Let us consider different example combinations of these matrices and print matrix indices explicitly:

CC.setDefaultOutputFormat(OutputFormat.Redberry)
println 'G_a*G_b'.t
   > G_a^a'_b'*G_b^b'_c'
println 'G_a*v'.t
   > G_a^a'_b'*v^b'
println 'cv*G_a'.t
   > cv_a'*G_a^a'_b'
println 'G*G_a = G*v*cv*G_a + f_a'.t
   > G^a'_c'*G_a^c'_b'= G^a'_c'*v^c'*cv_d'*G_a^d'_b'+f_a*d^a'_b'
   > println 'cv*G_a*G_b*v + g_ab'.t
   > v_a'*G_a^a'_b'*v^b' + g_ab
println 'Tr[G_a*G_b + n_b*G_a] + n_a*n_b'.t
   > G_a^a'_b'*G_b^b'_a' + n_b*G_a^a'_a' + n_a*n_b
println 'Tr[G_a*G_b + n_b*G_a + n_a*n_b]'.t
   > G_a^a'_b'*G_b^b'_a' + n_b*G_a^a'_a' + n_a*n_b*d^a'_a'
As we see from the lines 7 and 10, Redberry inserts similar free matrix indices for the l.h.s. and r.h.s. of the expression. If sum contains both matrix (with non empty free matrix indices) and non-matrix expressions (without matrix indices), then latter will be multiplied by the identity matrices, i.e. Kronecker deltas.

In order to define a matrix object of a more general form, i.e. with p upper and q lower indices, one can do

defineMatrices 'M_\\mu', Matrix1.tensor(2, 3)
                 
println 'G*M_\\alpha'.t.toString(OutputFormat.Redberry)
   > G^{a'}_{f'}*M_{\alpha}^{f'b'}_{c'd'e'}

Syntax for traces of matrices shown in the lines 9 and 10. By default the trace is taken with respect to all matrix indices, but if some expression is a matrix with respect to several indices types, then it is possible to specify particular types of indices for which the trace should be taken:

defineMatrices 'A, B', Matrix1.matrix, Matrix2.matrix
                 
println 'Tr[A*B]'.t.toString(OutputFormat.Redberry)
   > A^{a'}_{b'}^{A'}_{B'}*B^{b'}_{a'}^{B'}_{A'}
println 'Tr[A*B, Matrix1]'.t.toString(OutputFormat.Redberry)
   > A^{a'}_{b'}^{A'}_{C'}*B^{b'}_{a'}^{C'}_{B'}

See also