TensorKrowch: Smooth integration of tensor networks in machine learning
José Ramón Pareja Monturiol, David Pérez-García, Alejandro Pozas-Kerstjens
TL;DR
The paper addresses the challenge of bringing tensor networks into mainstream machine learning practice by introducing TensorKrowch, a PyTorch‑based library that lets researchers build, train, and integrate tensor‑network layers. It defines Nodes/Edges as building blocks to compose arbitrary tensor networks and contract them end‑to‑end within DL models. Key contributions include efficient memory and contraction optimizations (trace, memory modes, and shared memory), built‑in architectures such as $MPS$, $MPO$, $TTN$, and $PEPS$, and tensorization tools for integrating with pretrained models. The work facilitates rapid prototyping and broader adoption of tensor networks in ML, supported by documentation and community‑driven contribution guidelines.
Abstract
Tensor networks are factorizations of high-dimensional tensors into networks of smaller tensors. They have applications in physics and mathematics, and recently have been proposed as promising machine learning architectures. To ease the integration of tensor networks in machine learning pipelines, we introduce TensorKrowch, an open source Python library built on top of PyTorch. Providing a user-friendly interface, TensorKrowch allows users to construct any tensor network, train it, and integrate it as a layer in more intricate deep learning models. In this paper, we describe the main functionality and basic usage of TensorKrowch, and provide technical details on its building blocks and the optimizations performed to achieve efficient operation.
