> For the complete documentation index, see [llms.txt](https://docs.quantaria.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quantaria.xyz/deep-dives/svd-and-truncation.md).

# Singular value decomposition and truncation

The singular value decomposition (SVD) is the workhorse operation behind tensor-network compression. This page explains what it does and how truncation uses it.

## The decomposition

Any matrix M can be written as M = U Σ V†, where:

* U and V have orthonormal columns
* Σ is diagonal and holds the singular values, sorted from largest to smallest

The singular values measure how much each direction contributes to M.

## Truncation

If only the first r singular values are large, you can keep the first r columns of U and V and drop the rest. The result is the best rank-r approximation of M in the least-squares sense (the Eckart–Young theorem).

For tensor networks, this is applied at each bond. The matrix being decomposed is reshaped from the two cores on either side of the bond. Keeping the top r singular values sets the new bond dimension.

## The error budget

The error introduced by truncation is at most the square root of the sum of the discarded squared singular values. This gives a direct way to set a tolerance: discard the smallest values until the discarded weight reaches the budget.

## Connection to Schmidt coefficients

When the matrix comes from splitting a quantum state across a cut, its singular values are the Schmidt coefficients. Truncating them is the same operation physicists use to bound entanglement. See [Schmidt decomposition](/deep-dives/schmidt-decomposition.md).

## Quantaria's use

Schmidt-rank truncation is one of the core operations in Quantaria's stack. The bond-dimension settings in Hilbert-1 come from training, and the same SVD operation is used to move between canonical forms. See [Canonical forms and sweeps](/deep-dives/canonical-forms-and-sweeps.md).

## What to watch for

* Truncating many bonds at once compounds the error. Sweeping across the chain one bond at a time keeps the error controlled.
* Singular values that decay slowly mean the bond needs a large χ. This is one signal rank-adaptive training can use.

## Related

* [Bond dimension and entanglement entropy](/deep-dives/bond-dimension-and-entanglement.md)
* [Rank-adaptive training](/deep-dives/rank-adaptive-training.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.quantaria.xyz/deep-dives/svd-and-truncation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
