IntegrateUnitary.jl Documentation

Welcome to the documentation for IntegrateUnitary.jl, a generic symbolic integration engine for random matrices and quantum states.

Getting Started

IntegrateUnitary.jl is designed to make "back-of-the-envelope" calculations in Random Matrix Theory and Quantum Information exact and automated.

Installation

using Pkg
Pkg.add(url="https://github.com/iitis/IntegrateUnitary.jl")

Reproducible Setup From a Checkout

For paper-grade reproducibility, use a tagged checkout (for this manuscript: v1.0.0) and instantiate the pinned project environments used by the examples and benchmarks:

using Pkg
Pkg.activate("examples"); Pkg.instantiate()
Pkg.activate("benchmarks"); Pkg.instantiate()

This uses the versioned Manifest.toml files in examples/ and benchmarks/.

The @integrate Macro

For more intuitive symbolic integration, IntegrateUnitary.jl provides the @integrate macro. It automatically identifies random matrices based on the measure and manages variable declarations.

@integrate expr measure

[!TIP] Symbol Scope and Redefinition: The macro manages a persistent symbolic state. If a symbol is used in one context (e.g., as a random matrix for dU) and then in another (e.g., as a constant for dO), the macro automatically re-binds it to the correct type. This "Safety Rebind" prevents silent mathematical errors during sequential execution.

Common Interface

The primary way to interact with IntegrateUnitary.jl is through the integrate function. It provides a unified interface for all supported groups and ensembles.

integrate(expr, measure)
  • expr: A symbolic expression (e.g., product of SymbolicMatrix elements) or an array of such expressions.
  • measure: A measure object defining the group/ensemble and its dimension (e.g., dU(d), dO(d), dGUE(d)).

Choosing a Measure

If you want to average over…MeasurePage
Generic random unitary matricesdU(d)Unitary Integration
Special unitary (balanced polynomials)dSU(d)Unitary Integration
Real orthogonal matricesdO(d)Orthogonal & Symplectic
Symplectic matrices ($d$ even)dSp(d)Orthogonal & Symplectic
Haar-random unitary matrices (CUE)dCUE(d)Circular Ensembles
Symmetric unitary matrices (COE)dCOE(d)Circular Ensembles
Self-dual unitary matrices (CSE)dCSE(d)Circular Ensembles
Hermitian random matricesdGUE(d) / dGOE(d) / dGSE(d)Gaussian Ensembles
Non-Hermitian random matricesdGinUE(d) / dGinOE(d) / dGinSE(d)Gaussian Ensembles
Random permutation matricesdPerm(d)Permutation Groups
Centered permutation matricesdCPerm(d)Permutation Groups
Random pure statesdPsi(d)Pure States
Orthonormal $k$-frames (Stiefel)dStiefel(d, k)Stiefel Manifolds
Independent diagonal phasesdDiagUnitary(d)Diagonal Unitaries
Moments up to order $t$ onlydDesign(d, t)Unitary Integration

Manual

API Reference

See the API Reference for detailed function signatures.