Schur-Weyl Decomposition for

Mathematical Foundations, numerical solution.

Open In Colab

Schur-Weyl Decomposition for \(k = 2\)


Background

Many quantities in quantum information involve several identical copies of a system acted on in the same way, and whenever copies are interchangeable the symmetry worth using is the permutation of those copies. With two copies there is a single nontrivial permutation, carried out by the SWAP operator \(F\), which exchanges the two tensor factors. Swapping twice returns everything to where it began, so \(F\) is its own inverse and its eigenvalues can only be \(+1\) or \(-1\). The states left unchanged form the symmetric subspace and those that flip sign form the antisymmetric subspace, and these two pieces are the irreducible representations of the permutation group \(S_2\) that Schur-Weyl duality identifies at \(k = 2\).

The duality is the statement that permuting the copies and applying the same unitary to every copy are complementary symmetries, and that together they carve the multi-copy space into blocks labeled by both at once. At the level of two copies this organizing principle reduces to the single split into symmetric and antisymmetric parts, whose dimensions \(D(D+1)/2\) and \(D(D-1)/2\) add back up to the full \(D^2\).

The same operator also lets a product of traces be folded into one trace over the doubled space. The identity \(\mathrm{Tr}(AB) = \mathrm{Tr}[(A\otimes B)F]\) rewrites quadratic quantities such as purities as expectation values of \(F\), and that move is the standard entry point for averaging second moments over the unitary group, where the symmetric and antisymmetric projectors are exactly what such an average produces.

This exercise computes the traces of \(F\) and \(F^2\), counts the dimensions \(D(D+1)/2\) and \(D(D-1)/2\) of the symmetric and antisymmetric subspaces, and applies the SWAP identity to recover the purity \(1/D\) of the maximally mixed state.

Mathematical background

Schur-Weyl duality describes how the unitary and symmetric groups share the tensor space \((\mathbb{C}^D)^{\otimes k}\). The two commuting actions are \(U^{\otimes k}\) for \(U \in U(D)\) and the permutations \(\pi \in S_k\) of the tensor factors, and the space splits into joint irreducible blocks labeled by Young diagrams. The operators that commute with \(U^{\otimes k}\) for every \(U\) are exactly the linear span of the permutations, which is why Haar averages collapse onto sums over \(S_k\). For \(k = 2\) the only permutations are the identity and the swap \(\mathbb{F}\), and the projectors

\[ P_{\mathrm{sym}} = \tfrac12(\mathbb{I} + \mathbb{F}), \qquad P_{\mathrm{asym}} = \tfrac12(\mathbb{I} - \mathbb{F}) \]

split \(\mathbb{C}^D \otimes \mathbb{C}^D\) into its symmetric and antisymmetric subspaces of dimensions \(D(D+1)/2\) and \(D(D-1)/2\). The swap also implements the trace trick \(\mathrm{Tr}(\mathbb{F}\,A\otimes B) = \mathrm{Tr}(AB)\), the lever behind the purity and overlap calculations used throughout the tutorial.

Exercise

The SWAP operator \(F\) on \(\mathbb{C}^D \otimes \mathbb{C}^D\) exchanges tensor factors: \(F|a,b\rangle = |b,a\rangle\).

(a) Prove \(\mathrm{Tr}(F) = D\) and \(\mathrm{Tr}(F^2) = D^2\).

(b) Show \(\dim(\mathrm{Sym}^2) = D(D+1)/2\) and \(\dim(\wedge^2) = D(D-1)/2\), and verify \(\dim(\mathrm{Sym}^2) + \dim(\wedge^2) = D^2\).

(c) For \(\rho = I/D\) (maximally mixed), verify the SWAP trick: \(\mathrm{Tr}(\rho^2) = \mathrm{Tr}[(\rho \otimes \rho) F] = 1/D\).

Solution

Part (a): Traces of the SWAP operator

In the computational basis, the matrix elements of \(F\) are:

\[ F_{(a,b),(c,d)} = \delta_{a,d}\,\delta_{b,c}. \]

Trace of \(F\):

\[ \mathrm{Tr}(F) = \sum_{a,b} F_{(a,b),(a,b)} = \sum_{a,b} \delta_{a,b}\,\delta_{b,a} = \sum_{a,b} \delta_{a,b} = D. \]

Only diagonal elements \((a = b)\) contribute.

Trace of \(F^2\): Since \(F\) is an involution (\(F^2 = I\), because swapping twice returns the original), \(\mathrm{Tr}(F^2) = \mathrm{Tr}(I_{D^2}) = D^2\).

Part (b): Symmetric and antisymmetric subspace dimensions

Since \(F^2 = I\), the eigenvalues of \(F\) are \(\pm 1\). The projectors onto the eigenspaces are:

\[ P_+ = \frac{I + F}{2} \quad (\text{symmetric}), \qquad P_- = \frac{I - F}{2} \quad (\text{antisymmetric}). \]

Their dimensions (traces of the projectors):

\[ \dim(\mathrm{Sym}^2) = \mathrm{Tr}(P_+) = \frac{D^2 + D}{2} = \frac{D(D+1)}{2}, \]

\[ \dim(\wedge^2) = \mathrm{Tr}(P_-) = \frac{D^2 - D}{2} = \frac{D(D-1)}{2}. \]

Check: \(\frac{D(D+1)}{2} + \frac{D(D-1)}{2} = \frac{D(D+1+D-1)}{2} = D^2\). \(\quad \checkmark\)

For qubits (\(D = 2\)): \(\mathrm{Sym}^2\) is the 3-dimensional triplet space, \(\wedge^2\) is the 1-dimensional singlet.

Part (c): The SWAP trick

The SWAP trick is the identity:

\[ \mathrm{Tr}(AB) = \mathrm{Tr}\bigl[(A \otimes B)\, F\bigr]. \]

Proof: In components,

\[ \mathrm{Tr}[(A \otimes B) F] = \sum_{a,b} (A \otimes B)_{(a,b),(c,d)}\, F_{(c,d),(a,b)} = \sum_{a,b} A_{a,b}\, B_{b,a} = \mathrm{Tr}(AB). \]

Application: Setting \(A = B = \rho = I/D\):

\[ \mathrm{Tr}(\rho^2) = \mathrm{Tr}[(\rho \otimes \rho) F] = \frac{1}{D^2}\mathrm{Tr}(F) = \frac{D}{D^2} = \frac{1}{D}. \quad \checkmark \]

This confirms that the purity of the maximally mixed state equals \(1/D\), it becomes arbitrarily small as the Hilbert space dimension grows.


Symbolic Verification (SymPy)

Code
import sympy as sp

for D in [2, 3, 4]:
    F = sp.zeros(D**2)
    for a in range(D):
        for b in range(D):
            row = a*D + b
            col = b*D + a
            F[row, col] = 1

    assert sp.trace(F) == D
    assert sp.trace(F*F) == D**2
    assert F*F == sp.eye(D**2)

    P_sym = (sp.eye(D**2) + F) / 2
    P_anti = (sp.eye(D**2) - F) / 2
    print(f"D={D}: Tr(F)={sp.trace(F)}, dim(Sym²)={sp.trace(P_sym)}, "
          f"dim(∧²)={sp.trace(P_anti)}, sum={sp.trace(P_sym)+sp.trace(P_anti)}")
D=2: Tr(F)=2, dim(Sym²)=3, dim(∧²)=1, sum=4
D=3: Tr(F)=3, dim(Sym²)=6, dim(∧²)=3, sum=9
D=4: Tr(F)=4, dim(Sym²)=10, dim(∧²)=6, sum=16

Numerical Verification

Code
import numpy as np

for D in [2, 3, 4, 5]:
    # Build SWAP
    F = np.zeros((D**2, D**2))
    for a in range(D):
        for b in range(D):
            F[a*D+b, b*D+a] = 1

    # SWAP trick: Tr(ρ²) via F
    rho = np.eye(D) / D
    purity_direct = np.trace(rho @ rho)
    purity_swap = np.trace(np.kron(rho, rho) @ F)

    assert np.isclose(purity_direct, 1/D)
    assert np.isclose(purity_swap, 1/D)

    # Also verify for a random pure state
    psi = np.random.randn(D) + 1j*np.random.randn(D)
    psi /= np.linalg.norm(psi)
    rho_pure = np.outer(psi, psi.conj())
    assert np.isclose(np.trace(np.kron(rho_pure, rho_pure) @ F), 1.0)

    print(f"D={D}: Tr(ρ²)_mixed = {purity_direct:.4f} = 1/{D}, "
          f"Tr(ρ²)_pure = {np.trace(rho_pure @ rho_pure).real:.4f} = 1")

print("\nSWAP trick verified for mixed and pure states.")
D=2: Tr(ρ²)_mixed = 0.5000 = 1/2, Tr(ρ²)_pure = 1.0000 = 1
D=3: Tr(ρ²)_mixed = 0.3333 = 1/3, Tr(ρ²)_pure = 1.0000 = 1
D=4: Tr(ρ²)_mixed = 0.2500 = 1/4, Tr(ρ²)_pure = 1.0000 = 1
D=5: Tr(ρ²)_mixed = 0.2000 = 1/5, Tr(ρ²)_pure = 1.0000 = 1

SWAP trick verified for mixed and pure states.

Takeaway

SWAP is an involution with eigenvalues \(\pm 1\), dividing the two-copy space into symmetric and antisymmetric parts of dimensions \(D(D+1)/2\) and \(D(D-1)/2\). The resulting identity \(\mathrm{Tr}(AB) = \mathrm{Tr}[(A \otimes B) F]\) returns the purity \(1/D\) for the maximally mixed state.

References

  • Collins, Moments and cumulants of polynomial random variables on unitary groups, the Itzykson-Zuber integral, and free probability, International Mathematics Research Notices (2003).
  • Goodman and Wallach, Symmetry, Representations, and Invariants, Springer (2009).
  • Collins et al., The Weingarten calculus, Notices of the American Mathematical Society (2022).
  • Płodzień, Information Scrambling, Quantum Chaos, and Haar-Random States, lecture notes (2025). arXiv:2511.14397