Version 1.0 - Created: May 28, 2025
This document outlines the theoretical foundation and implementation design for the intertwiner module within the packages/quantum library. The module ports existing intertwiner functionality from src/ and lib/ directories into the unified quantum framework.
In Loop Quantum Gravity and spin network theory, an intertwiner is an SU(2)-invariant tensor that ensures gauge invariance at network nodes. For a node with edges labeled by spins $j_1, j_2, \ldots, j_n$, an intertwiner maps:
$\mathcal{I}: \mathcal{H}{j_1} \otimes \mathcal{H}{j_2} \otimes \cdots \otimes \mathcal{H}_{j_n} \rightarrow \mathbb{C}$
where each $\mathcal{H}_{j_i}$ is a $(2j_i + 1)$-dimensional irreducible representation of SU(2).
The space of all intertwiners at a node is called the intertwiner space:
$\text{Inv}(j_1, j_2, \ldots, j_n) = \text{Hom}{\text{SU}(2)}(\mathcal{H}{j_1} \otimes \mathcal{H}{j_2} \otimes \cdots \otimes \mathcal{H}{j_n}, \mathbb{C})$
This space has finite dimension, which determines the number of independent quantum states at the node.
For a 4-valent node with edge spins $(j_1, j_2, j_3, j_4)$, the intertwiner space dimension is calculated using the recoupling scheme:
$(j_1 \otimes j_2) \otimes (j_3 \otimes j_4) \rightarrow j = 0$
The dimension equals the number of ways to achieve this coupling:
$\dim(\text{Inv}(j_1, j_2, j_3, j_4)) = \sum_{j_{12}} \delta_{j_{12}, j_{34}}$
where:
For 3-valent nodes with spins $(j_1, j_2, j_3)$, the intertwiner space is 1-dimensional if the triangle inequality is satisfied:
$|j_1 - j_2| \leq j_3 \leq j_1 + j_2$ $|j_2 - j_3| \leq j_1 \leq j_2 + j_3$ $|j_3 - j_1| \leq j_2 \leq j_3 + j_1$
Basis states are constructed using Clebsch-Gordan coefficients:
$|\text{intertwiner}\rangle = \sum_{m_1,m_2,m_3,m_4} \sum_{j_{12}, m_{12}} C_{j_1,m_1;j_2,m_2}^{j_{12},m_{12}} ; C_{j_3,m_3;j_4,m_4}^{j_{12},-m_{12}} ; |j_1,m_1\rangle \otimes |j_2,m_2\rangle \otimes |j_3,m_3\rangle \otimes |j_4,m_4\rangle$
The most common case has 2-dimensional intertwiner space with basis:
Singlet-Singlet Coupling: $|\psi_1\rangle = \frac{1}{2}(|\uparrow\downarrow\uparrow\downarrow\rangle - |\uparrow\downarrow\downarrow\uparrow\rangle - |\downarrow\uparrow\uparrow\downarrow\rangle + |\downarrow\uparrow\downarrow\uparrow\rangle)$
Triplet-Triplet Coupling: $|\psi_2\rangle = \frac{1}{\sqrt{3}}|\uparrow\uparrow\downarrow\downarrow\rangle + \frac{1}{\sqrt{3}}|\downarrow\downarrow\uparrow\uparrow\rangle - \frac{1}{2\sqrt{3}}(\text{mixed terms})$
packages/quantum/src/intertwiner/
├── index.ts # Public API exports
├── types.ts # TypeScript interfaces
├── core.ts # Core dimension calculations
├── basis.ts # Basis state construction
└── tensor.ts # Tensor representation
packages/quantum/__tests__/intertwiner/
├── core.test.ts # Core function tests
├── basis.test.ts # Basis construction tests
└── tensor.test.ts # Tensor representation tests
export interface IntertwinerBasisState {
intermediateJ: number; // Intermediate angular momentum
stateVector: StateVector; // State in tensor product space
recouplingScheme: string; // e.g., "(j1,j2)(j3,j4)"
normalization: number; // Normalization factor
}
export interface IntertwinerSpace {
dimension: number; // Space dimension
basisStates: IntertwinerBasisState[]; // Orthonormal basis
edgeSpins: number[]; // Input edge spins
totalJ: number; // Total angular momentum (0)
}
export interface IntertwinerTensor {
dimensions: number[]; // Edge dimensions (2j+1)
stateVector: StateVector; // Sparse tensor as state vector
basisState: IntertwinerBasisState; // Associated basis information
}
/**
* Calculate intertwiner space dimension
*/
export function calculateDimension(edgeSpins: number[]): number;
/**
* Check triangle inequality for three spins
*/
export function triangleInequality(j1: number, j2: number, j3: number): boolean;
/**
* Get allowed intermediate spins when coupling j1 and j2
*/
export function allowedIntermediateSpins(j1: number, j2: number): number[];
/**
* Construct complete orthonormal basis for intertwiner space
*/
export function constructBasis(edgeSpins: number[]): IntertwinerSpace;
/**
* Construct single basis vector for given intermediate coupling
*/
export function constructBasisVector(
j1: number, j2: number, j3: number, j4: number,
intermediateJ: number
): IntertwinerBasisState;
/**
* Optimized basis for four spin-1/2 edges
*/
export function getFourSpinHalfBasis(): IntertwinerSpace;
/**
* Convert basis state to sparse tensor representation
*/
export function basisToTensor(basis: IntertwinerBasisState): IntertwinerTensor;
/**
* Create intertwiner tensor from edge spins and intermediate J
*/
export function createIntertwinerTensor(
edgeSpins: number[],
intermediateJ: number
): IntertwinerTensor;
angularMomentum/composition.tsangularMomentum/core.tscore/types.tsimport { calculateDimension, constructBasis } from '@quantum/intertwiner';
// Calculate dimension for 4-valent node with spin-1/2 edges
const dimension = calculateDimension([0.5, 0.5, 0.5, 0.5]);
console.log(dimension); // Output: 2
// Construct complete basis
const space = constructBasis([0.5, 0.5, 0.5, 0.5]);
console.log(space.basisStates.length); // Output: 2
lib/core/intertwinerSpace.tstriangleInequality, allowedIntermediateSpins, intertwinerDimensionconstructBasisVector to use quantum module's StateVectorclebschGordanlib/tensor/tensorNode.tsStateVector representationsrc/simulation/ filesTests will be located in the shared packages/quantum/__tests__/intertwiner/ directory to maintain consistency with the existing quantum module testing structure.
__tests__/intertwiner/core.test.ts)__tests__/intertwiner/basis.test.ts)__tests__/intertwiner/tensor.test.ts)lib/ implementationconstructBasisVector using quantum CG coefficientsStateVector operationsStateVectorThe new module will maintain complete API compatibility with existing intertwiner code while providing enhanced functionality through the quantum framework's infrastructure.