Skip to content
Open access

Codebase release 0.0 for trainsum

Sep 2026 · SciPost Physics Codebases · 0 citations

TL;DR

The trainsum package enables efficient approximation of tensors and functions by tensor trains, regardless of their shape or dimensionality, and supports analytic constructions of important objects, such as polynomials and Fourier transforms.

Abstract

We present trainsum, a Python package for computations with multidimensional quantics tensor trains. The package enables efficient approximation of tensors and functions by tensor trains, regardless of their shape or dimensionality, and supports analytic constructions of important objects, such as polynomials and Fourier transforms. Once represented in tensor train format, trainsum provides standard arithmetic operations, including addition, multiplication, and element-wise transformations. An Einstein-summation interface, closely aligned with NumPy’s einsum, enables concise specification of complex tensor train contractions and linear solvers. With support for multiple CPU and GPU backends (NumPy, CuPy, PyTorch), trainsum serves as a general-purpose framework for constructing and manipulating high-dimensional tensor representations in applications such as numerical simulation, data compression, machine learning, and data analysis.

Read PDF

Similar papers

#machine learning Preprint Nov 2026

Representing Tensors as Compositions for Efficient Computation on Sparse and Structured Data

We propose a new mathematical formalism in which all kinds of tensors and of operations on those tensors are represented as simple function compositions. Tensors are functions from indices to values. An element-wise operation (e.g. an activation function) is a composition with a function applied to values; re-indexing...

Valérian Rey, Praneth Paruchuri · 0 citations
Preprint Oct 2026

Fast matrix-vector products in tensor-train format via structured sketching

We propose a randomized, streamable algorithm that computes a tensor-train approximation of a matrix-vector product without ever forming the full intermediate tensor. We develop three contraction strategies for streaming tensor-train approximation (STTA): sequential, fused, and pre-sketched. We focus on the regime of l...

Alberto Bucci, S. Güttel, J. Pearson · 0 citations
#machine learning Preprint Nov 2026

User-Schedulable Approximations for Quantized Tensor Programs

Quantization lets language models run on edge devices, but it sharply increases the number of tensor kernels a library must maintain: every weight format must be paired with every activation format on every instruction set and GPU, with an encoder and a decoder that agree on the stored bytes. In GGML, the tensor librar...

A. Reinking · 0 citations
Preprint Oct 2026

Parallel Sparse Outputs for Tensor Compilers

Sparse tensor compilers are commonly used high-performance tools that optimize tensor algebra programs over notoriously complex sparse data structures. Despite the ever-increasing size and scale of sparse datasets, there exists astonishingly little research on developing a parallel sparse tensor compiler. Existing appr...

A. Gushin, Pau Sum, Willow Ahrens · 0 citations
Preprint Nov 2026

TorchCurves: Differentiable Parametric Curves

We present TorchCurves, a PyTorch library that treats vector-valued parametric curves as learnable primitives. Its central operation maps batches of scalar inputs to points on curves represented in B-spline or Legendre polynomial bases, with differentiation through both inputs and coefficients. Curve coefficients can b...

Alex Shtoff · 0 citations
Preprint Nov 2026

Factorized approximate inverse preconditioners in the tensor train format

We present a preconditioning pipeline that accelerates Tensor Train (TT) linear solvers for symmetric positive-definite problems. Extending the Factorized Sparse Approximate Inverse framework to tensor networks, we construct a preconditioner as the product of a TT operator and its transpose. This formulation is positiv...

Pau Torrente Badia, Daniel Pérez García, A. Garćıa-Sáez et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.