Tessera is a novel, quantum-inspired solver for constrained thematic portfolio optimization, formulated as an NP-hard combinatorial problem.
This project reframes the financial optimization problem as a physics ground state search of an Ising model Hamiltonian. We employ a Density Matrix Renormalization Group (DMRG) algorithm to find the optimal portfolio. The core innovation lies in encoding complex, non-linear constraints directly into the tensor structure of the Matrix Product Operator (MPO), which represents the problem's Hamiltonian. This "constraint-intrinsic" method avoids the instability of traditional penalty-based approaches.
A modern portfolio optimization problem goes far beyond the classic Markowitz quadratic program. Let
The objective is to minimize a risk-adjusted objective function
The presence of the binary variables
-
Heuristic & Metaheuristic Algorithms:
-
These methods (e.g., Simulated Annealing, Genetic Algorithms) transform the constrained problem into an unconstrained one using penalty functions.
-
The objective becomes an unstable penalty-based function
$\mathcal{L}(w, z, \lambda)$ :$$\min_{w, z} \quad \mathcal{L} = f(w, z) + \lambda_1 \max\left(0, \sum_i z_i - K\right) + \lambda_2 \max(0, g(w, z) - C)$$ -
Limitation: The solution's quality and validity are highly sensitive to the hyperparameters
$\lambda_i$ . If$\lambda_i$ is too small, the solver will "cheat" and return an invalid solution. If$\lambda_i$ is too large, it creates a "rugged" optimization landscape, trapping the solver in a sub-optimal local minimum.
-
-
Classical Exact Solvers (MIQP Solvers):
- These solvers (e.g., Gurobi, CPLEX) use methods like branch-and-bound.
-
Limitation: Their worst-case runtime complexity is exponential,
$O(2^N)$ , making them computationally intractable for the large asset universes ($N \sim 1000s$ ) required in real-world finance.
Tessera maps this problem to a Quadratic Unconstrained Binary Optimization (QUBO) problem, which is mathematically equivalent to finding the ground state of an Ising model Hamiltonian.
We discretize the weights
This is the core technical innovation. The Hamiltonian
An MPO is a tensor-train decomposition of the operator
To enforce a constraint like cardinality (
Let
This gives the MPO a block-triangular structure in the auxiliary constraint space. Any state
We use the DMRG algorithm to find the ground state of this constraint-aware MPO. DMRG is a variational algorithm that iteratively optimizes a Matrix Product State (MPS)
The DMRG algorithm is exceptionally efficient at this task because it operates in the low-entanglement corner of the state space, which is precisely where the solutions to many combinatorial optimization problems are known to lie.
This method is stable, principled, and requires no penalty-tuning, providing a robust and scalable solver for complex, real-world portfolio optimization.
The entire premise relies on successfully mapping a complex, continuous-variable financial problem onto a discrete, one-dimensional quantum spin model. This abstraction is the first and most significant hurdle.
The portfolio requires continuous weights
-
Imprecision: The true optimal weight for an asset might be
$w_i = 0.0531...$ , but the nearest discrete representation might be$0.05$ . This "discretization error" can lead to a final portfolio that is significantly sub-optimal in the real, continuous-variable world. -
State-Space Explosion: To achieve acceptable precision, each asset
$z_i$ must be represented by multiple spins. For example, using$b=8$ spins (bits) per asset to represent$2^8 = 256$ weight levels. The computational cost of DMRG scales polynomially (e.g., $O(d^3)$) with this local "physical dimension"$d$ . A system with$d=256$ is computationally vast and may be intractable, even if the number of assets$N$ is modest.
The project's core innovation is encoding constraints directly into the MPO. The proposal for a simple cardinality constraint (
However, real-world financial constraints are far more complex, often non-linear and non-local. Consider constraints like:
- "The total portfolio volatility must be
$\le 15%$ ." - "The weighted-average ESG score must be
$\ge 7.5$ ." - "The total volatility contribution from the 'Technology' sector must be
$\le 5%$ ."
These constraints depend on global, all-to-all interactions (
Even if the mapping is theoretically sound, the computational resources required may make it fail in practice. The performance of all tensor network methods is governed by the bond dimension (
The "constraint-aware" MPO works by adding auxiliary indices to the virtual bond
- A cardinality constraint (
$\le K$ assets) requires an auxiliary bond dimension of$\chi_{\text{card}} \approx K+1$ . - A sector-weight constraint (e.g.,
$\le 10%$ in Sector A, discretized to 20 bins) requires$\chi_{\text{sector}} \approx 20$ . - If we have 5 such sector constraints, the total auxiliary bond dimension required to track all constraints simultaneously could be the product of these dimensions:
$\chi_{\text{aux}} \approx \chi_{\text{card}} \times (\chi_{\text{sector}})^5$ .
This bond dimension can grow exponentially with the number of constraints. The MPO itself could become so large that it cannot be constructed or stored in memory, making the problem unsolvable before DMRG even begins.
The DMRG algorithm is efficient only if the solution (the ground state MPS) is "lowly entangled" and can be accurately represented with a small bond dimension,
- This "low entanglement" assumption (known as an "area law") comes from 1D physical systems where interactions are local (each spin only talks to its neighbors).
- A financial portfolio is the exact opposite: it is a globally-coupled, all-to-all system. The covariance matrix
$\Sigma$ links every single asset to every other asset. - This global coupling will almost certainly produce a highly entangled ground state.
- Accurately representing this state will require an MPS bond dimension
$\chi_{\text{sol}}$ that may grow exponentially with$N$ . Since the runtime of DMRG scales as$O(N \cdot d^3 \cdot \chi_{\text{sol}}^3)$ , an exploding$\chi_{\text{sol}}$ makes the algorithm intractably slow.
Finally, even if the project is theoretically sound and computationally feasible, it could fail by simply not being better than mature, existing solutions.
The proposal positions DMRG as a "principled" alternative to "unstable" heuristics. This is true, but DMRG is also a heuristic.
It is a variational algorithm, meaning it iteratively improves a candidate solution (the MPS). It is not guaranteed to find the true, global ground state. For a complex, "frustrated" Hamiltonian (which a financial problem will be), DMRG can get stuck in a local minimum (a sub-optimal portfolio), just as a genetic algorithm can.
Classical Solvers
The project's ultimate success is not just "does it run?" but "is it better?". It could fail if:
-
For Small-to-Medium Problems (
$N \sim 500$ ): A commercial MIQP solver (like Gurobi or CPLEX) finds the provably optimal, continuous-weight solution in less time. -
For Large Problems (
$N \sim 5000$ ): A well-tuned, standard heuristic (like Simulated Annealing or a Genetic Algorithm) running on a GPU finds an equally good (or better) solution in a fraction of the time.
If Tessera cannot outperform these benchmarks, it is a sophisticated solution to a problem that is already solved more effectively by other means.
The name Tessera is a metaphor for the combinatorial optimization problem at the heart of this project.
A "tessera" is a single, small tile used to create a mosaic. By itself, one tile has little value or meaning. However, when you combine thousands of individual tesserae, adhering to a specific set of rules and constraints (the design), you create a large, complex, and optimized image.
This directly mirrors our problem:
-
A Tessera (tile) = A single asset (
$z_i$ ). -
The Rules (design) = The financial constraints (
$\sum z_i \le K$ , sector limits, etc.). - The Mosaic (final image) = The optimal, fully-constructed portfolio.
Tessera is the engine that intelligently selects and places each individual asset to construct this optimal portfolio, perfectly adhering to all constraints.