---
title: 'SeQuant: Symbolic Tensor & Operator Algebra'
url: https://www.emergentmind.com/topics/sequant
type: topic
---

# SeQuant: Symbolic Tensor & Operator Algebra

Searching arXiv for papers relevant to “SeQuant” and closely related similarly named quantization frameworks to ground the entry and handle possible ambiguity.
SeQuant is an open-source library for symbolic algebra of tensors over commutative (scalar) and non-commutative (operator) rings, designed to bridge symbolic tensor manipulation and high-performance numerical evaluation. It emerged from quantum many-body theory, especially high-order coupled-cluster and related methods, where one must derive, simplify, canonicalize, and evaluate large tensor expressions with nontrivial index symmetries, noncovariant products, and nested index dependencies. Its central technical component is a graph-theoretic tensor-network canonicalizer, used for routine simplification, for optimizing Wick’s theorem over operator fields, and for transforming symbolic expressions into an intermediate representation suitable for numerical execution [2511.09943].

## 1. Scope and research setting

SeQuant addresses a longstanding problem in computational many-body theory and symbolic tensor algebra: the same tensor network can be written in many formally different but equivalent index encodings. Dummy-index renamings, permutations of identical factors, slot reorderings, and internal tensor symmetries all create representational nonuniqueness. In operator-valued settings, the problem is compounded by noncommutativity, so canonicalization cannot simply sort factors freely [2511.09943].

The framework was designed to support both conventional tensor algebra and operator algebra. In the symbolic phase it constructs and manipulates expressions in abstract index notation; in the evaluation phase it lowers those expressions into an optimized intermediate representation, applies contraction-ordering and common-subexpression elimination, and either interprets the result at runtime or transpiles it into host-language code that calls an external tensor backend such as TiledArray [2511.09943].

The paper frames this as a reusable community framework rather than a domain-specific derivation script. Its stated design goals include support for arbitrary index symmetries, noncovariant products, nested parametric index dependencies, an optimized Wick’s-theorem engine, and a workflow that blends symbolic code generation with direct interpretation [2511.09943].

## 2. Software architecture and expression model

SeQuant is organized around two principal components, `SQ/core` and `SQ/eval`. `SQ/core` is the symbolic engine, while `SQ/eval` performs compiler-like lowering and execution planning. Within `SQ/core`, `SQ/expr` provides a minimal abstract expression DAG whose atoms include constants, variables, tensors, and normal-ordered operators, and whose composites include sums and products with optional noncommutativity flags. It supports recursive visitation and pattern-based rewriting operations such as `expand`, `canonicalize`, and `rapid_simplify` [2511.09943].

`SQ/tensor`, built on top of `SQ/expr`, represents indexed tensors over both commutative and noncommutative rings. It supports rich index-space vocabularies, nested index dependencies via protoindices, noncovariant contractions, a graph-theoretic tensor-network canonicalizer, and an optimized Wick’s-theorem engine [2511.09943].

A compact summary of the architecture is given below.

| Component | Role | Notable capabilities |
|---|---|---|
| `SQ/expr` | Abstract expression DAG | Recursive visitation; pattern-based rewriting |
| `SQ/tensor` | Indexed tensor layer | Symmetries, protoindices, noncovariant contractions, TN canonicalization, Wick engine |
| `SQ/eval` | Lowering and execution | IR generation, TN contraction ordering, CSE, interpretation, transpilation |

This division is significant because it separates algebraic correctness from execution strategy. Symbolic equivalence is established in `SQ/core`; numerical efficiency is pursued in `SQ/eval`. The paper explicitly describes this as a way to blur the line between symbolic code generation and direct numerical interpretation [2511.09943].

## 3. Graph-theoretic tensor-network canonicalization

A defining feature of SeQuant is its tensor-network canonicalizer. The paper formulates canonicalization for a tensor network $\mathcal F$ with automorphism group $\mathrm{Aut}(\mathcal F)$ as a mapping
$$
f : \mathcal F \mapsto \mathcal F_0
$$
such that for every $g \in \mathrm{Aut}(\mathcal F)$, $f(g \cdot \mathcal F) \equiv f(\mathcal F)$, and $f(\mathcal F) \equiv h \cdot \mathcal F$ for some $h \in \mathrm{Aut}(\mathcal F)$, where equivalence is taken modulo overall sign, phase, or complex conjugation [2511.09943].

Instead of using a traditional group-theoretic Butler-Portugal procedure, SeQuant encodes a tensor network as a colored graph. The graph includes vertices for tensor cores, slot bundles, individual slots, indices, and protoindex bundles; edges encode occupancy relations, bundle membership, and index dependencies. Two coloring functions, `color(K)` and `ccolor(K,c)`, ensure that distinct objects and composite structures remain distinguishable [2511.09943].

The construction proceeds in five stated steps: create a core vertex for each tensor factor; attach braket-, bra-, ket-, column-, and aux-bundle vertices; attach slot vertices; attach index vertices; and attach protoindex-bundle vertices for nested dependencies. The resulting colored graph is passed to Bliss or Nauty, which compute both a canonical vertex ordering and automorphism generators. SeQuant then reorders factors, bundles, and slots according to that canonical order, accumulates phase factors from antisymmetric bra/ket permutations, and regenerates dummy indices in order of first appearance [2511.09943].

Although graph canonicalization can be worst-case exponential, the paper reports that for the bounded-valence graphs arising from tensor networks, the cost grows roughly as $O(n^2)$ in the number of slots $n$. Figure 6 is reported to show that SeQuant’s canonicalizer out-scales both the standard Mathematica Butler-Portugal implementation and the Niehoff-enhanced Butler-Portugal extension, particularly for networks with many identical factors [2511.09943].

## 4. Commutative and noncommutative tensor algebras

SeQuant distinguishes two subclass models of `AbstractTensor`: `Tensor`, whose elements lie in a commutative scalar ring, and `NormalOperator`, whose elements are normal-ordered products of bosonic or fermionic creation and annihilation operators. In the commutative case, products can be reordered freely; in the operator case, canonicalization must respect the canonical (anti)commutation relations and the loss of reordering freedom [2511.09943].

For fermionic operators, the paper writes
$$
[a_p,a_q]_+=0,\quad [a^p,a^q]_+=0,\quad [a^p,a_q]_+=\delta^p_q.
$$
It also notes that if $C_p^q \equiv a^p a_q$, then $C_r^q C_p^r \neq C_p^r C_r^q$, illustrating why conventional commutative normalization is insufficient [2511.09943].

Canonical rewriting in the operator case is handled by an optimized Wick’s-theorem engine. For genuine-vacuum normal ordering, the paper gives the rank-1 contraction rule
$$
a^p_q\,a^r_s
=\{a^p a_q a^r a_s\}
+\{a^p\,a_q\,a^r a_s\}
=a^{pr}_{qs}+\delta^r_q\,a^p_s,
$$
with contraction $\{a_q\,a^r\}=\delta^r_q$. For rank-2 operators it writes
$$
a^{pr}_{qs}\,a^{tx}_{vy}
=a^{prtx}_{qsvy}
+\delta^t_q\,a^{prx}_{vsy}
+\dots
+\delta^t_q\,\delta^x_s\,a^{pr}_{vy}.
$$
In the fermionic Fermi-vacuum case, both top-bottom and bottom-top contractions appear, with sign factors such as
$$
\{a_p\,a^q\}=\delta^q_p,\qquad
\{a^p\,a_q\}=-\,\delta^p_q.
$$
These details matter because naïve Wick recursion generates factorially many equivalent terms [2511.09943].

SeQuant reduces this combinatorial blow-up through two stated mechanisms. First, it applies topological optimizations based on automorphism generators from the tensor-network canonicalizer, so that equivalent contraction patterns are grouped and weighted by degeneracy factors. Second, it supports connectivity constraints that require particular operator factors to be contracted, pruning dead-end branches in the recursion [2511.09943].

## 5. Noncovariant tensor networks and nested dependent modes

A major extension point in SeQuant is support for noncovariant tensor networks and tensor modes whose degrees of freedom depend parametrically on other indices. The paper identifies this as typical in tensor decompositions and in quantum-chemical compression methods such as pair-natural-orbital constructions, where one cannot always regard all data as entries of a single global tensor over a fixed vector-space product [2511.09943].

The canonical example is the pair-dependent decomposition of the two-electron amplitude slice $t^{i_1 i_2}_{a_1 a_2}$:
$$
\mathbf t^{i_1 i_2}\approx
\mathbf U^{i_1 i_2}\,\mathbf\Sigma^{i_1 i_2}\,
(\mathbf V^{i_1 i_2})^\dagger.
$$
Because the rank varies with $(i_1,i_2)$, the factors are most naturally treated as a tensor of tensors. SeQuant’s abstract-index representation therefore allows dependent indices such as $a_3^{i_1 i_2}$ and $a_4^{i_1 i_2}$, leading to expressions of the form
$$
t^{i_1 i_2}_{a_1 a_2}\approx
U^{\,a_3^{i_1 i_2}}_{a_1}\,
\Sigma_{a_3^{i_1 i_2},\,a_4^{i_1 i_2}}\,
\bigl(V^{\,a_4^{i_1 i_2}}_{a_2}\bigr)^*.
$$
The paper also describes a compact notation that suppresses repeated protoindex structure while preserving the same dependency semantics [2511.09943].

To support such cases, `AbstractTensor` provides three mode types: bra/ket modes associated with index spaces and optional permutation symmetries, aux modes for non-vector-space directions, and protoindex bundles for nested dependencies. This machinery is used both in symbolic manipulation and in the graph encoding consumed by the canonicalizer [2511.09943].

This support is important because many symbolic tensor systems assume covariant contractions over fixed index spaces. SeQuant explicitly targets settings in which that assumption fails, including tensor factorizations, hypercontractions, multicomponent fields, and nonorthogonal bases [2511.09943].

## 6. Lowering, optimization, and numerical evaluation

After symbolic simplification, `SQ/eval` lowers expressions into an intermediate representation. The paper describes the IR as a full-binary tree whose leaves are constants, variables, or indexed tensor references, and whose internal nodes are specific binary operations such as tensor-tensor addition, tensor-tensor contraction over specified index sets, scalar-tensor scaling, or permutation to a canonical layout [2511.09943].

Each IR node carries a unique canonical identity. For sums and products of scalars this identity is obtained by flattening; for tensor products it is derived from the canonical form of the colored graph. The IR also stores the physical layout order of the output tensor, determined by tensor-network canonicalization [2511.09943].

Three IR-level optimizations are emphasized. The first is tensor-network contraction ordering, implemented as a bottom-up dynamic-programming search that chooses a binary-tree evaluation plan minimizing total FLOPs while exploiting exact runtime dimensions. The second is common-subexpression elimination, enabled by canonical identities so that identical subtrees, even across different equations, are computed once. The third is optional user-driven tensor-network fusion, which factors out common subnetworks across terms [2511.09943].

The optimized IR can then be executed in one of two ways. It can be interpreted directly by a tree-walk evaluator using a pluggable `Result` interface and a cache keyed by canonical identities, or it can be transpiled into C++ or Python that issues calls to an external tensor algebra library such as TiledArray or TACO. The paper presents this mixed symbolic/numerical workflow as a way to avoid repeated recompilation while allowing runtime specialization based on actual index sizes, memory constraints, and executor count [2511.09943].

## 7. Workflows, benchmarked behavior, and naming ambiguity

The paper describes several representative workflows. For tensor-network canonicalization, it uses equivalent forms of a CCD residual,
$$
r^{i_1 i_2}_{a_1 a_2}
=
\bar g^{a_3 a_4}_{i_3 i_4}\,
t^{i_1 i_2}_{a_1 a_3}\,
t^{i_3 i_4}_{a_2 a_4}
=
\bar g^{a_4 a_3}_{i_4 i_3}\,
t^{i_1 i_2}_{a_1 a_4}\,
t^{i_4 i_3}_{a_2 a_3},
$$
and shows that SeQuant maps both to the same canonical colored-graph form, then reorders factors and slots, accumulates antisymmetry signs, and renames dummy indices to produce a unique final expression [2511.09943].

For Wick-theorem derivation of coupled-cluster amplitude equations, the workflow feeds `SQ/tensor` with `NormalOperator` factors and invokes the Wick engine with `full_contractions(true)`. With all optimizations enabled, CCSDTQ amplitudes are reported to take $0.03\,\mathrm s$, and disabling topological optimizations slows the same derivation by more than three orders of magnitude. Table 2 and Figure 7 are summarized as showing sub-second derivations up to rank 8 on a laptop and near-linear scaling of derivation wall time with cluster rank when all optimizations are active [2511.09943].

For numerical evaluation, the paper states that detailed end-to-end timings are deferred to Part II, but internal tests using the TiledArray backend are said to show that interpreted SeQuant plans routinely match or exceed the performance of comparable handwritten code for medium-sized molecules, owing to exact tensor-network contraction ordering and runtime common-subexpression elimination [2511.09943].

The name “SeQuant” also has a distinct use in the arXiv literature that can cause confusion. In “Serial Quantization for Sparse Time Sequences,” SQuaTS is explicitly described as the “SeQuant” scheme: a streaming quantizer-decoder architecture for $k$-sparse time sequences that updates a single $b$-bit register by bitwise OR and achieves asymptotic bit growth $O(k\log T + k\log l)$ while matching the distortion of an $(l+1)$-level scalar quantizer under suitable rate conditions [1907.01691]. This is unrelated to the tensor-algebra library. Two additional similarly named but separate quantization frameworks are “SQuant,” a data-free DNN quantization method based on a diagonal Hessian approximation and the CASE objective [2202.07471], and “SegQuant,” a post-training quantization framework for diffusion models built around SegLinear and DualScale [2507.14811].

Source: https://www.emergentmind.com/topics/sequant