Skip to content

Tensor Network Engine

The core engine implements three fundamental data structures and their associated algorithms.

Data Structures

Matrix Product States (MPS)

An MPS represents a quantum/classical state as a chain of rank-3 tensors:

\[|\psi\rangle = \sum_{s_1 \ldots s_L} A^{s_1} A^{s_2} \cdots A^{s_L} |s_1 s_2 \ldots s_L\rangle\]

ontic.core.mps.MPS

Matrix Product State representation.

Attributes: tensors: List of tensors A[i] with shape (χ_left, d, χ_right) L: Number of sites d: Physical dimension (assumed uniform)

Example: >>> mps = MPS.random(L=10, d=2, chi=32) >>> print(f"Norm: {mps.norm():.6f}") >>> mps.canonicalize_left_() >>> entropy = mps.entropy(bond=4)

Matrix Product Operators (MPO)

ontic.mpo

Matrix Product Operator (MPO) framework for direct TT-core updates.

Eliminates dense-to-QTT factorization tax (6.05ms) by updating TT-cores directly. Academic validation: Oseledets (2011), Dolgov & Savostyanov (2014).

Target performance: 0.65ms physics update (5× speedup vs 3.33ms dense solver).

Quantized Tensor Train (QTT)

ontic.qtt

ontic.qtt — QTT-specific algorithms

Modules in this sub-package operate directly on Tensor-Train (TT) cores without materialising full dense arrays, achieving :math:O(n r^3) or :math:O(n r^2 d) complexity where n is the number of TT-cores, r the bond dimension, and d the local mode size.

Sub-modules
  • sparse_direct — LU / Cholesky in TT format
  • rank_adaptive — Information-theoretic rank selection (AIC/BIC/MDL)
  • unstructured — QTT on FEM / FVM meshes via RCM + quantics
  • eigensolvers — Lanczos / Davidson in TT format
  • krylov — CG / GMRES entirely in TT
  • dynamic_rank — Rank adaptation during time integration
  • differentiable — Autograd-compatible TT operations
  • pde_solvers — Implicit time-steppers (backward Euler, CN, BDF-2)
  • qtci_v2 — Enhanced TCI with rook pivoting & error certification
  • time_series — Temporal signal compression via quantics mapping

Algorithms

Algorithm Module Purpose
DMRG ontic.algorithms.dmrg Variational ground state
TEBD ontic.algorithms.tebd Real/imaginary time evolution
TDVP ontic.algorithms.tdvp Time-dependent variational
Lanczos ontic.algorithms.lanczos Eigenvalue computation