|
Uni20
Asynchronous tensor and runtime library.
|
Status: implemented immediate-host and packed CUDA block-SVD finite-chain replacement checkpoint.
The two-site split keeps Uni20's staged truncation model. Factorization and selection remain separate:
The reusable decomposition exposes the complete singular spectrum. The caller may apply a standard truncation policy, construct an explicit selection, or materialize other selected or null-space factors before changing the MPS.
A canonical two-site center has boundary:
decompose_two_site_center() creates a zero-copy repartition view:
and passes that view to block_svd(). The decomposition assembles and factorizes one dense matrix independently per conserved charge, then materializes the selected factors with their charge and boundary metadata.
For the morphism convention used by the block-SVD API, the selected matrix is reconstructed as:
The names describe the provider SVD factors. Their tensor-network roles after the center repartition are:
| Factor | MPS role |
|---|---|
right_singular_vectors_adjoint | Left site, before absorption |
left_singular_vectors | Right site, after bending the right physical leg back to the domain |
The sweep direction determines where the diagonal tensor is absorbed:
Thus the site left behind by the sweep is the selected isometry and the site in the direction of travel carries the canonical center.
materialize_two_site_mps_split() constructs two owning MpsSite values in a selected local sparse storage policy with ordinary dense blocks. Async, complete, and generalized-diagonal site policies are not materialization targets for this synchronous path. Host and CUDA factor storage are preserved when gathering the selected states. The operation also returns the real diagonal singular_values tensor, exact truncation statistics, and the absorption direction. The selected state set must be nonempty; an empty internal MPS bond is rejected even though empty selections remain useful for other block-SVD materializations.
replace_two_site_from_svd() selects the finite MPS storage policy, constructs both sites, and then calls FiniteMps::replace_pair(). The chain validates both external bonds, both physical spaces, and the new shared internal bond before installing the pair. The returned InstalledMpsBond retains the diagonal Schmidt tensor and truncation diagnostics after its values have been absorbed into one site.
Replacing the pair increments both site revisions. An attached MpoEnvironmentCache consequently preserves left[i] and right[i+2] while invalidating all entries that depend on either replacement site. Any local effective-Hamiltonian object borrowing the invalidated environments must be destroyed before replacement.
The path is synchronous and supports immediate-host LAPACK or packed CUDA cuSOLVER factorization. Both use sparse BlockTensor operations and explicit owning materialization of the two replacement sites. The host path supports real and complex LAPACK scalars. The CUDA path currently supports real float and double; it applies selected singular values to the resident factor through a CUDA transform.
Move-aware materialization, per-block async factorization, CUDA complex factorization, distributed sector selection, normalization policy, and canonical-form diagnostics remain later work. The ground-state DMRG path composes this split with cached environments, the effective Hamiltonian, native Lanczos, pair replacement, and incremental cache refresh. See Directional Two-Site DMRG Sweeps.