Symbolic Evaluation of Expressions from Racah’s Algebra

: Based on the rotational symmetry of isolated quantum systems, Racah’s algebra plays a signiﬁcant role in nuclear, atomic and molecular physics, and at several places elsewhere. For N -particle (quantum) systems, for example, this algebra helps carry out the integration over the angular coordinates analytically and, thus, to reduce them to systems with only N (radial) coordinates. However, the use of Racah’s algebra quickly leads to complex expressions, which are written in terms of generalized Clebsch–Gordan coefﬁcients, Wigner n-j symbols, (tensor) spherical harmonics and/or rotation matrices. While the evaluation of these expressions is straightforward in principle, it often becomes laborious and prone to making errors in practice. We here expand J AC , the Jena Atomic Calculator, to facilitate the sum-rule evaluation of typical expressions from Racah’s algebra. A set of new and revised functions supports the simpliﬁcation and subsequent use of such expressions in daily research work or as part of lengthy derivations. A few examples below show the recoupling of angular momenta and demonstrate how J AC can be readily applied to ﬁnd compact expressions for further numerical studies. The present extension makes J AC a more ﬂexible and powerful toolbox in order to deal with atomic and quantum many-particle systems. algebra. In the facilitate the symbolic decomposition and use of spherical tensor operators.


Racah's Algebra in Atomic and Many-Body Physics
The conservation of angular momentum is known as a powerful concept for studying the properties and (dynamical) behavior of many-particle systems. For isolated N-particle quantum systems, for example, the theories of angular momentum and irreducible tensor operators help to simplify the problem, which generally depends on 3N spatial (and further spin-) coordinates, to a equivalent problem with just N (radial) coordinates. In quantum theory, therefore, the calculus of angular momentum has been found indispensible if more than a (very) few particles are involved in a given system.
Though formally very powerful, the theory of angular momentum often leads to algebraic expressions that quickly become complex and cannot be handled so easily. In fact, various mathematical techniques from group theory are required to find compact expressions, suitable for further (numerical) studies. Since major parts of the underlying (mathematical) techniques were established by Racah in the early 1940s [1][2][3], they are briefly referred to as Racah algebra techniques today. However, while these techniques can be purposeful applied, at least in principle, they quickly become burdensome and prone to errors. In practice, therefore, the simplification of lengthy expressions from the theory of angular momentum has often constrained the further analysis of quantum many-particle systems [4,5].
Apart from the complexity of many mathematical rules, difficulties in applying Racah's algebra arise especially from the number and symmetry of the underlying symbols as well as their phases (and phase conventions). To overcome these problems, various algebraic and graphical approaches have been worked out [6][7][8][9]. Here, we suggest (and implement) a symbolic approach within the framework of JAC, the Jena Atomic Calculator, which facilitates atomic and cascade computations of different kinds and complexity. The present extension of JAC aims at simplifying typical expressions from Racah's algebra, and which may include also the summation over dummy indices.
Like JAC in its entirety, we provide an interactive and user-friendly approach that neither requires detailed knowledge about the group-theoretical background (that leads to these expressions) nor prior experience with the techniques for their simplification. To explain the goals and strategies behind this computer-algebraic approach, we briefly recall the advantages, difficulties and the form of typical Racah expressions in Section 2, and by mentioning a few strategies for their simplification. In Section 3, we then outline the basic features of JAC, and which additional (data) structures and functions are needed in order to support the symbolic manipulation of expressions from Racah's algebra. All manipulations are based on the symmetries as well as a large number of sum and integration rules for the Wigner n-j symbols and rotation matrices that (may) help to successively reduce the length of Racah expressions. Moreover, a few examples in Section 4 demonstrate how the present extension to JAC can be applied in order to simplify recoupling coefficients or (many-particle) matrix elements and diagrams, as they frequently occur in atomic physics and/or quantum electrodynamics (QED). Finally, a short summary is given in Section 5.

Advantages of Using Racah's Algebra
After the pioneering work by Eugene P. Wigner in the late 1930s, especially Giulio Racah [1][2][3] developed an algebraic calculus that forms today one of the fundamentals for dealing with quantum many-particle systems. Over the years, in fact, Racah's algebra has been utilized in a large number of applications and in quite different fields of physics, from nuclear reactions [10] to atomic and molecular physics [11][12][13], to quantum chemistry [14], or even in solid state physics [15]. However, not many details need to be provided here about the mathematical background of angular momentum (theory), which has been the subject of a good number of textbooks and monographs [16,17]. We just refer to the text of Wigner [5] and the (very comprehensive) compilation by Varshalovich, Moskalev and Khersonskii [18].
In the (re)coupling of angular momenta, for example, and as frequently applied in nuclear and atomic structure theory, Racah's algebra leads to expressions that are usually written in terms of generalized Clebsch-Gordan coefficients and/or Wigner n-j symbols as well as the Wigner rotation matrices and spherical harmonics. In these derivations, indeed, rather a large number of these symbols (may) occur in the first instance, along with multiple summations, Kronecker and triangular deltas δ(j 1 , j 2 , j 3 ) as well as various further (reduced) coefficients. Detailed insight into the structure and symmetry of these expressions is then required to find equivalent, while more compact, expressions and finally those that are suitable for further work. It is this-usually necessary-reduction of complex expressions into an equivalent but compact form that makes Racah's algebra so powerful but also rather a great challenge, and sometimes cumbersome in practice. Furthermore, similar demands on the evaluation of expressions from Racah's algebra arise in the spin-angular integration of many-particle matrix elements [19,20], in molecular [21] and QED perturbation expansions [22], or in deriving spin-and/or angular correlations functions in quantum scattering theory [23,24], and where the rotational symmetry helps reduce the complexity. In all these cases, however, the elegance of Racah's algebra typically comes for the price that one needs to deal with quite cumbersome algebraic manipulations.

Typical Expressions and Difficulties from Racah's Algebra
To deal with typical expressions from Racah's algebra, below we shall make use of (so-called) Racah expressions.
which may comprise any number of Wigner 3-j, 6-j and 9-j symbols, spherical harmonics as well as Wigner's (small) rotation matrices, and where j 1 , j 2 , . . . and m 1 , m 2 , p 3 , . . . refer to the formal angular-momentum and magnetic quantum numbers, respectively. In addition, Kronecker and triangular deltas, a multiple summation over angular momenta or the integration over angles (within certain domains) may occur in these expressions. Of course, the complexity of such Racah expressions increases rapidly as more Wigner or other symbols are involved in the (product) terms. We here introduce this explicit notation of a Racah expression with the goal for providing the user with an internal data type, which facilitates automatic manipulations and which is flexible enough to support a wide range of applications. The notion of a Racah expression above includes as special cases also the well-known orthogonality relations (and integrals) of the Wigner n-j symbols and spherical harmonics. It also enables one to readily include Clebsch-Gordan coefficients j 1 m 1 , j 2 m 2 | j 3 m 3 and rotation matrices D (j) pq (α, β, γ) that, apart from some additional phase and/or exponential, can be expressed in terms of the Wigner 3-j symbols and the reduced rotation matrices d (j) pq (β) , respectively. A simple manipulation and reduction of Racah expressions (1) will therefore help in many different applications.
Of course, the overall symmetry of a Racah expression follows directly from the symmetries of its underlying Wigner n-j and other symbols. For example, each of the Wigner 6-j symbols can be (re-) written, by properly exchanging columns and rows, in 24 different but equivalent forms. Apart from this (i) very high symmetry of Racah expressions, including different phases and weight factors, further difficulties arise moreover from (ii) the complexity of many mathematical rules, which are hard to remember, as well as (iii) the number of different notations and phase conventions, and which often cause confusion when going through some derivation. With the present algebraic evaluation of such Racah expressions, we here wish to overcome (parts of) these difficulties.

Techniques for Simplifying Racah Algebra Expressions
While the theory of angular momentum is quite well understood today, the manipulation and simplification of typical Racah expressions requires experience and is often laborious in detail. As mentioned before, many standard techniques in using Racah's algebra result in quite lengthy expressions, involving a multiple summation over products of Clebsch-Gordan coefficients and/or Wigner n-j symbols. A typical goal for the algebraic manipulation is to recognize the equivalence of a certain part of such Racah algebra expression with one side of a given sum or orthogonality rules and to replace this part, so that the overall expression takes a simpler form. Obviously, this requires a careful inspection and analysis of the full Racah expression, including the summation over dummy indices, the occurrence of relevant angular momenta in other parts of the overall expression as well as the correct treatment of all phases and weight factors of the overall expression. Rather similar requirements occur, moreover, if an integration over angles should be simplified algebraically.
While the sum and orthogonality rules are usually known in some standard form from the literature [5,18], they are not of direct help without that the Wigner symbols are properly re-written and arranged, so that an algebraic equivalence can be easily recognized. In practice, this requires to cycle through all symmetric forms of a Racah expression and to analyze its individual parts for possible replacements. Four different strategies are therefore considered in the implementation below in order to simplify Racah expressions, and where a simplification refers to lowering the number of summation indices, the number of Wigner symbols and rotation matrices and/or the number of integrals in the overall expression. The algebraic evaluation of a given Racah expression then terminates if no further replacement can be found towards such a simpler expression.
In the JAC toolbox below, the four strategies for simplifying Racah expressions can be summarized as follows: (i) Use of so-called special values of the Wigner n-j symbols, if some of the arguments fulfill certain fixed relations. For this strategy, each Wigner n-j symbol can be analyzed separately and, if the special value applies, replaced by a simple algebraic expression, and without that the summation indices or other parts of the Racah expression has to be considered. (ii) Use of orthogonality and sum rules for the Wigner n-j symbols. This requires a very careful analysis of the Racah expression as a whole, since all summation variables not only need to be in the correct position in the (arguments of the) Wigner n-j symbols, but they must also contribute to a correct phase and weight of the overall expression. Moreover, the same variables may not occur in other Wigner symbols of the Racah expression, which are not part of the selected rule. (iii) Use of orthogonality and sum rules for the spherical harmonics and Wigner rotation matrices. Apart from requests similar to strategy (ii), the proper angular dependence of the functions involved has to be ensured for a valid simplification of the Racah expression. (iv) Use of integration rules; these rules can be formally treated quite similar to the former sum rules, if we assume that all sums and integrals can be interchanged in such expressions. For (iii) and (iv), only a small subset of the known sum and integration rules have so far been implemented in JAC.
Indeed, these four strategies help evaluate complex Racah expressions and often leads to some or even the most compact form. These strategies may likely fail, however, if certain phase or weight factors cannot be simplified or if arguments (angular momenta) contains 'composed' values, e.g., a summation or multiplication of different symbols and numbers. No attempt has been undertaken (yet) to deal with such elaborate Racah expressions, nor to deal with the symmetries due to Regge [25] for the Wigner 3-j and 6-j symbols. While the Regge symmetries are known to the JAC toolbox, they are less relevant for symbolic evaluations, though very lengthy to deal with. In JAC, we therefore keep the distinction between the classical symmetries and those due to Regge as an optional flag.
The four strategies above systemize the usual manipulation of expressions from Racah's algebra that is often based on a good deal of practical experience and effort in order to find the proper rules and replacements. They are (partly) different from the graphical rules that have been established as well in the literature [6,26], and which make the structure of certain expressions more readily visible in course of the evaluations; however, these graphical rules require again additional knowledge and are prone to making errors as the phases and weights need often to be treated separately. Below, we shall explain how these strategies are implemented within the JAC toolbox and can now be utilized in order to solve various research and textbook problems.

Brief Overview about JAC
The JAC toolbox has been developed as a general and easy-to-use toolbox for the atomic physics community in order to perform (relativistic) atomic structure calculations of different kinds and complexity. In particular, this toolbox integrates different atomic processes within a single computational framework and, thus, ensures a proper (self)consistency of the generated data. For many (standard) computations, JAC provides an interface which is equally accessible for working spectroscopists, theoreticians and code developers. The JAC tool box is based on Julia, a recent programming language for scientific computing, and can typically be applied without much prior knowledge of the code. Little needs to be said about the general design of the JAC code that has been described elsewhere [27] and that can readily be downloaded from the web [28].
The design of these tools has been based on an analysis of typical user requirements and a hierarchical structure of the code. Apart from interactive (atomic) computations, JAC also supports various representations of atomic states, including mean-field orbitals, restricted code spaces [29,30] and approximate Green function expansions [31], to name just a few. It also facilitates the computation and simulation of atomic cascades [32][33][34], by just following different excitation schemes. Figure 1 displays a brief overview about the JAC toolbox and its major features. Here, we expand this toolbox to now support also the symbolic evaluation of expressions from Racah's algebra. This extension makes JAC particularly suitable in order to combine derivations and computations within the same framework. It makes use of the SymEngine package [35] of the Julia platform. It also replaces and expands a former code for similar symbolic evaluations but which was limited to the Wigner n-j (and equivalent) symbols [36][37][38].  [27] for calculating atomic and ionic structures, processes and cascades, based on Dirac's equation. Apart from relativistic atomic computations, the JAC toolbox now supports also the symbolic evaluation of expressions from Racah's algebra. In the future, moreover, we plan to facilitate the symbolic decomposition and use of spherical tensor operators.

Data Structures for Symbolic Evaluations
Since the present extension to JAC focuses upon the symbolic evaluation of Racah expressions, i.e., their stepwise simplification towards an equivalent but more compact form, a number of new data structures were required. Apart from the Wigner n-j symbols, spherical harmonics or Wigner rotation matrices, we need to be able to deal with Racah expressions as a whole. All these data structures are defined in the module RacahAlgebra and are based on symbols::Basic, the central data type of SymEngine [35], though other symbolic packages might be supported as well in the future.
For example, Figure 2 displays the data structures W3j for a Wigner 3-j symbol with symbolic arguments    [35], are two crucial entities to specify and manipulate RacahExpression's (lower panel) as a whole. For the RacahExpression, we also display two simple constructors that are employed below to set up the expressions to be evaluated. See text for further discussions.
Well-designed data structures are indeed central for the communication with and the data transfer within the program. For the symbolic evaluation of Racah expressions, all Wigner n-j symbols, spherical harmonics and rotation matrices need to be specified (and kept) separately in order to allow the desired transformation. Apart from its phase and weight, a RacahExpression therefore comprises arrays of Kronecker and triangular deltas, Wigner 3-j, 6-j and 9-j symbols, spherical harmonics as well as the (small) Wigner rotation matrices. These arrays are analyzed first separately but also together in order to find out possible re-writings of the overall expression. Frankly speaking, these data structures form the (language) elements in order to be able to recognize and apply the various rules in the evaluation of Racah expressions.
Apart from the explicitly defined data structures, Table 1 also tabulates a few related functions, such as the ClebschGordan or Dfunction. These functions formally appear quite similar to the data types above, but just re-write the given entity in terms of the Wigner 3-j or small rotation matrix, and by taking into account the proper phase and weight factors; these functions then always return a (single-term) RacahExpression.
Finally, the data type Csq just represents a coupling sequence (j 1 , j 2 ) j 12 of three angular momenta, though it supports also a recursive use in order to specify, for example, the coupling of four angular momenta to some total one, (( 1 , 2 ) L, (s 1 , s 2 ) S) J , or even of many more. This data type has been introduced to readily lay out complex recoupling coefficients, as we shall discuss in Section 4.1.

struct & brief explanation.
AbstractRecursionW3j: defines an abstract type for the recursion rules of Wigner 3-j symbols; this type comprises the concrete (singleton) types: RecursionW3jMagnetic to select a recursion with regard to the magnetic quantum numbers; RecursionW3jOneStep for a step-1 recursion of the j-quantum numbers; RecursionW3jHalfStep for a step-1/2 recursion of the j-quantum numbers; and RecursionW3jLouck for a recursion due to Louck [40]. ClebschGordan: re-writes a Clebsch-Gordan coefficient j 1 m 1 , j 2 m 2 | j 3 m 3 in terms of a Wigner 3-j symbol and, thus, a Racah expression. ClebschGordanExpansion: re-writes a (standard) Clebsch-Gordan expansion |(j 1 , j 2 ) jm = ∑ m 1 m 2 |j 1 m 1 , j 2 m 2 j 1 m 1 , j 2 m 2 | jm in terms of a Wigner 3-j symbol and, thus, a Racah expression but without the basis vectors. Csq: a type for a coupling sequence (j 1 , j 2 ) j 12 of three angular momenta with symbolic arguments that can be employed recursively. Delta: a type for a Kronecker delta δ(j 1 , j 2 ) with symbolic arguments. Dfunction: re-writes a Wigner rotation matrix D  Ylm: a type for a spherical harmonic Y m (ϑ, ϕ) with symbolic arguments; cf. Figure 1.
While the data types (and functions) of the RacahAlgebra module occur rather independent from the numerical part of the JAC toolbox, they complement these tools and have made it more powerful. In total, there are at present about ∼250 of these data structures in JAC, though most of them remain hidden to the user.

Sum Rule Evaluation
The four strategies in Section 2.3 also define a hierarchy for analyzing the various parts of a given Racah expression. A simplification of such parts is attempted by going through and by comparison with a set of internally given (sum) rules. Indeed, these sum rules, which are known for the Wigner n-j symbols, form the heart of the given symbolic evaluation. More than 40 of such sum rules from the literature have been implemented [18,41] and help simplify summations over single Wigner n-j symbols or over products with a different number of such symbols. Obviously, the evaluation of Racah expressions becomes rapidly expensive as more Wigner symbols are involved in the product terms. The most complex sum rule, currently implemented, allows to replace a 9-fold summation of a product of six 3-j symbols.
To make use of these sum rules, one generally needs to cycle through all symmetric forms of the selected part of the Racah expression. A loop through these equivalent forms, but with a different sequence of arguments in each case, ensures that the angular momenta and the position of the Wigner symbols may coincide with the standard form, as known from the literature, and may thus be replaced by some simpler expression. Once this equivalence has been proven, including the proper phase, weight and independence of all other parts with regard to the relevant quantum numbers, this part of the Racah expression can be replaced by the corresponding simpler structure (i.e., by the other and simpler "side" of the rule).
The simplification of a (Racah) expression always results again into a Racah expression, though hopefully a simpler and more compact one. The detailed analysis (and replacement) of the algebraic expression behind this simplification is implemented by means of the function RacahAlgebra.evaluate(), and which subsequently cycles through the implemented rules. Hereby, a simplification and replacement of Wigner 3-j symbols has a higher preference than the simplification of Wigner 6-j symbols, and these again have a higher preference than the Wigner 9-j symbols. At present, all these rules are just applied ones, even if further cycles might result in yet simpler expressions. It is left to the user to determine when the evaluation process is to be terminated. Table 2 lists the major functions of the RacahAlgebra module that help manipulate Racah expressions and that can be called individually as well. For most applications, however, the function evaluate(expr::RacahExpression) will be sufficient, and its return value can often immediately be used for further derivations and calculations within the theory of angular momentum.

Function & brief explanation.
evaluate(): attempts to evaluate or simplify a Wigner n-j symbol, recoupling coefficient or a Racah expression as a whole by means of special values, if the keyword special = true is given, or by sum rules. equivalentForm(): generates an (randomly chosen) equivalent form for a Wigner n-j symbol or a Racah expression by using either the classical symmetries or those due to Regge [25]. purifyPhase(): purifies the overall phase of a Racah expression so that the contribution of any angular momentum a occurs as −a, a, 2a, 3a . An equivalent phase is returned. selectW3j(): selects one of various pre-defined Wigner 3-j symbols for which usually special values are known; this function has been implemented mainly for test purposes and is similarly available also for the other Wigner symbols. simplifyDeltas(): simplifies, if possible, all Kronecker deltas δ j 1 ,j 2 in a Racah expression if a corresponding summation is to carried out. simplifyTriangles(): simplifies all triangular deltas δ(j 1 , j 2 , j 3 ) in a Racah expression. specialValue(): attempts to find a special value for a given Wigner n-j symbol. symmetricForms(): generates a list of all equivalent symmetric forms of a Wigner n-j symbol, spherical harmonic Y m (ϑ, ϕ) or Wigner rotation matrix d (j) pq (β) .

Integration Rules for the Spherical Harmonics and Rotation Matrices
The full power of Racah's algebra becomes apparent only if the (re)coupling of angular momenta is combined with the use and calculus of irreducible tensor operators and statistical tensors. This combination leads to expressions, in which the Wigner n-j symbols occur together with the-summation and integration over-spherical harmonics and/or rotation matrices. In practice, of course, such a combined treatment also enhances the structure, variety and (possible) complexity of the expressions that need to be considered. It is therefore beyond the scope of the present work to deal with the full complexity of expressions, in which spherical harmonics and/or rotation matrices appear together with the Wigner n-j and other symbols from the theory of angular momentum.
In a first step, instead, we here include three orthogonality relations of the spherical harmonics that can be formulated with regard to a summation over angular momenta (quantum numbers). This step has been formalized in strategy (iii) but, otherwise, places quite similar requirements upon their implementation as the sum-rule evaluation above. Again, parts of the corresponding Racah expressions need to analyzed (and replaced) separately owing to the given rules, and by taking all the symmetries of this part into account.

Derivation and Evaluation of Racah Expressions
Using JAC, the implementation of the RacahAlgebra module can be applied quite readily in daily research work or in teaching many-particle quantum mechanics. Here, we show how three problems from textbooks on atomic and angular-momentum theory can be solved without much prior knowledge about the (algebraic) techniques outlined above.

Recoupling of Angular Momenta
An isolated three-particle quantum system can often be characterized (and classified) to a good approximation by its individual angular momentum quantum numbers j 1 , j 2 , j 3 and the associated magnetic quantum numbers m 1 , m 2 , m 3 , and then described within their so-called product basis {|j 1 m 1 , j 2 m 2 , j 3 m 3 } . Alternatively, such a system can also be classified by means of coupled angular momenta and their projections. Different coupling orders, such as |((j 1 , j 2 ) J 12 , j 3 ) J M or |(j 1 , (j 2 , j 3 ) J 23 ) J M , might be utilized and are appropriate for different interparticle interactions [42,43]. Here, we shall not discuss the physics behind these different coupling schemes but just remind the reader that the coupled and product bases (of any N-particle system) are related to each other by a subsequent and standard Clebsch-Gordan expansion for two angular momenta at a given time: and analogue also for the |(j 1 , (j 2 , j 3 ) J 23 ) J M basis states. Obviously, moreover, these expansions can be expressed in terms of the Wigner 3-j symbols, and by taking a consistent phase convention into account. In order to make a transformation from one to another coupled basis, one then often needs to evaluate the unitary transformation matrix and where the overlap integral ((j 1 , j 2 ) J 12 , j 3 ) J M| (j 1 , (j 2 , j 3 ) J 23 ) J M is known also as the recoupling coefficient in the literature. Indeed, the efficient evaluation of such recoupling coefficients is key in the computation of many-particle matrix elements for operators that are symmetric in the particular indices. In JAC, this recoupling coefficient can be simplified by the short (Julia) script: This script makes internal use of the coupling sequence Csq in order to specify the correct coupling order of both sides of the recoupling coefficient, and to re-write each side in terms of its Clebsch-Gordan expansion. The internal evaluation of the recoupling coefficient above therefore starts from an 8-fold summation over products of four Wigner 3-j symbols and, then, subsequently applies a sum rule for three Wigner 3-j as well as for two 3-j symbols to obtain the final result. From the coupling sequence, moreover, we can reverse the phase and make use of the symmetry of the Wigner 6-j symbols to finally arrive at the well-known expression [44] ((j 1 , Obviously, therefore, the recoupling coefficient ((j 1 , j 2 ) J 12 , j 3 ) J M| (j 1 , (j 2 , j 3 ) J 23 ) J M just simplifies to a Wigner 6-j symbol, and without any dependence on the total projection M, i.e., upon the choice of the quantization axis. Showing this independence on M for the recoupling of three (or more) angular momenta is a typical textbook example and can be obtained also from symmetry arguments. More generally, the evaluation of recoupling coefficients usually leads to products of Wigner 6-j symbols, often with a summation over multiple indices, and which might be further simplified by applying different sum rules for the 6-j symbols.

Matrix Elements of Tensor Operators within a Coupled Basis
The interaction of many-particle systems is often described by tensor operators [T (k 1 ) · U (k 2 ) ] (K) Q of rank K, where T (k 1 ) only operates on part 1 and U (k 2 ) on part 2 of some physical system. Such a partitioning into (sub)systems might refer to the space and spin coordinates of a single particle or, more generally, to any set of independent coordinates of two particles. For these tensor operators of rank K, the interaction matrix elements in a coupled basis can then be re-written in terms of the matrix elements of the underlying subsystems. In this notation, α refers to all (further) quantum numbers that are needed for a unique classification of the two-particle states. The task is to find the correct decomposition of the matrix element (2) in terms of its subsystems by using the standard coupling of tensor k 1 q 1 , k 2 q 2 | KQ , and together with the Wigner-Eckart theorem jm X (k) q j m = j m , kq| jm j X (k) j , that separates the orientational dependence from the strength of interaction. If we first make a Clebsch-Gordan expansion on both sides of the matrix element (2) and use the two (simple) relations above, we can readily express the matrix element as Here, again, the summation over α ensures the completeness of the decomposition. We can simplify the summation over all the magnetic quantum numbers by typing * ClebschGordan(k1,q1, k2,q2, K,Q) * ClebschGordan(j1p,m1p, k1,q1, j1,m1) * ClebschGordan(j2p,m2p, k2,q2, j2,m2) RacahAlgebra.evaluate(wb) >> Apply sum rule for four W3j --Sum(m1,m2,m3,m4) (-1)^-m1-m2-m3-m4 ... >> Apply sum rule for three W3j --Sum(m4,m5,m6) ... >> Apply sum rule for three W6j --Sum(X) (-1)^2X [X] ...

Angular Reduction in Feynman-Goldstone Diagrams
In many-body perturbation theory or atomic QED, the angular reduction in diagrams often results in generalized recoupling coefficients with rather a large number of angular momenta as associated with the individual shells of otherwise equivalent electrons. For a closed-shell atom, for example, (one of) the second-order correlation contributions can be written as [26,45] and where 1 r 12 ≡ 1 |r 1 − r 2 | refers to the instantaneous Coulomb repulsion among the electrons. Here, the matrix elements in the nominator are to be calculated in an uncoupled basis, and with one-particle energies ε a = ε n a a j a that do not depend on the magnetic quantum numbers. In the summation, however, the orbital indices a ≡ (n a a j a m a ), b ≡ (n b b j b m b ) run over all occupied one-particle states of the closed-shell atom or ion, and r ≡ (n r r j r m r ), . . . over all those states that remain unoccupied in the Hartree-Fock determinant. By using the radial-angular decomposition of the Coulomb interaction matrix [17,46]  X L (abrs) X L (rsab) a + b − r − s δ(j a , L, j c ) δ(j b , L, j d ) .
In this expression, X L (abcd) refers to the so-called (reduced) Coulomb interaction strength. The same result is sometimes obtained by using graphical rules for the coupling of angular momenta. While, perhaps, such a graphical approach appears to be more elegant to the reader, it becomes tedious and prone to errors if the correct phase and weight factors need to be determined for complex diagrams. Similar tasks will occur in the future if the two-photon (QED) exchange diagrams are to be evaluated for open-shell atoms [47].

Conclusions
While the power and techniques of Racah's algebra have been known for more than seven decades, it often leads to expressions that are quite cumbersome to simplify. Difficulties in this simplification arise not alone from the complexity of the underlying rules, which are hard to remember in practice, but especially from the number and symmetries of the Wigner n-j symbols, and of other characteristic functions or coefficients. To overcome these difficulties, a symbolic evaluation (simplification) of Racah algebra expressions has been worked out and demonstrated in this work.
To realize such a symbolic evaluations of expression from Racah's algebra, the Jena Atomic Calculator (JAC) has been expanded by the module RacahAlgebra that helps represent and manipulate the Wigner n-j symbols, spherical harmonics, Wigner rotation matrices and several other symbols from the theory of angular momentum. A simplification of such Racah expressions is obtained by following various strategies and, especially, by using a large number of sum rules. Further rules can be easily implemented by the user. This (algebraic) evaluation of expressions complements the numerical atomic structure and collision computations of JAC and makes this toolbox suitable for emerging applications in many-particle theory and the simulation of complex behavior.