Adaptive Truncation#
Overview#
Adaptive truncation is the key technique enabling efficient MPS simulation by dynamically adjusting bond dimensions based on entanglement structure. By truncating small singular values, MPS maintains controllable approximation error while keeping memory and computational costs polynomial in system size.
Without truncation, bond dimensions grow exponentially: χ → 2χ after each two-site gate, quickly becoming intractable. With adaptive truncation, χ grows only as needed to capture physical entanglement, enabling simulation of 50+ qubit systems.
Key concepts:
SVD truncation: Discard small singular values to reduce bond dimension
Optimal approximation: SVD minimizes distance to exact state
Error bounds: Truncation error quantified by discarded singular values
Adaptive growth: χ increases only when entanglement requires it
Memory budgets: Enforce global memory constraints across all bonds
This document explains the theory of adaptive truncation, error analysis, and implementation strategies used in ATLAS-Q.
See also
Tensor Networks for tensor network foundations, Numerical Stability for numerical considerations, MPS Basics for practical truncation usage.
SVD and Optimal Truncation#
Singular Value Decomposition#
Schmidt decomposition of a bipartite quantum state:
where:
λᵢ ≥ 0 are Schmidt coefficients (λ₁ ≥ λ₂ ≥ … ≥ λᵣ)
r = min(dim A, dim B) is Schmidt rank
Normalization: Σᵢ λᵢ² = 1
SVD is the computational realization of Schmidt decomposition:
where:
Θ is the two-site tensor after gate application
U, V† are unitary matrices
λ are positive singular values (λ = Schmidt coefficients)
r = χ_left × 2 × 2 × χ_right (before truncation)
Optimality of SVD Truncation#
Theorem (Eckart-Young-Mirsky):
Truncating SVD to keep k largest singular values minimizes the Frobenius norm error:
This means SVD truncation gives the optimal rank-k approximation to the exact state.
Interpretation:
Keeping k singular values: Best possible approximation with bond dimension χ = k
No other truncation method can do better (in Frobenius norm)
Error is simply sum of discarded singular values squared
Truncation Error#
Local truncation error at bond i:
where χᵢ is the chosen bond dimension after truncation.
Distance to exact state:
Fidelity:
for small ε_i.
Truncation Criteria#
Energy-Based Truncation#
Keep singular values until retained energy exceeds threshold:
where ε is the truncation tolerance (truncation_threshold in ATLAS-Q).
Algorithm:
Compute cumulative energy: \(E_k = \sum_{α=1}^k λ_α^2\)
Find smallest k such that \(E_k \geq (1 - ε^2) E_r\)
Truncate to χ = min(k, χ_max)
Interpretation: Retain at least (1-ε²) ≈ (1-2ε) of the wavefunction norm.
Typical values:
ε = 1e-8: High accuracy, large χ
ε = 1e-6: Good accuracy, moderate χ (recommended default)
ε = 1e-4: Lower accuracy, small χ
Fixed Bond Dimension#
Simply keep the k largest singular values:
Advantages:
Predictable memory usage
Consistent computational cost
Simple to implement
Disadvantages:
May waste resources (too large χ for low entanglement)
May lose accuracy (too small χ for high entanglement)
Combined Criterion#
Use both energy-based and fixed maximum:
This ensures:
Accuracy: Retain enough singular values (energy criterion)
Bounded cost: Never exceed χ_max (memory/time constraint)
ATLAS-Q implementation:
mps = AdaptiveMPS(
num_qubits=50,
bond_dim=64, # Initial χ
chi_max_per_bond=256, # Maximum χ per bond
truncation_threshold=1e-6, # Energy criterion (ε)
adaptive_mode=True # Enable adaptive growth
)
Error Accumulation and Bounds#
Global Error Accumulation#
Truncation errors at different bonds are independent, so total error accumulates:
where the sum is over all bonds in the MPS.
For N gate applications:
assuming each gate introduces local error ε_local.
Example:
100 gates, ε_local = 1e-6 per gate
Global error ≤ √100 × 1e-6 = 1e-5
Worst-Case Bound#
Theorem: After N two-site gates with local truncation error ε each:
Proof sketch:
Each gate introduces independent error ε
Errors add in quadrature (triangle inequality)
Total distance bounded by \(\sqrt{\sum_i ε_i^2} \leq \sqrt{N} · ε\)
Practical Error Tracking#
ATLAS-Q automatically tracks global error:
from atlas_q.adaptive_mps import AdaptiveMPS
mps = AdaptiveMPS(num_qubits=30, bond_dim=32, device='cuda')
# Apply gates
for i in range(100):
mps.apply_cnot(i % 29, (i % 29) + 1)
# Check accumulated error
global_error = mps.statistics.total_truncation_error
print(f"Global truncation error: {global_error:.2e}")
# Per-bond error distribution
bond_errors = mps.statistics.truncation_error_per_bond
max_error_bond = bond_errors.argmax()
print(f"Worst bond: {max_error_bond}, error: {bond_errors[max_error_bond]:.2e}")
Tightening Error Bounds#
When global error exceeds tolerance:
Option 1: Reduce truncation threshold
mps = AdaptiveMPS(
num_qubits=30,
bond_dim=64,
truncation_threshold=1e-8, # Was 1e-6
chi_max_per_bond=512 # May need larger χ_max
)
Option 2: Increase maximum bond dimension
mps = AdaptiveMPS(
num_qubits=30,
bond_dim=64,
truncation_threshold=1e-6,
chi_max_per_bond=512 # Was 256
)
Option 3: Checkpoint and restart with tighter tolerances
Adaptive Truncation Strategies#
Entropy-Based Adaptive Truncation#
Adjust χ based on entanglement entropy:
Strategy:
Compute entanglement entropy S from singular values
Set χ = min(2^S, χ_max) to capture entanglement
Ensures bond dimension matches physical entanglement
When S is small (low entanglement): - Small χ sufficient - Memory savings
When S is large (high entanglement): - Large χ required - Automatic adaptation
Per-Bond Adaptive Caps#
Different bonds have different entanglement, so use different χ_max:
ATLAS-Q implementation:
# Heterogeneous bond dimension caps
num_qubits = 20
chi_caps = []
for i in range(num_qubits - 1):
if 5 <= i <= 14:
# Center bonds: high entanglement
chi_caps.append(256)
else:
# Edge bonds: low entanglement
chi_caps.append(64)
mps = AdaptiveMPS(
num_qubits=num_qubits,
bond_dim=16,
chi_max_per_bond=chi_caps
)
Rationale:
Center of chain: Higher entanglement from accumulated gates
Edges: Lower entanglement (boundary effects)
Saves memory without sacrificing accuracy
Growth Rate Control#
Control how quickly χ grows during simulation:
mps = AdaptiveMPS(
num_qubits=50,
bond_dim=8, # Start small
chi_max_per_bond=256, # Can grow up to 256
truncation_threshold=1e-6,
adaptive_mode=True,
growth_rate='conservative' # 'aggressive', 'moderate', 'conservative'
)
Growth strategies:
Aggressive: Allow χ to double quickly, prioritize accuracy
Moderate: Balance between growth and memory
Conservative: Grow χ slowly, prioritize memory efficiency
Memory Budget Management#
Global Memory Constraints#
Total MPS memory:
where:
d = 2 for qubits (local dimension)
χᵢ = bond dimension at bond i
dtype = complex64 (8 bytes) or complex128 (16 bytes)
Memory budget enforcement:
mps = AdaptiveMPS(
num_qubits=100,
bond_dim=16,
budget_global_mb=8192, # 8 GB maximum
adaptive_mode=True
)
ATLAS-Q dynamically adjusts per-bond χ to respect the budget.
Budget Allocation Strategies#
1. Uniform allocation:
All bonds get equal budget:
2. Entropy-proportional allocation:
Allocate more memory to high-entanglement bonds:
where Sᵢ is entanglement entropy at bond i.
3. Hierarchical allocation:
Center bonds get more resources:
Dynamic Rebalancing#
As simulation progresses, entanglement redistributes. Periodically rebalance χ:
# Every 100 gates, rebalance bond dimensions
for epoch in range(10):
for _ in range(100):
# Apply gates
mps.apply_cnot(...)
# Rebalance based on current entanglement
mps.rebalance_bond_dimensions(
strategy='entropy_based',
total_budget_mb=8192
)
Rebalancing algorithm:
Measure entanglement entropy at each bond
Redistribute total χ budget proportional to S_i
Move to canonical form and re-truncate
Special Cases and Optimizations#
Product States#
Product state: \(|\psi\rangle = |ψ_1\rangle \otimes |ψ_2\rangle \otimes \cdots \otimes |ψ_n\rangle\)
Entanglement: Zero, S = 0
Optimal χ: χ = 1 (no entanglement)
ATLAS-Q automatically recognizes product states:
All singular values except one are zero
Truncates to χ = 1
Memory: O(n) instead of O(n·χ²)
Low-Entanglement States#
Area law states: S ∝ log(n)
Examples:
Ground states of gapped 1D Hamiltonians
Short-time evolution from product states
Thermal states at low temperature
Required χ: χ ∝ n^α for small α
Performance: Polynomial scaling in n
Critical States#
Critical states: S ∝ log(L) where L is subsystem size
Examples:
Ground states at quantum phase transitions
Conformal field theory states
Required χ: χ ∝ L^α for small α
Challenge: Logarithmic growth of χ with system size
ATLAS-Q strategy:
Use MERA for critical systems (if available)
Or accept larger χ and tighter truncation thresholds
Volume Law Entanglement#
Volume law: S ∝ n
Examples:
Random quantum states
Deep quantum circuits
Highly entangled states
Required χ: χ ∝ 2^n (exponential!)
Performance: MPS inefficient, consider alternative methods
Truncation-Free Methods#
Projected Time Evolution#
Avoid explicit SVD truncation by projecting onto low-bond-dimension manifold:
where P_χ is projection onto χ-dimensional bond space.
Advantage: No SVD cost (O(χ³) → 0)
Disadvantage: More complex implementation
Time-Dependent Variational Principle (TDVP)#
Evolve MPS in tangent space of MPS manifold:
Advantage: Automatic truncation without explicit SVD
Implementation: ATLAS-Q’s TDVP algorithm
See: Algorithms for TDVP details
Implementation in ATLAS-Q#
Truncation Workflow#
Step-by-step ATLAS-Q truncation:
Gate application: Contract gate with two neighboring MPS tensors
\[Θ_{α,s,s',β} = \sum_{γ} A^{[i]}_{α,s,γ} · G_{s,s',t,t'} · A^{[i+1]}_{γ,t,β}\]Reshape: Θ → matrix of shape (χ_left × d) × (d × χ_right)
SVD: Θ = U Σ V†
Energy criterion:
cumsum = torch.cumsum(singular_values**2, dim=0) total = cumsum[-1] threshold = (1 - eps**2) * total chi_energy = torch.searchsorted(cumsum, threshold) + 1
Apply caps:
chi = min(chi_energy, chi_max_per_bond)
Truncate:
U_trunc = U[:, :chi] S_trunc = S[:chi] Vt_trunc = Vt[:chi, :]
Split tensors: Form new MPS tensors A[i] and A[i+1]
Track error:
truncation_error = torch.sqrt(torch.sum(S[chi:]**2)) mps.statistics.total_truncation_error += truncation_error**2
GPU Optimization#
ATLAS-Q optimizations:
Use cuQuantum for large SVD (χ > 128)
Batch SVD operations when possible
Fuse truncation with other operations
Asynchronous SVD on GPU while CPU prepares next gate
Performance: 2-5× speedup for χ > 128
Numerical Stability#
Issues:
Small singular values near machine precision
Conditioning of SVD
Accumulation of rounding errors
Solutions:
Use relative thresholds: discard λ < max(λ) × 1e-14
Regularize ill-conditioned SVD
Use higher precision (complex128) when needed
See: Numerical Stability for details
Comparison with Other Methods#
Fixed χ Truncation#
Method: Always truncate to fixed χ regardless of entanglement
Pros: - Predictable cost - Simple implementation
Cons: - Wastes resources (low entanglement) - Loses accuracy (high entanglement)
ATLAS-Q: Adaptive χ superior for most use cases
Randomized SVD#
Method: Approximate SVD using randomized algorithms
Pros: - Faster for very large χ (> 1000) - O(χ²) instead of O(χ³) for full SVD
Cons: - Approximate (additional error) - Complex implementation
ATLAS-Q: Uses for χ > 512 when available
Density Matrix Truncation#
Method: Form reduced density matrix, diagonalize, keep top eigenvectors
Pros: - Directly optimizes fidelity - Equivalent to SVD for pure states
Cons: - More expensive (O(χ⁴) vs O(χ³) for SVD) - Only applicable to pure states
ATLAS-Q: SVD preferred (equivalent, faster)
Summary#
Adaptive truncation enables efficient MPS simulation by:
Optimal approximation: SVD minimizes distance to exact state
Error bounds: Truncation error quantified by discarded singular values
Adaptive growth: Bond dimension grows only when entanglement requires it
Memory budgets: Global constraints automatically enforced
Numerical stability: Robust implementation with error tracking
Key concepts:
SVD truncation is optimal (Eckart-Young-Mirsky theorem)
Energy criterion: Keep singular values until (1-ε²) norm retained
Global error: \(ε_{\text{global}} \leq \sqrt{N} · ε_{\text{local}}\)
Adaptive strategies: Entropy-based, per-bond caps, memory budgets
Special cases: Product states (χ=1), area law (small χ), volume law (large χ)
Truncation parameters:
truncation_threshold: Controls accuracy (1e-6 recommended)chi_max_per_bond: Caps maximum χ per bondbudget_global_mb: Enforces total memory constraintadaptive_mode: Enables adaptive χ growth
Practical guidelines:
Start with truncation_threshold = 1e-6, chi_max = 256
Monitor global error with
mps.statistics.total_truncation_errorTighten thresholds if error exceeds tolerance
Use per-bond caps to optimize memory allocation
Consider memory budgets for very large systems
Adaptive truncation is the algorithmic innovation enabling ATLAS-Q to simulate 50-100+ qubit systems while maintaining controllable approximation error.
See Also#
Tensor Networks: Tensor network foundations
Algorithms: DMRG, TDVP, and other algorithms using truncation
Numerical Stability: Numerical considerations for truncation
MPS Basics: Practical truncation usage
How to Handle Large Quantum Systems: Large-scale simulations with truncation