Manuscript Offprint
arXiv:2610.24074QRecoupling.jl: numerical and exact computation of classical and quantum recoupling coefficients
Seth K. Asante
Department of Mathematics and Statistics, University of New Brunswick
Fredericton, NB E3B 5A3, Canada
Abstract. QRecoupling.jl is a Julia package for numerical, exact and symbolic evaluation of classical and quantum recoupling coefficients and generic finite sums of quantum factorials, with one interface across the classical limit, principal unitary levels and real or complex deformation. A compact factorial rule and its cyclotomic exponents expose factor cancellation, polynomial structure and level support. The package covers quantum Clebsch–Gordan coefficients, 3j and 6j symbols and user-defined sums. Its adaptive numerical evaluation is combined with exact decisions for sums that cancel to zero. Classical 3j and 6j symbols are evaluated at a speed comparable to that of WIGXJPF, which is based on prime factorization tables, at the smallest spins, and about 6 and 10 times faster at spin cutoff 500. Under real, root-of-unity and complex deformation, the largest relative error measured against independent high-precision references is for spins up to 400. Fusion matrices with 401 channels are computed about 100 times faster than by loops over their entries.
Keywords: quantum recoupling, Wigner symbols, quantum groups, exact arithmetic, Julia
Program summary
Program title: QRecoupling.jl, version 0.5.1.
Licensing provisions: MIT.
Programming language: Julia (1.10 or later).
External routines/libraries: Nemo.jl, LRUCache.jl.
Nature of problem: Direct evaluation of recoupling coefficients and related finite sums of factorial products can overflow or lose accuracy through cancellation. Roots of unity change the admissible labels and contributing terms, while numerical, exact and symbolic calculations require different arithmetic for the same coefficient.
Solution method: A compact factorial rule supports classical values, unitary levels, real or complex deformation, and deferred symbolic expressions. Numerical kernels use scaling, compensated arithmetic and adaptive precision; three-term recurrences share work across recoupling families and fusion matrices. Exact values use integer arithmetic at q = 1 and real cyclotomic coordinates with explicit radicals at a level. Nonzero modular residues rule out zero, while unresolved candidates receive exact confirmation within the numerical evaluator and the zero-query interface.
Restrictions: Labels are integer or half-integer spins, and level values follow the level's fusion rules. Weighted coupling coefficients support numerical targets and exact classical output. Their exact-level and symbolic output is not yet available.
These sums are the local coupling and recoupling coefficients of many physical theories. For instance, in atomic and nuclear spectroscopy they combine angular momenta [1]. In quantum gravity the 6j symbol is the amplitude of a quantum tetrahedron [2], the building block of transition amplitudes [3, 4], and its quantum-group deformation is used to describe a cosmological constant and curved discrete geometries [5–11]. At a root
The quantum 6j symbol at vanishes through cancellation of its terms.
Email: seth.asante@unb.ca of unity the coefficients become the associativity data of , which define the Turaev–Viro and Reshetikhin–Turaev topological quantum field theories [12–14] and the -symbols of anyon models and string-net condensates [15, 16]. Spin foam computations [17, 18] and tensor-network algorithms with or anyonic symmetry [19–21] evaluate them in very large numbers. These applications need fast approximate values, and exact ones for coherence identities such as the pentagon equation, often within the same calculation.
Existing methods for the classical coefficients exploit different aspects of the factorial structure. WIGXJPF uses prime factorization and multiword integer arithmetic to evaluate classical Wigner symbols without loss from cancellation [22]. WignerSymbols.jl builds on this approach for exact classical output. Other classical approaches compute the coefficients exactly [23] or store precomputed values in compact tables [24], and recurrence methods are especially useful for families of related values [13, 25–27]. For quantum-deformed coefficients there are far fewer methods, and the prime-factorization approach does not carry over directly, because quantum integers factor into cyclotomic polynomials rather than primes [28], and some of these factors vanish at roots of unity. QWignerSymbols.jl implements the factorial formulas by direct floating-point summation and integrates these data with TensorKit. Its tested version does not provide adaptive precision or dedicated exact, symbolic or unitary-level evaluation targets. No single tool therefore handles all three difficulties across the classical and deformed regimes.
QRecoupling.jl addresses the three difficulties through one interface and one set of conventions. It covers Clebsch–Gordan coefficients, 3j and 6j symbols, fusion and braiding data, and user-defined sums, in the classical limit, at principal unitary levels and at real or complex deformation. Each coefficient is stored as a compact factorial rule, to which quantum coupling coefficients add powers of q. The 6j symbol is the main worked example, with numerical, exact and symbolic evaluation from the same rule.
The package builds on the deferred cyclotomic framework of Ref. [28], which stores every term of a sum through its cyclotomic exponents. This work replaces these expanded exponents by the compact factorial rule. It adds adaptive numerical evaluation with error estimates, exact decisions for sums that cancel to zero, weighted coupling coefficients, and recurrences for families of coefficients. Together these address the three difficulties. Large cancellation is met by scaling, compensated summation and higher precision, with recurrences as a second route. When these cannot tell a small sum from a vanishing one, exact arithmetic decides it algebraically. At a root of unity, the vanishing factors are determined before any evaluation. A quantum factorial factors into cyclotomic polynomials, and only one of these is zero at a given root of unity. Integer division counts how often it occurs in the numerator and in the denominator of a term, which shows whether the term is zero, finite or singular, and so which terms contribute at that level. The same count for every cyclotomic factor shows exactly when a term is a polynomial in with integer coefficients. An exact value at a level can also be written in nested square roots whenever the degree of its number field is a power of two.
The article is organized as follows. Section 2 previews the user interface. Section 3 writes coupling, recoupling and fusion coefficients as finite factorial sums. Section 4 introduces the factorial rule and its cyclotomic exponents, the main mathematical objects, which determine when terms are integer polynomials and which terms contribute at a level. Section 5 treats adaptive numerical evaluation with its error estimates and zero decisions, and Section 6 exact and symbolic computation. Section 7 gives worked examples, Section 8 reports accuracy and performance, and Section 9 discusses scope and future work. The appendix derives the error estimate of the plain pass.
2 A unified interface
A calculation specifies integer or half-integer spin labels and an evaluation target (Table 1). The target changes the arithmetic but not the convention of the coefficient. The functions qcg, q3j and q6j evaluate Clebsch–Gordan coefficients, 3j symbols and 6j symbols:
using QRecoupling
js = (1, 1, 1, 1, 1, 1) # spin labels c = q6j(js...) # classical v = q6j(Exact(10), js...) # exact level s = q6j(Symbolic(), js...) # deferred cg = qcg(At(0.8), 1, 1, 1, -1, 1, 0) w = q3j(At(0.8), 1, 1, 1, 1, -1, 0) @assert c ≈ 1/6 @assert cg ≈ sqrt(qdim(At(0.8), 1)) * w @assert numeric_value(v) ≈ q6j(Level(10), js...)
WignerSymbols.jl; version 2.0 https://github.com/Jutho/WignerSymbols.jl.
QWignerSymbols.jl; version 0.1. https://github.com/QuantumKitHub/QWignerSymbols.jl.
Table 1: The target interface for factorial rules. The weighted coupling functions qcg and q3j support the numerical targets and Exact(), but not yet Exact(k) or Symbolic(). An omitted deformation is classical.
| Request | Target | Output form |
|---|---|---|
| Classical numerical | Classical() or omitted | |
| Classical exact | Exact() | |
| Unitary level | Level(k) | |
| Exact level | Exact(k) | |
| Specified deformation | At(q) | |
| Generic expression | Symbolic() | Deferred factorial sum, expansion requested separately |
The coupling calls take spin and magnetic labels, qcg as the pairs of and q3j as the two rows of the 3j symbol, and the assertion checks the normalization (7) that relates them. A principal unitary root is requested through Level(k), which retains the exact level and its fusion support. A nearby floating-point value of passed through At(q) is evaluated at the number supplied.
Changes of representation are requested explicitly. The function x_form expands a generic expression in , radical looks for an expression in nested square roots, and numeric_value converts exact data to a number. User-defined rules use the same targets through qeval, and Section 7.4 gives a complete example.
What a result means. The targets return three kinds of answer with different guarantees. A floating-point value is accepted when an error estimate computed alongside it satisfies a relative threshold of or , and is otherwise recomputed at higher precision (Section 5.3). An exact value is an algebraic number whose equality is decided without tolerance. A zero is never inferred from a small or rounded number, i.e., a cancellation zero is returned only when a structural identity or exact arithmetic proves it (Section 5.4). Thus, an unproved zero can appear only through underflow of the output type.
3 Coefficients as finite factorial sums
Finite sums of factorial products provide the common computational object considered here. Coupling coefficients add selection rules, phase weights and square-root normalizations.
3.1 Quantum integers and factorials
For , define the symmetric quantum integer and factorial by
We write and when the value of is clear from the context. The removable singularities at are understood by continuation. At , the continuous limit gives and . The principal unitary level corresponds to the root of unity
3.2 Finite factorial-product sums
The computational object is a finite sum of the form
(3)
where is a product of quantum factorials with integer exponents, , and . The coefficients and the endpoints are integers, with nonnegative factorial arguments throughout the support. Negative exponents represent reciprocal factors. These discrete data form a FactorialSum, and the target selects the arithmetic that evaluates it. A square-root prefactor also needs the branch convention of that target.
A classical example is Gauss' hypergeometric function
(4) where and , for integers and . Its summand is an alternating factorial ratio with nonnegative integer arguments, and replacing those factorials by symmetric quantum factorials gives a rule of the form (3), which Section 7.4 implements. The construction extends to other terminating generalized hypergeometric series with suitable integer parameters. Standard basic hypergeometric conventions can require additional powers of .
3.3 Coupling, recoupling and fusion matrices
Spins label the irreducible representations of and its quantum deformation [13, 15, 29–31]. Writing for the representation of spin , a triple is admissible when lies in the decomposition of into irreducibles, that is, when it satisfies the triangle inequalities and in addition . At a unitary level the fusion rules of further require [15]. Coupling and recoupling coefficients with inadmissible labels are returned as zero.
Clebsch–Gordan coefficients transform product states into coupled states , with . The 3j symbols express the same coupling in a different normalization [1, 13, 32]. The functions qcg and q3j implement these coefficients following a common convention [13]. Their finite sums include monomial weights, taking the form
whose factorial data are those of the classical formula. For the action and the coproduct [13], the weights of are the integers
stored beside the rule. The 3j symbol is the same coefficient in another normalization,
(7)
The weights are essential away from because substituting quantum factorials into the classical formula alone gives coefficients that are not orthogonal.
The 6j symbols relate two ways of coupling three spins and are evaluated by q6j. Their dimension-weighted entries form the fusion or associativity matrix between intermediate channels e and f. These matrices implement the F-moves of anyon models, fusion categories and tensor networks [15, 16]. We use the convention
(8)
returned as a whole matrix with its channel labels by fmatrix and entrywise by fsymbol. It is real orthogonal classically and at principal unitary levels. At nonsingular complex q, with consistent square-root branches, the identity uses the transpose rather than the Hermitian adjoint, so the matrix is complex orthogonal but not unitary.
The coupling coefficients and the F-matrix are tied together by the coassociativity of the coproduct. Coupling three spins in the two possible orders gives two bases, and F is the change of basis between them. With the conventions (6) and (8) this relation holds without an additional phase, and it can be verified within the package from qcg and fsymbol.
Other related data are supported from the same interface, such as braiding eigenvalues (rmatrix), modular S and T matrices, and the tetrahedrally symmetric G-symbol of the Turaev–Viro state sum [12].
3.4 The Racah formula
The factorial rule of the quantum 6j symbol with spin labels is determined by four triangle sums and three quadrangle sums,
(9)
satisfying the balance . Define the squared triangle normalization by
Writing for the product of over the four triples whose sums are the , the Racah formula is [13, 33, 34]
(11)
Thus (3) applies with , , and . At , this gives the classical symbol whose summation is a terminating series. The dimension factors in (8) are further factorial ratios, so its entries belong to the same class. The positive square root defines classically, for positive real and on admissible unitary support, while complex branches are specified in Section 5.5.
4 Factorial rules and multiplicative structure
A factorial rule is the list of integers that specifies one sum of the form (3). It holds the formula as data, with no value of q and no evaluated number, and every evaluation route starts from it. A rule supplies the term ratios that advance the sum, and the factor exponents that show which factors cancel within a product and which terms survive at a level.
4.1 The factorial rule
In the notation of (3), a factorial rule is the tuple
The pairs stand for the factors of the prefactor , and the triples for the factors of the summand . The remaining entries are the sign , the summation range , and the two flags for a square-root prefactor and an alternating sign . The type FactorialSum stores exactly these data, and a weighted coupling coefficient adds the two integers and of (5). For a fixed formula, the number of stored integers is independent of the labels and of the length of the sum, although the integers themselves grow with the labels. For the symbol, (10) and (11) give
so its rule has sixteen prefactor factorials and eight summand factorials at every spin, all determined by the
Algorithm 1 Evaluation of a factorial rule on a regular segment
Require: rule , regular segment , target Ensure: 1: if or then return 0 2: one factorial product 3: 4: for do 5: quantum integers 6: 7: end for 8: return
lists and . Independent permutations of and generate the symmetries of the 6j symbol, comprising the 24 tetrahedral symmetries and the Regge symmetries [13, 35]. The implementation sorts both lists, so equivalent labellings use identical factorial data without a separate canonicalization step.
Evaluation proceeds through ratios of consecutive terms in the sum (3). This is standard for hypergeometric series, and it is especially efficient for factorial products because the ratio of two consecutive terms is a product of quantum integers. For the Racah terms ,
Each step involves eight quantum integers. More generally, write for the terms of (3). Cancelling factorials in leaves a product of quantum integers and their reciprocals, read directly from the stored affine arguments. Since , the sum over a segment can be written in nested form,
where the innermost bracket is . This is Horner's method [36], applied to the ratios. Algorithm 1 evaluates the brackets from the innermost outwards. Only the first term is formed as a factorial product, and every further term costs one ratio, one multiplication and one addition.
A segment is regular when the prefactor and every term in it are finite and nonzero, so that all ratios are defined. At a root of unity the regular segments are found from the valuations of Section 4.2. Each evaluation kernel is constructed from this template (Fig. 1). The numerical kernels accumulate the sum with scaling, forward or by compensated Horner nesting, under precision control, while the exact kernels clear the denominators of the ratios and work with integers or integer polynomials (Section 6). Julia’s multiple dispatch connects each target to its kernel [37], and Nemo supplies the polynomial and number-field arithmetic [38].
4.2 Prime and cyclotomic factorization
Prime factorization underlies exact classical evaluation in WIGXJPF and WignerSymbols.jl [22]. Legendre’s formula gives the exponent of a prime in as . Products and quotients of factorials therefore become sums and differences of integer exponents, and common factors cancel before large numbers are formed. Cyclotomic factorization provides the corresponding representation for quantum factorials [28].
Let . The polynomial factors over the integers into cyclotomic polynomials,
where runs over the primitive th roots of unity. Here, denotes the th cyclotomic polynomial. For example, , , , , and so on. Each has integer coefficients and is irreducible over , so the play the role of primes [39]. Since , each with divides exactly when , and hence divides ! once for each of the multiples of up to [28]. Thus
For a product , the cyclotomic exponents follow directly from the pairs as
(18)
where the power of can be read from (17) in the same way. At , when is a power of a prime and otherwise, so the exponent of in is . Prime factorization is thus the classical limit of cyclotomic factorization.
For evaluation the factorial rule is the more compact representation. The exponent vector of a single ! has nonzero entries, so the expanded factors of a sum grow with the labels and with the number of terms. The rule has the same number of factorials at every spin. Any exponent can still be recovered from the rule by (18) with a few integer divisions. QRecoupling therefore evaluates sums from the rule and keeps the deferred cyclotomic representation of Ref. [28] as a legacy symbolic view. The exponents are useful for addressing two questions about individual factors.
• Valuations, zeros and poles. At level , with is a root of and of no other . Thus is the order of vanishing of an individual product , with negative values indicating poles. Read from the prefactor and summands, these valuations identify vanishing and singular factors before evaluation. They do not decide whether the surviving terms cancel, or whether poles cancel between terms (Section 4.3).
• Exact prefactors. For exact and generic output, the exponents of the prefactor and of the first term are combined, so that common factors cancel before any polynomial is formed, and the odd exponents determine the radical part of the square root. Only this single product is expanded into exponents. At q = 1 the prime exponents play the same role.
These exponents describe cancellation within a term, whereas cancellation between different terms is addressed in Section 5. The analogy with primes holds in the variable , since can factor further in q.
4.3 Polynomial terms and level support
Each quantum integer is an integer polynomial in , so a product of quantum factorials with integer exponents is a ratio of two such polynomials. The cyclotomic exponents decide when the denominator cancels, which gives a criterion for exact polynomial arithmetic without expanding the product.
Proposition 1 (Polynomial factorial products). Let , where and . Then if and only if for every . Any finite integer linear combination of such polynomial products also belongs to .
Proof. For the polynomial is palindromic of degree , where is Euler's totient. Thus, the balanced factor is invariant under . It therefore lies in the invariant ring

Figure 1: The factorial rule connects numerical, exact and symbolic evaluation. Ratios advance the sum, and symbolic output retains the rule until expansion is requested. Cyclotomic exponents are recovered on demand, and families additionally use recurrences between coefficients. Weighted coupling functions keep their q-power exponents beside the rule, with the target restrictions of Table 1.
because every symmetric integer Laurent polynomial is an integer linear combination of 1 and , with , and . Each quantum factorial is also invariant, so the powers of in (18) combine to give . The are monic in and pairwise coprime, since their roots in are distinct roots of unity. Hence is a polynomial exactly when no exponent is negative.
The proposition is an identity for generic , so each target substitutes a specific value of . At a unitary level, and a polynomial product becomes an algebraic integer of the real cyclotomic field of Section 6.2 [28]. At , and it becomes an integer. In that limit the condition is sufficient but no longer necessary, because only the sums have to be nonnegative for to be an integer. For example, is not a polynomial, although its classical value is 1.
At a fixed unitary level , the single exponent , with , classifies a product. The product vanishes when , is finite and nonzero when , and has a pole when . When the prefactor is regular and no summand is singular, only the terms with need to be evaluated, although their sum may still vanish through cancellation. Sums whose terms have poles fall outside this classification, because poles can cancel between terms, and they would need a separate algebraic regularization.
The 6j rule is the standard case in which both polynomiality and regular level support hold [12, 13, 33]. For a classically admissible labelling, the balance makes each unnormalized term of (11) equal to times a quantum multinomial coefficient, so and the Racah sum belong to . If the labelling is also admissible at level , every factorial argument of and of the denominator of is below , so is finite and nonzero, while ! contains the factor once . Those terms vanish, and the contributing range is
The normalization N still carries rational factors and radicals, so polynomiality holds for the sum S and not for the full symbol. The package uses both facts. It computes the Racah sum with integer-polynomial arithmetic, and truncates it to the range (20) before evaluation at a level.
5 Numerical evaluation and accuracy
Numerical evaluation of the sums (3) and (5) has to control the range of the intermediate values and the loss of digits through cancellation. Scaling controls the range while cancellation is handled by an adaptive evaluation. The sum is first evaluated in the cheapest arithmetic, together with an estimate of its own error, and it is repeated in more accurate arithmetic only when that estimate is too large. One such evaluation of the sum is called a pass. We describe these steps at a principal unitary level for unweighted rules, and then how they extend to weighted coupling coefficients and to other targets.
5.1 Scaled representation
For , the level tables store the nonvanishing factorials in the form
The plain and compensated passes use this split representation. The plain pass uses one floating-point mantissa, . The compensated pass also retains a small correction , and approximates the factorial by . These parts are obtained from tables built with 64 extra bits beyond the working precision. Inverse factorials use the same representation, so factorial products combine mantissa multiplications with integer exponent additions. Thus, for one contributing segment, we write
where includes the sign of the first term. The ratio in (14) uses tables of and . If , the running term and partial sum are multiplied by and is increased by 256. These binary rescalings are exact within the normal floating-point range, and they control intermediate growth without using logarithms. The final value is still limited by the range of the output type, and scaling does not recover digits lost to cancellation. A plain pass costs ratio steps, each a product of a few table entries (eight for the symbol), and the compensated pass costs a small constant factor more.
For a short sum with small labels the separate exponents are unnecessary, because the factorials are themselves floating-point numbers far inside the exponent range. A short pass then runs the operations of the plain pass on these unsplit values. Scaling by a power of two does not change a rounding, so the short pass returns the same value as the plain pass, at less than half its cost. A bound on the sum of the exponents of each product decides beforehand whether the short pass applies.
5.2 Cancellation and conditioning
For a nonzero sum , define
as its condition number [28, 36]. Relative perturbations of at most in each term change by at most in relative terms, so measures how strongly the sum amplifies errors in its terms. For unit roundoff , the characteristic error scales are for a plain pass and for a compensated pass [40, 41], to leading order in precision and cancellation. Full bounds also depend on the operation count and on the accuracy of the input terms.
For the computed value of a nonzero sum S, the relative error
measures the absolute error as a fraction of the sum. In Fig. 2 the sum is the 6j symbol W of (11), and its exact value is represented by an independently checked high-precision reference. The relative error is undefined at an exact zero, so zero decisions are tested separately.
The accuracy experiment uses 1209 nonzero inputs selected before evaluation. They comprise 245 equal-spin labels at , 120 random and 40 fusion-boundary samples at each of the levels , and 4 small nonzero values. Each reference is a direct factorial Racah sum, independent of package tables, ratios and recurrences, evaluated at 2048 and 3072 bits and required to agree to 200 decimal digits. Compensation delays the loss of accuracy but eventually loses digits too, whereas the adaptive evaluator of Algorithm 2, which repeats a rejected sum in more accurate arithmetic, keeps the largest relative error at and preserves nonzero values down to . A separate algebraic-number evaluation confirms 5 exact zeros and 10 nonzero controls at adjacent levels, and both the numerical output and the zero query classify all of them correctly.
5.3 Adaptive evaluation and acceptance tests
Each pass produces a candidate value v for the full sum and an estimate B of its absolute error. The estimate is accumulated during the pass from the magnitudes of the terms and partial sums. It accounts for the rounding errors of forming the terms, summing them and applying the normalization. Section A derives the error estimates for the plain pass.
A candidate is accepted at a threshold when and are finite, and . It is then returned as . A computed zero never passes this relative test, so zeros are decided by exact means (Section 5.4).
(a) Cancellation and compensation

(b) Accepted error estimates
Figure 2: Accuracy of the level-k 6j evaluator. (a) Relative error of the plain pass, the compensated pass and the adaptive output for equal spins j at , with the guides and as thin dark lines. (b) Relative error against the estimate for the results accepted from a plain or compensated pass. Points below the diagonal have an error smaller than their estimate. Errors below are drawn at that floor, and triangles in (a) mark errors above the plotting limit.
The adaptive evaluation of Algorithm 2 is a sequence of stages of increasing cost, and a stage is entered only when no earlier one has returned a value. The valuations of Section 4.3 first select the contributing terms and reject a sum with a singular term. When the short pass of Section 5.1 applies it runs first, and otherwise the plain pass forms and adds the scaled terms in working precision. Either is accepted at . If it is rejected, a test for terms that cancel in pairs comes next, because it costs only a few comparisons. The compensated pass repeats the sum with double-word ratios and carries the rounding error of every multiplication and addition through the Horner nesting [40–43]. This lowers the error scale from to , and the compensated pass is accepted at . A sum rejected by both passes either cancels very strongly or cancels exactly. For a 6j symbol, the next stage computes it as one entry of a three-term recurrence, discussed below. If that route is unavailable or declines, the exact checks of Section 5.4 decide whether the sum is zero. A nonzero sum is finally repeated in three- and four-word arithmetic [44] and then in BigFloat arithmetic [45] at doubling precision, until the estimate shows that enough digits survive the cancellation.
The compensated pass has the stricter threshold because its estimate is less conservative than that of the plain pass. Both estimates rest on the assumptions stated in Section A and are not certified enclosures. In the accuracy experiment they held in every case. For all 1033 accepted results in Fig. 2(b) the error stayed below
Algorithm 2 Adaptive evaluation of W at level k
Require: unweighted factorial rule R, level k
Ensure: approximation , or an exact zero
1: keep the terms with error on a pole
2: if no term remains then return 0
3: short pass if it applies, else plain pass
4: if v is accepted at then return v
5: if the terms cancel in pairs then return 0
6: compensated pass in double words
7: if v is accepted at then return v
8: if level reflection proves cancellation then return 0
9: if a 6j recurrence is accepted then return its v
10: if a modular image does not exclude zero then
11: if exact arithmetic gives zero then return 0
12: end if
13: for 3 and 4 words, then bits do
14: plain pass in that arithmetic
15: if v is accepted then return v
16: end for
its estimate and reached at most 0.901 of it. The other 176 results were returned by later stages and are not plotted.
Recurrence relations. The condition number is a property of the sum and not of the coefficient that it represents. Scaling, compensation and wider arithmetic all evaluate the same sum, and only increase the precision at which its cancellation is resolved. For coupling and recoupling coefficients, recurrence relations provide a useful alternative representation. With five labels fixed, the 6j symbols over the admissible values of form a column, which satisfies the quantum analogue of the Schulten–Gordon recurrence [25, 27]
where and are rational functions of a few quantum integers. In the classical case the same recurrence underlies asymptotic expansions of the 6j symbol [46], and a further recursion is known for its square [47]. Propagated in a stable direction [48], the recurrence reaches an entry from the end of its column without forming a cancelling sum. Its error depends on the number of steps and on how small the entry is relative to the largest in the column, and not on . Any of the six labels can be the running one, and the shortest of the six paths from a column end has exactly as many steps as the Racah sum has ratios. A single symbol therefore costs no more steps by recurrence than by summation. The package uses the recurrence in two ways. For a single 6j symbol it is the stage of Algorithm 2 that follows the two passes, and it is declined when the entry is too small relative to the largest in its column. For a whole fusion matrix (fmatrix) it is the primary route, with constant work per entry (Section 8). Coupling coefficients satisfy analogous recurrences in a magnetic label and in the coupled spin [13]. No such recurrence is available for a general factorial rule.
5.4 Exact zero decisions within numerical evaluation
After selection rules and level valuations remove empty or termwise-vanishing cases, write with a regular, nonzero prefactor . Then exactly when the finite sum vanishes, so the square-root normalization need not be constructed. As in adaptive geometric predicates [49], exact arithmetic is used only when floating-point evaluation with an error estimate cannot decide.
The evaluator first looks for structural identities. For instance, equal terms with opposite signs cancel in pairs, and a level-reflection identity can prove cancellation directly. If neither applies, the sum is evaluated in a finite field. Provided the denominators remain invertible, a nonzero residue proves . A zero residue proves nothing, because a nonzero value can map to zero modulo the chosen prime, and the same holds when the modular image cannot be formed. In both cases the sum is returned as zero only after exact confirmation.
The confirming arithmetic follows the target:
• At , integer Horner summation gives , with . Cancellation is exact precisely when .
• At level , an unweighted sum is reduced in the real cyclotomic field of Section 6.2. With , write after cancellation, with . Then
A short sum is decided more cheaply in integers. With its denominators cleared it is an integer combination of powers of , and it vanishes exactly when the polynomial with these coefficients is divisible by the cyclotomic polynomial . For qcg and q3j, the weighted sum is instead tested in , retaining the factors .
• For real or complex q, finite binary components are represented as exact rationals. Horner summation then decides zero at that stored parameter, including integer q-power weights.
If exact arithmetic excludes zero, numerical evaluation continues to higher precision. For unweighted rules, the separate question of vanishing identically in q is settled by an exact polynomial numerator after modular screening.
5.5 Coupling coefficients and other targets
A weighted coupling coefficient at a level is evaluated from (5) by a shorter sequence of stages than Algorithm 2. Its quantum integers are real and correctly rounded, and the phases , with , are read from a table instead of being formed as powers of a rounded q. The first stage is already a compensated pass, which keeps each term, its phase and the running sum in double words and is accepted for up to about . For larger the coefficient is taken from a recurrence in the magnetic label, and if that declines the sum is repeated in BigFloat arithmetic at doubling precision. A sum that still cancels there is tested for an exact zero (Section 5.4).
The classical target Classical() uses the same sequence of plain and compensated passes, with exact integer evaluation as its final fallback. At real or complex q, the evaluator uses running bounds and wider arithmetic without level classification. Real Float64 tables are built in double words and rounded once per entry. Every kernel evaluates the parameter that was supplied, including its deviation from one. An input intended at high precision must therefore be constructed at that precision, because converting a rounded input does not restore missing digits.
Complex deformation also requires a branch convention. Each quantum integer is the product of the balanced factors (Section 4.3) over the divisors of , and the prefactor takes the principal square root of each separately. Replacing these by the principal square root of their product can change the sign, so comparisons must use the same branches.
6 Exact and symbolic computation
The exact targets construct values and expressions that can be compared without a numerical tolerance. For unweighted sums, Exact(), Exact(k) and Symbolic() select integer, number-field and generic arithmetic, respectively. The coupling functions qcg and q3j support Exact() only (Table 1). The Horner organization of Algorithm 1 is retained with cleared denominators, so the recursion runs on integers or integer polynomials. Division and square roots are postponed until the sum is combined with its prefactor.
6.1 Classical values
At the ratios are rational numbers, and a backward Horner recursion accumulates the sum as a numerator and denominator in integer arithmetic, with one reduction at the end. The prefactor and the first term are reduced through prime valuations (Section 4.2), so common factors cancel before large products are formed. The result is a sign and a reduced rational number under a square root, . The listing below illustrates the classical exact target:
a = q6j(Exact(), 1, 1, 1, 1, 1, 1) # == 1//6 b = q3j(Exact(), 2, 2, 0, 1, -1, 0) # == -√(1//5) cg0 = qcg(Exact(), 1//2, 1//2, 1//2, -1//2, 0, 0) @assert b^2 == 1//5 @assert cg0^2 == 1//2
6.2 Values at a level
At , exact values use the coordinate introduced in Section 4.3. Quantum integers are symmetric Laurent polynomials in , so by the identity (19) they are polynomials in with integer coefficients. In particular, , where is a Chebyshev polynomial of the second kind. Pairing inverse roots of unity gives the real cyclotomic factors , , the minimal polynomials of . Their exponents in a factorial product are from (18). At level the coordinate specializes to
the maximal real subfield of , of degree , where is Euler's totient [39]. The exact result of the sum (3) evaluated at a level therefore takes the form
where the odd exponents identify the factors retained under the square root.
The kernel clears denominators in the Horner recursion of Algorithm 1. Write the signed ratio (14) as , with integer polynomials in x. Starting from , set
from the last term to the first, using the previous values of P and Q in both updates. Reduction modulo keeps the degree below for any number of terms, although the integer coefficients can still grow. The final division is performed once in . If specialization makes a shared denominator factor vanish, the recursion is repeated before reduction so that common factors can be cancelled exactly. Zero decisions then use the resulting algebraic value.
For a given set of spins js, its exact value in x, its nested-radical form and its numerical approximation are separate requests:
js = (1,1,1,1,1,1) v = q6j(Exact(10), js...) # r = radical(v) # @assert numeric_value(v) q6j(Level(10), js...)
A nested-radical form does not always exist. Since is abelian, a classical Galois-theoretic argument gives the criterion [39, 50].
Proposition 2. Let v be a real algebraic number with . Then v is expressible by rational numbers and nested real square roots if and only if is a power of two.
Proof. Every subfield of the abelian field is Galois over with abelian group. If is a power of two, a chain of subgroups realizes as a tower of quadratic extensions, and the real square root of adds at most one step. Conversely, if lies in a tower of quadratic extensions, then is a subfield of that tower and its degree divides a power of two.
The function radical returns NoRadical when the criterion fails or the descent exceeds its budget, and the result records which of the two occurred.
Remark 3 (Exact arithmetic and identities). Exact level values support addition, multiplication and exact equality, and values with different radical classes are collected in ExactXSum. Equality is decided structurally or, when necessary, by comparing exact algebraic numbers in the chosen real embedding with Nemo [38]. Fusion rules, dimension identities and coherence relations of , such as orthogonality and the Biedenharn–Elliott (pentagon) identity [13,33], can therefore be verified exactly. Section 7.2 gives examples. Exact arithmetic also distinguishes a vanishing recoupling coefficient from a small numerical value, and the query iszero_at makes this decision without constructing the algebraic value (Section 5.4).
6.3 Generic expressions
Symbolic() retains the factorial rule without expanding it. An explicit request expands it either in x, with x_form, or as cyclotomic factors in q, with phi_form, which exhibits the multiplicative structure of Section 4.2 directly.
s = q6j(Symbolic(), js...) f = x_form(s) # g = phi_form(s) #
Here is a cyclotomic polynomial in itself, so the factor of Section 4.2 appears as . At , that is , the expression gives , and at it reduces to the level value above. A generic identity proved in therefore holds at every level at which its denominators are nonzero and its branches compatible, and it does not have to be proved again level by level. The generic identity in Section 7.2 illustrates this use.
7 Computational workflows
The previous sections showed individual calls of the public interface. Here we give examples that evaluate families, check exact identities, construct an observable in a new coupling basis and define a new finite sum.
7.1 Batches, families and precision
A vector of labels can be evaluated in one call, which shares the tables of its target and gives each worker thread its own scratch storage. Sequential scalar calls can also reuse one workspace (EvaluationWorkspace). In the listing below the target also requests wider precision, and fmatrix computes a whole family through the recurrence (25).
using QRecoupling, LinearAlgebra L = collect(all_6j(k = 10)) # 17,732 labels w = q6j(L; k = 10) # one batch wb = q6j(Level(10; T = BigFloat), js...) F, e, f = fmatrix(40, 35, 30, 45; k = 300) @assert w[5] == q6j(Level(10), L[5]...) @assert transpose(F) * F ≈ I
The first assertion compares a batch entry with its scalar evaluation. The second checks orthogonality of the matrix, whose residual is about .
7.2 Fusion data and exact identities
At level , the integer-spin sector contains the Fibonacci fusion rule [51]. Writing , the package convention gives
Signs of individual entries depend on the fusion-basis gauge, fixed here by (8), so comparison with another anyon convention must account for it [15, 51].
F, rows, cols = fmatrix(1, 1, 1, 1; k=3) Fref = [1/ -1/ ; -1/ -1/ ] @assert rows == cols == [0, 1] @assert F ≈ Fref @assert transpose(F)*F ≈ I d = qdim(Exact(3), 1) @assert iszero(d^2 - d - 1)
The listing checks the channel ordering, the convention of the numerical matrix and the exact value of the dimension.
At level , for example, we verified that the residual of the Biedenharn–Elliott identity vanishes exactly for each of the 37208 ordered labellings whose right-hand side is admissible.
Recoupling identities [13, 33] can be checked before any level is chosen. With , the orthogonality relation becomes a rational-function identity in , which can be established for generic .
ds(j) = x_form(qdim(Symbolic(), j)) ws(e) = x_form(q6j(Symbolic(), 1, 1, e, 1, 1, 1)) lhs = sum(ds(e) * ws(e)^2 for e in 0:2) @assert lhs == ds(1)^-1
The assertion compares two rational functions of x, so it proves the orthogonality relation for these labels at generic q.
7.3 An intermediate-channel observable
A recoupling matrix also transports observables between coupling bases. At level , the quantum Casimir of the intermediate channel , after a shift and rescaling, has eigenvalues , where . In the other coupling basis, the operator is tridiagonal, which is the recurrence (25) written as an eigenvalue equation [13, 27, 52, 53]. The following example checks this property.
F, e, f = fmatrix(2, 3, 2, 3; k=20) K = F * Diagonal() * transpose(F) offband = [K[i,j] for i in axes(K,1) for j in axes(K,2) if abs(i-j) > 1] @assert maximum(abs, offband) < 1e-12 @assert transpose(F)*F ≈ I
7.4 A user-defined terminating series
A finite sum of factorial products can be constructed and evaluated within the package. We illustrate this with the series (4). For and integers , its summand is
(31)
Replacing each factorial by its quantum counterpart gives the input below for its factorial rule. A prefactor pair denotes , and a factors triple denotes . For example, supplies .
n, a, b = 3, 2, 4 rule = FactorialSum(0:n; prefactor=[n=>1, b-1=>1, a-1=>-1], factors=[(1,a-1,1), (-1,n,-1), (1,b-1,-1), (1,0,-1)], alternating=true) @assert qeval(Exact(), rule) == 1//5 real_value = qeval(At(0.8), rule) level_value = qeval(Exact(10), rule) @assert numeric_value(level_value) ≈ qeval(Level(10), rule) expr = x_form(qeval(Symbolic(), rule))
The classical request returns . At level 10 the value is , with all factorial arguments below , so the specialization is regular. The real and symbolic calls use the same factorial deformation defined in Section 3. Changing the rule selects another sum within (3) and requires no new evaluation kernel.
8 Performance
This section reports benchmarks of QRecoupling.jl. They measure the cost of single coefficients, of matrices and batches, of exact output, and of setup. All measurements use QRecoupling 0.5.1, Julia 1.12.4 and an Apple M2 Pro, on one thread unless stated otherwise. Scalar timings are medians of 41 samples per input, where a sample is the mean of 50 consecutive warmed calls, because a single call at small spins is too short to time reliably. Labels are prepared outside the timed call, and compilation and first table construction are measured separately. Figures show the median and interquartile range across inputs. Every timed output is compared with an independent high-precision reference, and the relative-error target is , the acceptance threshold in Section 5.3.
8.1 Scalar coefficients
Figure 3 compares classical q3j and q6j with WIGXJPF 1.14 [22] and WignerSymbols.jl 2.0.0, all returning Float64. At the smallest spins QRecoupling and WIGXJPF are comparable, with medians within ten per cent of each other at . The ratio of medians then grows in favour of QRecoupling, to about 2.3 for 3j and 2.6 for 6j at , and to 6.4 and 10 at (Table 2). Up to nearly all sums take the short pass (Section 5.1), which explains the step in the QRecoupling curves between 20 and 50. The result cache of WignerSymbols is cleared before every
(a) Classical 3j

(b) Classical 6j

Figure 3: Classical scalar cost. At each cutoff, 80 distinct ordered admissible inputs are sampled with largest spin in . Exact zeros are excluded without replacement across all cutoffs. Exact routes include Float64 conversion.
call, so its samples are single calls, and the arithmetic tables of all routes stay warm.
Table 2: Median time per call (μs) at selected spin cutoffs from Fig. 3. QR denotes QRecoupling, WIG denotes WIGXJPF and WS denotes WignerSymbols. “Exact” includes construction and Float64 conversion.
| Symbol | QR | QR exact | WIG | WS exact | |
|---|---|---|---|---|---|
| 3j | 5 | 0.0692 | 1.85 | 0.08 | 2.48 |
| 3j | 50 | 0.212 | 2.74 | 0.48 | 6.44 |
| 3j | 500 | 3.52 | 12.6 | 22.4 | 83.7 |
| 6j | 5 | 0.0833 | 1.83 | 0.117 | 2.21 |
| 6j | 50 | 0.227 | 3.39 | 0.729 | 5.75 |
| 6j | 500 | 4.07 | 19 | 42 | 94.2 |
The references are exact rational factorial sums times square roots of rational numbers, evaluated at 512 and 768 bits and agreeing to 100 decimal digits. Against them the largest relative errors of the default route are for and for .
Quantum deformation. The deformed 6j experiment extends to (Fig. 4), evaluating the same 80 random admissible inputs per cutoff at real , at the principal level , and at complex . These values of keep the sampled coefficients within floating-point range. Together with the further real deformations of Table 3, all 2720 outputs are nonzero and meet the error target, with largest error . The references are direct Racah sums at 1024 and 1536 bits agreeing to 80 decimal digits, with complex prefactors on the branch of Section 5.5. At the largest cutoff the level median is and the complex median . The complex route is slower because, at a small rational multiple of , many balanced factors of lie close to the branch cut of their square roots and need the double-word pass.
The companion q3j experiment uses the same deformations and reference precisions, with independent weighted factorial sums. All 1920 outputs through meet the error target, with largest error . The function qcg shares this kernel and differs from q3j by the factor in (7), so the experiment covers both functions, and the convention is checked independently by a spin-half coproduct identity. At about half of the level inputs have , and the compensated first stage of Section 5.5 keeps the level median at .
Table 3 compares with QWignerSymbols.jl 0.1.0 at positive real . That package receives to match conventions, and each reference uses the parameter that its route stores. At both packages meet the target on every input, and at QRecoupling's median is about 380 times faster. At QWignerSymbols meets the target on only a fraction of the inputs, so no timing is reported for it there.
8.2 Matrices, batches and threads
The function fmatrix computes each column of an F-matrix by the recurrence (25). A column is propagated from both ends of its admissible range, matched where the two runs meet, and orthogonality fixes the
(a) Quantum 6j

(b) Quantum 3j

Figure 4: Costs across numerical deformations: (a) 6j symbols through ; (b) quantum 3j symbols through . Each experiment samples 80 distinct ordered admissible inputs per cutoff, shared across its three deformations, with largest spin in and 3j magnetic labels summing to zero. All plotted outputs meet the error target.
Table 3: Median time per call (μs) for real deformation. QR denotes QRecoupling and QWS denotes QWignerSymbols. Pass counts use relative error at most , and a dash means that some outputs failed this check.
| QR | QWS | QWS passes | ||
|---|---|---|---|---|
| 0.8 | 20 | 0.326 | 124 | 80/80 |
| 0.8 | 50 | 0.484 | — | 1/80 |
| 0.95 | 20 | 0.327 | 124 | 80/80 |
| 0.95 | 50 | 0.458 | — | 62/80 |
| 0.999 | 20 | 0.33 | 126 | 80/80 |
| 0.999 | 50 | 0.497 | — | 78/80 |
normalization. Each step costs a few multiplications, whereas a scalar entry costs a sum, or a recurrence path of its own, whose length grows with the spins. The columns also share most of the recurrence coefficients, because only one factor depends on the column label. At channels an entry costs 0.0248 μs classically and 0.025 μs at a level, between 96 and 127 times less than in a loop of scalar fsymbol calls, even when that loop reuses an EvaluationWorkspace (Table 4). The recurrence therefore saves far more than reusing scratch storage, although small matrices have less work over which to spread the setup cost.
The comparison covers classical and principal-level targets with outer spins and through , at level , which gives channels for both shapes. Each route is timed by the median of 9 complete calls, including allocation of the output. All entries agree with both scalar loops, and 708 entries across 32 matrices, including edges and centres, were checked against independent factorial references evaluated at 1024 and 1536 bits. The largest entry error is , and the largest orthogonality defect is .
For independent coefficients, a batch shares tables and runs on threads. With admissible inputs at and spins at most 100, the cost falls from 363.7 to 76.6 ns per coefficient on 6 threads, a factor of 4.75. This gain comes from parallel execution, since on one thread a batch of this size costs slightly more than the scalar loop. Each thread count uses a fresh process, unpinned threads and the median of 9 warmed calls.
8.3 Exact workloads
Exact values. A single Exact(k) value of a 6j symbol takes a median of 17.5 μs at with all spins equal to 1, and 98.6 μs and 711 μs at and with all spins equal to 4, over 21 warmed calls. At fixed spins the cost follows the degree of the number field rather than the level itself. Outside the timing, independent factorial sums in a cyclotomic field verify 46 such values exactly.
Zero decisions. The zero query, the exact output and the numerical output agree on every one of the 40754 ordered admissible 6j inputs at levels 1–10. Independent factorial sums in a cyclotomic field classify these inputs into 293 zeros and 40461 nonzeros, with selection-rule
Table 4: Left: median cost per entry (μs) of complete equal-spin -matrices with channels. “Scalar” evaluates every fsymbol independently and “Scalar + work” reuses a workspace, and every route allocates its output matrix. Right: median ns per coefficient for batches of classical or level-400 symbols, with the level gain relative to the one-thread batch.
| n | fmatrix | Scalar | Scalar + work |
|---|---|---|---|
| Classical | |||
| 21 | 0.03 | 0.121 | 0.12 |
| 101 | 0.0244 | 0.418 | 0.429 |
| 401 | 0.0248 | 2.92 | 2.39 |
| Level | |||
| 21 | 0.0341 | 0.138 | 0.139 |
| 101 | 0.0265 | 0.412 | 0.388 |
| 401 | 0.025 | 3.71 | 3.17 |
zeros excluded. The query (iszero_at) settles 245 of the zeros by structural identities and confirms the other 48 exactly, and Table 5 gives the cost of each path.
Further checks cover classical and weighted coupling coefficients and nearby levels, with both zeros and nonzeros, and exact confirmation rejects all 6 nonzero sums constructed to vanish modulo the screening prime. Nonzero values survive down to in Float64. A value near underflows in that type, while the exact query and a 512-bit evaluation both report it as nonzero.
Table 5: Zero-decision costs (μs): median across n inputs, selected with a fixed seed within each class, of 21 warmed samples of 20 calls each. The columns are the query iszero_at, construction of the Exact(k) output followed by iszero, and evaluation of the numerical coefficient.
| Class | n | Query | Exact | Numeric |
|---|---|---|---|---|
| Structural zero | 64 | 0.429 | 10.7 | 0.319 |
| Other zero | 48 | 0.747 | 11.6 | 0.432 |
| Nonzero | 64 | 0.231 | 19.6 | 0.106 |
Setup. Loading the package takes a median of 0.706 s over 50 fresh processes. Ten first-call operations, each measured in 5 separate processes after loading, take between 0.594 and 6.67 s including compilation and setup (installation and precompilation excluded). Once compiled, a new level as large as needs 11 ms to build its tables, and the tables occupy 1.2 MiB.
9 Discussion and outlook
QRecoupling connects the algebraic structure of finite factorial sums with their evaluation. A coefficient is stored as a factorial rule, and its cyclotomic exponents show which factors cancel within a product and which terms contribute at a unitary level. The cancellation that remains between terms is handled by adaptive arithmetic, and exact tests separate an algebraic zero from a small nonzero value. For coupling and recoupling coefficients, recurrences give a second representation that avoids this cancellation and computes related coefficients together. Numerical, exact and symbolic results come from one interface, and the outputs available depend on the coefficient and on the deformation.
| Threads | Classical | Level | Level gain |
|---|---|---|---|
| 1 | 419.5 | 363.7 | 1.00 |
| 2 | 215.3 | 184.4 | 1.97 |
| 4 | 117.4 | 103.8 | 3.50 |
| 6 | 88.7 | 76.6 | 4.75 |
These local data serve calculations in quantum geometry, topology and quantum many-body physics, where coefficients are rarely used one at a time. Accurate individual coefficients do not by themselves guarantee an accurate observable. The numerical error estimates are conditional, and further cancellation can occur when coefficients enter a larger sum. A floating-point zero can also come from underflow, so a claim of algebraic vanishing needs an exact decision. Exact arithmetic removes both ambiguities where it is supported (Table 1), at a cost that grows with integer size, field degree and expression complexity.
The nearest extension is to higher 3nj symbols. The 9j and 15j symbols can be written as sums of products of 6j symbols, so every route described here applies to their terms, and the new task is to control the accuracy of the outer sum. Higher-rank quantum groups would require new techniques, because their recoupling coefficients carry multiplicity labels and have no general formula of the kind used here.
The practical next step is to extend the error estimates and exact checks to complete state sums and tensor-network calculations, as used in the contraction [21] and coarse graining [54, 55] of spin foam models. Small instances evaluated exactly can serve as references for numerical contractions, for tests of recoupling identities and for estimates of truncation error. In larger systems, families of coefficients can be computed together, with precision raised only where it is needed. A complementary application is the study of geometric observables across scales of spin and deformation. Reliable values near zeros and in strongly cancelling regimes support comparison with semiclassical approximations, and they separate physical suppression from numerical loss of significance.
Acknowledgements
The author thanks Hal Haggard for insightful discussions. The author acknowledges support from the Atlantic Association for Research in the Mathematical Sciences (AARMS) and the Natural Sciences and Engineering Research Council of Canada (NSERC).
Software availability
QRecoupling.jl is distributed under the MIT license and requires Julia 1.10 or later. Source and issue tracking are at https://github.com/sethkasante/QRecoupling.jl. Documentation is at https://sethkasante.github.io/QRecoupling.jl/. This article describes version 0.5.1, archived at doi:10.5281/zenodo.23268481, and the measurements were made on that version.
Generative AI assistance
Claude Code and OpenAI Codex assisted in software prototyping, testing and documentation review, and in editing parts of the manuscript. The author reviewed and edited the resulting code and text and takes responsibility for the software and article.
A Error estimate for the plain pass
For the normalized sum , with and , write and for the computed terms and partial sums, initialized exactly at 1. Then . Assume at most relative error factors , , per step used to form a term, including the ratio calculation. Here is unit roundoff. Assume no overflow or underflow, exact rescaling, and . With , the absolute error satisfies
(32)
The first sum accounts for forming the terms, and the second accounts for adding them. Both are accumulated during the pass.
For the derivation, standard product-error estimates [36] give . Each addition satisfies , so
Summing these addition residuals telescopes. Adding the term errors proves (32).
To estimate the error in the full coefficient, scale (32) by the absolute segment factor and include errors in the prefactor, first term, combination of segments and final rounding. The resulting computed estimate is B in Section 5.3. If B bounds the absolute error and , the reverse triangle inequality gives
Thus the acceptance test , , implies , with the relative error defined by (24).
This model covers the plain pass under the stated assumptions. It does not certify transcendental table values, rounding in the computation of B, or the separate fallback routes.
References
[1] A. R. Edmonds, Angular Momentum in Quantum Mechanics, Princeton University Press (1957).
[2] G. Ponzano and T. Regge, Semiclassical limit of Racah coefficients, in Spectroscopic and Group Theoretical Methods in Physics, F. Bloch (ed.), North-Holland (1968), pp. 1–58.
[3] C. Rovelli, Quantum Gravity, Cambridge Monographs on Mathematical Physics, Cambridge University Press (2004), doi:10.1017/CBO9780511755804.
[4] J. C. Baez and J. W. Barrett, The quantum tetrahedron in 3 and 4 dimensions, Advances in Theoretical and Mathematical Physics 3 (1999), 815–850, doi:10.4310/ATMP.1999.v3.n4.a3.
[5] S. Mizoguchi and T. Tada, Three-dimensional gravity from the Turaev–Viro invariant, Physical Review Letters 68 (1992), 1795–1798, doi:10.1103/PhysRevLett.68.1795.
[6] S. Major and L. Smolin, Quantum deformation of quantum gravity, Nuclear Physics B 473 (1996), 267–290, doi:10.1016/0550-3213(96)00259-3.
[7] H. M. Haggard, M. Han, W. Kamiński and A. Riello, SL(2, C) Chern–Simons theory, a non-planar graph operator, and 4D quantum gravity with a cosmological constant: semiclassical geometry, Nuclear Physics B 900 (2015), 1–79, doi:10.1016/j.nuclphysb.2015.08.023.
[8] M. Dupuis and F. Girelli, Observables in loop quantum gravity with a cosmological constant, Physical Review D 90 (2014), 104037, doi:10.1103/PhysRevD.90.104037.
[9] M. Dupuis, F. Girelli and E. R. Livine, Deformed spinor networks for loop gravity: towards hyperbolic twisted geometries, General Relativity and Gravitation 46 (2014), 1802, doi:10.1007/s10714-014-1802-3.
[10] E. R. Livine, 3d quantum gravity: coarse-graining and q-deformation, Annales Henri Poincaré 18 (2017), 1465–1491, doi:10.1007/s00023-016-0535-0.
[11] M. Han, C.-H. Hsiao and Q. Pan, Quantum group intertwiner space from quantum curved tetrahedron, Classical and Quantum Gravity 41 (2024), 165008, doi:10.1088/1361-6382/ad5f71.
[12] V. G. Turaev and O. Y. Viro, State sum invariants of 3-manifolds and quantum 6j-symbols, Topology 31 (1992), 865–902.
[13] A. N. Kirillov and N. Yu. Reshetikhin, Representations of the algebra , q-orthogonal polynomials and invariants of links, in Infinite Dimensional Lie Algebras and Groups, Advanced Series in Mathematical Physics 7, World Scientific (1989), pp. 285–339.
[14] N. Reshetikhin and V. G. Turaev, Invariants of 3-manifolds via link polynomials and quantum groups, Inventions Mathematicae 103 (1991), 547–597, doi:10.1007/BF01239527.
[15] A. Kitaev, Anyons in an exactly solved model and beyond, Annals of Physics 321 (2006), 2–111.
[16] M. A. Levin and X.-G. Wen, String-net condensation: a physical mechanism for topological phases, Physical Review B 71 (2005), 045110.
[17] P. Donà and G. Sarno, Numerical methods for EPRL spin foam transition amplitudes and Lorentzian recoupling theory, General Relativity and Gravitation 50 (2018), 127, doi:10.1007/s10714-018-2452-7.
[18] F. Gozzini, A high-performance code for EPRL spin foam amplitudes, Classical and Quantum Gravity 38 (2021), 225010, doi:10.1088/1361-6382/ac2b0b.
[19] S. Singh and G. Vidal, Tensor network states and algorithms in the presence of a global SU(2) symmetry, Physical Review B 86 (2012), 195114, doi:10.1103/PhysRevB.86.195114.
[20] R. N. C. Pfeifer, P. Corboz, O. Buerschaper, M. Aguado, M. Troyer and G. Vidal, Simulation of anyons with tensor network algorithms, Physical Review B 82 (2010), 115126, doi:10.1103/PhysRevB.82.115126.
[21] S. K. Asante and S. Steinhaus, Efficient tensor network algorithms for spin foam models, Physical Review D 110 (2024), 106018, doi:10.1103/PhysRevD.110.106018.
[22] H. T. Johansson and C. Forssén, Fast and accurate evaluation of Wigner 3j, 6j, and 9j symbols using prime factorization and multiword integer arithmetic, SIAM J. Sci. Comput. 38 (2016), A376–A384, doi:10.1137/15M1021908.
[23] L. Wei, Unified approach for exact calculation of angular momentum coupling and recoupling coefficients, Computer Physics Communications 120 (1999), 222–230, doi:10.1016/S0010-4655(99)00232-5.
[24] J. Rasch and A. C. H. Yu, Efficient storage scheme for precalculated Wigner 3j, 6j and Gaunt coefficients, SIAM Journal on Scientific Computing 25 (2004), 1416–1428, doi:10.1137/S1064827503422932.
[25] K. Schulten and R. G. Gordon, Exact recursive evaluation of 3j- and 6j-coefficients for quantum-mechanical coupling of angular momenta, Journal of Mathematical Physics 16 (1975), 1961–1970.
[26] J. H. Luscombe and M. Luban, Simplified recursive algorithm for Wigner 3j and 6j symbols, Physical Review E 57 (1998), 7274–7277.
[27] Y. U. Taylor and C. T. Woodward, 6j symbols for and non-Euclidean tetrahedra, Selecta Mathematica 11 (2005), 539–571, arXiv:math/0305113.
[28] S. K. Asante, Deferred cyclotomic representation for stable and exact evaluation of q-hypergeometric series, SciPost Phys. Core 9, 059 (2026), doi:10.21468/SciPostPhysCore.9.3.059, arXiv:2604.13196.
[29] V. G. Drinfeld, Quantum groups, in Proceedings of the International Congress of Mathematicians (Berkeley, 1986), American Mathematical Society (1987), pp. 798–820.
[30] M. Jimbo, A q-difference analogue of and the Yang–Baxter equation, Letters in Mathematical Physics 10 (1985), 63–69, doi:10.1007/BF00704588.
[31] C. Kassel, Quantum Groups, Graduate Texts in Mathematics 155, Springer (1995), doi:10.1007/978-1-4612-0783-2.
[32] D. A. Varshalovich, A. N. Moskalev and V. K. Khersonskii, Quantum Theory of Angular Momentum, World Scientific (1988).
[33] L. H. Kauffman and S. L. Lins, Temperley–Lieb Recoupling Theory and Invariants of 3-Manifolds, Annals of Mathematics Studies 134, Princeton University Press (1994).
[34] J. S. Carter, D. E. Flath and M. Saito, The Classical and Quantum 6j-Symbols, Mathematical Notes 43, Princeton University Press (1995).
[35] T. Regge, Symmetry properties of Racah's coefficients, Il Nuovo Cimento 11 (1959), 116–117, doi:10.1007/BF02724914.
[36] N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, Society for Industrial and Applied Mathematics (2002).
[37] J. Bezanson, A. Edelman, S. Karpinski and V. B. Shah, Julia: a fresh approach to numerical computing, SIAM Review 59 (2017), 65–98, doi:10.1137/141000671.
[38] C. Fieker, W. Hart, T. Hofmann and F. Johansson, Nemo/Hecke: computer algebra and number theory packages for the Julia programming language, Proceedings of ISSAC (2017), doi:10.1145/3087604.3087611.
[39] L. C. Washington, Introduction to Cyclotomic Fields, second edition, Graduate Texts in Mathematics 83, Springer (1997).
[40] T. Ogita, S. M. Rump and S. Oishi, Accurate sum and dot product, SIAM Journal on Scientific Computing 26 (2005), 1955–1988.
[41] P. Langlois, S. Graillat and N. Louvet, Compensated Horner scheme, Dagstuhl Seminar Proceedings 05391 (2006), doi:10.4230/DagSemProc.05391.3.
[42] T. J. Dekker, A floating-point technique for extending the available precision, Numerische Mathematik 18 (1971), 224–242.
[43] M. Joldes, J.-M. Muller and V. Popescu, Tight and rigorous error bounds for basic building blocks of double-word arithmetic, ACM Transactions on Mathematical Software 44 (2017), 15, doi:10.1145/3121432.
[44] Y. Hida, X. S. Li and D. H. Bailey, Algorithms for quad-double precision floating point arithmetic, Proceedings of the 15th IEEE Symposium on Computer Arithmetic (2001), 155–162, doi:10.1109/ARITH.2001.930115.
[45] L. Fousse, G. Hanrot, V. Lefèvre, P. Pélissier and P. Zimmermann, MPFR: a multiple-precision binary floating-point library with correct rounding, ACM Transactions on Mathematical Software 33 (2007), 13, doi:10.1145/1236463.1236468.
[46] M. Dupuis and E. R. Livine, The 6j-symbol: recursion, correlations and asymptotics, Classical and Quantum Gravity 27 (2010), 135003, doi:10.1088/0264-9381/27/13/135003.
[47] V. Bonzom and E. R. Livine, A new recursion relation for the 6j-symbol, Annales Henri Poincaré 13 (2012), 1083–1099, doi:10.1007/s00023-011-0143-y.
[48] W. Gautschi, Computational aspects of three-term recurrence relations, SIAM Review 9 (1967), 24–82.
[49] J. R. Shewchuk, Adaptive precision floating-point arithmetic and fast robust geometric predicates, Discrete & Computational Geometry 18 (1997), 305–363, doi:10.1007/PL00009321.
[50] P. L. Wantzel, Recherches sur les moyens de reconnaître si un problème de géométrie peut se résoudre avec la règle et le compas, Journal de Mathématiques Pures et Appliquées 2 (1837), 366–372.
[51] C. Nayak, S. H. Simon, A. Stern, M. Freedman and S. Das Sarma, Non-Abelian anyons and topological quantum computation, Reviews of Modern Physics 80 (2008), 1083–1159, doi:10.1103/RevModPhys.80.1083.
[52] R. Askey and J. Wilson, A set of orthogonal polynomials that generalize the Racah coefficients or 6-j symbols, SIAM Journal on Mathematical Analysis 10 (1979), 1008–1016, doi:10.1137/0510092.
[53] P. Terwilliger, Leonard pairs and the q-Racah polynomials (2003), arXiv:math/0306301.
[54] S. K. Asante, B. Dittrich and S. Steinhaus, Spin foams, refinement limit, and renormalization, in Handbook of Quantum Gravity, C. Bambi, L. Modesto and I. Shapiro (eds.), Springer (2023), pp. 1–37, doi:10.1007/978-981-19-3079-9_106-1.
[55] B. Dittrich, S. Mizera and S. Steinhaus, Decorated tensor network renormalization for lattice gauge theories and spin foam models, New Journal of Physics 18 (2016), 053009, doi:10.1088/1367-2630/18/5/053009.