API Reference
This page details the public API for QRecoupling.jl. Internal evaluations are abstracted away to provide a clean, unified interface.
Core Recoupling Symbols
The master dispatchers for evaluating $3j$ and $6j$ symbols. The computational regime is dynamically routed based on the provided target: integer level $k$ (Turaev-Viro), parameter $q$ (complex analytic), or $q=1$ (classical Ponzano-Regge limit). Precision is controlled via the exact boolean flag.
QRecoupling.q6j — Function
q6j(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, eager::Bool=false, T=Float64)Returns the Quantum 6j-symbol.
- If
kandqare omitted, returns the abstractDCRobject. - If
kis provided, projects to the root of unity (Float64 by default, Cyclotomic ifexact=true). - If
q=1, computes the exact classical Ponzano-Regge limit. - If
eager=true, bypasses DCR construction for raw speed (only valid for root of unityk).
QRecoupling.q3j — Function
q3j(j1, j2, j3, m1, m2, m3; k=nothing, q=nothing, exact::Bool=false, eager::Bool=false, T=Float64)Returns the quantum Wigner 3j-symbol.
Other TQFT Tensors
Composite tensors and network invariants used in the construction of 3D TQFTs, spin foam models, and string-net models.
QRecoupling.qdim — Function
qdim(j; k=nothing, q=nothing, exact::Bool=false, T=Float64)Quantum dimension [2j+1]_q.
QRecoupling.rmatrix — Function
rmatrix(j1, j2, j3; k=nothing, q=nothing, exact::Bool=false, T=ComplexF64)Returns the R-matrix phase (braiding eigenvalue) for j1, j2 crossing into j3.
QRecoupling.fsymbol — Function
fsymbol(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, T=Float64)Unitary crossing matrix element: √([d3][d6]) * {6j}.
QRecoupling.gsymbol — Function
gsymbol(j1, j2, j3, j4, j5, j6; k=nothing, q=nothing, exact::Bool=false, T=Float64)Tetrahedrally symmetric invariant: √(Π[di]) * {6j}.
Generic Series & Universal Evaluation
QRecoupling.jl separates algebraic construction from field evaluation. These functions allow you to construct custom $q$-hypergeometric series and project abstract Deferred Cyclotomic Representation (DCR) objects into concrete target fields.
QRecoupling.build_dcr! — Function
build_dcr!(pref_func, base_func, ratio_func, z_min, z_max; kwargs...)The master DCR compiler. Generates the full combinatorial skeleton of an arbitrary sequence by orchestrating closures over a highly optimized CycloBuffer.
Keyword Arguments:
extract_radical::Bool(defaultfalse): If true, searches the prefactor for perfect squares and separates them into therootandradicalfields.alternating_sign::Bool(defaultfalse): If true, automatically injects a (-1)^z term into the sequence (standard for recoupling invariants).
QRecoupling.build_dcr — Function
build_dcr(pref_func, base_func, ratio_func, z_min, z_max; kwargs...)The master DCR compiler. Generates the full combinatorial skeleton of an arbitrary sequence.
QRecoupling.project_dcr — Function
project_dcr(dcr::DCR; k=nothing, q=nothing, exact::Bool=false, T::Type=Float64)Universal evaluation API for a DCR.
- Classical Limit: Pass
q = 1. - Root of Unity (TQFT): Pass
k(integer level). - Complex Analytic: Pass
q(complex or real parameter). - Precision is controlled by
exact(Float64 vs Rational/Cyclotomic).
Memory & Cache Management
When changing the topological level $k$ drastically, performing exact computations in cyclotomic fields, or benchmarking tight loops, it is recommended to clear these caches to free RAM.
QRecoupling.empty_caches! — Function
empty_caches!()Useful for freeing RAM during long interactive sessions or resetting state for benchmarking.