Redberry is an open source computer algebra system designed for algebraic manipulations with tensors. Redberry is a computer algebra system which considers both tensors and indexless expressions in a common way.

Key features:
  • Programming language with internal support of symbolic algebra
  • Tensor symmetries, multiple index types, dummy indices handling, $\LaTeX$-style I/O, mappings of tensor indices
  • A wide range of tensor-specific transformations and simplification routines
  • Tools for calculations in High Energy Physics: Feynman diagrams and one-loop counterterms
  • Extensive API for developers

Example: electron-positron pair annihilation to muons
The following code gives squared matrix element of the electron-positron pair annihilation in two muons in quantum electrodynamics:
import cc.redberry.groovy.Redberry import static cc.redberry.core.indices.IndexType.* import static cc.redberry.groovy.RedberryPhysics.* import static cc.redberry.groovy.RedberryStatic.* //****************************************************// //******** Electrons annihilation in two muons *******// //****************************************************// use(Redberry) { defineMatrices 'G_a', 'V_i', Matrix1.matrix, 'v[p_a]', 'u[p_a]', Matrix1.vector, 'cv[p_a]', 'cu[p_a]', Matrix1.covector //photon propagator def G = 'G_mn[k_a] = -I*g_mn/(k_a*k^a)'.t //vertex def V = 'V_i = -I*e*G_i'.t //matrix element def M = 'cv[p2_a]*V_i*u[p1_a]*G^ij[p1_a + p2_a]*cu[k1_a]*V_j*v[k2_a]'.t M = (V & G) >> M def mandelstam = setMandelstam( ['p1_m': 'me', 'p2_m': 'me', 'k1_m': 'mu', 'k2_m': 'mu']) M = (EliminateMetrics & ExpandDenominator & mandelstam) >> M //complex conjugation def MC = Conjugate >> M MC = 'u[p1_a]*cv[p2_a] = v[p2_a]*cu[p1_a]'.t >> MC MC = 'v[k2_a]*cu[k1_a] = u[k1_a]*cv[k2_a]'.t >> MC def M2 = ExpandAll >> (M * MC / 4) //electron and muons polarizations M2 = 'u[p1_a]*cu[p1_a] = me + p1_a*G^a'.t >> M2 M2 = 'u[k1_a]*cu[k1_a] = mu + k1_a*G^a'.t >> M2 M2 = 'v[p2_a]*cv[p2_a] = -me + p2_a*G^a'.t >> M2 M2 = 'v[k2_a]*cv[k2_a] = -mu + k2_a*G^a'.t >> M2 //trace of gamma matrices M2 = DiracTrace['G_a'] >> M2 M2 = (ExpandAndEliminate & mandelstam) >> M2 M2 = 'u = 2*(mu**2 + me**2) - s - t'.t >> M2 M2 = Factor >> M2 println M2 }
This code will produce the following well-known result: \[ \frac{1}{4}\sum_{spins}|\mathcal M|^2 =\frac{2 e^{4}}{s^2} (-4 m_e^{2} t+s^{2}+2 m_\mu^{4}+4 m_\mu^{2} m_e^{2}+2 t^{2}-4 m_\mu^{2} t+2 m_e^{4}+2 s t) \]