Bond dimension
Reference for changing the bond dimension of a state — expanding or truncating its virtual spaces — and for inspecting those virtual spaces directly. For a task-oriented walkthrough see Controlling bond dimension; the full, canonical docstrings for the whole package live in the Library index.
Interface
MPSKit.changebonds Function
changebonds(ψ::AbstractMPS, H, alg, envs) -> ψ′, envs′
changebonds(ψ::AbstractMPS, alg) -> ψ′Change the bond dimension of ψ using the algorithm alg, and return the new ψ and the new envs. For AbstractInfiniteMPS, changebonds returns new environments without modifying the one provided. changedbonds! can modify both the provided state and environments, depending on the algorithm. For FiniteMPS, changebonds also modifies the environments.
See also: SvdCut, RandExpand, VUMPSSvdCut, OptimalExpand
MPSKit.changebonds! Function
changebonds(ψ::AbstractMPS, H, alg, envs) -> ψ′, envs′
changebonds(ψ::AbstractMPS, alg) -> ψ′Change the bond dimension of ψ using the algorithm alg, and return the new ψ and the new envs. For AbstractInfiniteMPS, changebonds returns new environments without modifying the one provided. changedbonds! can modify both the provided state and environments, depending on the algorithm. For FiniteMPS, changebonds also modifies the environments.
See also: SvdCut, RandExpand, VUMPSSvdCut, OptimalExpand
Expansion and truncation algorithms
MPSKit.OptimalExpand Type
struct OptimalExpand{S} <: MPSKit.AlgorithmAn algorithm that expands the given mps as described in Zauner-Stauber et al. Phys. Rev. B 97 (2018), by selecting the dominant contributions of a two-site updated MPS tensor, orthogonal to the original ψ.
The expansion is state-preserving: the added directions are connected through a zero block, so that the expanded state represents the same physical state as the original one (as required for e.g. TDVP).
Note
changebonds! is only defined for FiniteMPS, and modifies both the state and its environment.
Fields
alg_svd::Any: algorithm used for the singular value decompositiontrscheme::MatrixAlgebraKit.TruncationStrategy: algorithm used for truncating the expanded space
See also
Used as the algorithm argument of changebonds and changebonds!.
MPSKit.RandExpand Type
struct RandExpand{S} <: MPSKit.AlgorithmAn algorithm that expands the bond dimension by adding random unitary vectors that are orthogonal to the existing state. This means that additional directions are added to AL and AR that are contained in the nullspace of both. Note that this is happens in parallel, and therefore the expansion will never go beyond the local two-site subspace.
The truncation strategy dictates the number of expanded states, by generating uniformly distributed weights for each state in the two-site space and truncating that.
Note
The environments are not used here, but changebonds! modifies both the state and environment so they remain consistent.
Fields
alg_svd::Any: algorithm used for the singular value decompositiontrscheme::MatrixAlgebraKit.TruncationStrategy: algorithm used for truncation of the expanded space
See also
Used as the algorithm argument of changebonds and changebonds!.
MPSKit.SvdCut Type
struct SvdCut{S} <: MPSKit.AlgorithmAn algorithm that uses truncated SVD to change the bond dimension of a state or operator. This is achieved by a sweeping algorithm that locally performs (optimal) truncations in a gauged basis.
changedbonds! is only defined for FiniteMPS and FiniteMPO.
Fields
alg_svd::Any: algorithm used for the singular value decompositiontrscheme::MatrixAlgebraKit.TruncationStrategy: algorithm used for truncation of the gauge tensors
See also
Used as the algorithm argument of changebonds and changebonds!.
References
sourceMPSKit.VUMPSSvdCut Type
struct VUMPSSvdCut <: MPSKit.AlgorithmAn algorithm that uses a two-site update step to change the bond dimension of a state.
Note
changebonds! is not defined.
Fields
alg_gauge::Any: algorithm used for gauging theInfiniteMPSalg_eigsolve::Any: algorithm used for the eigenvalue solversalg_svd::Any: algorithm used for the singular value decompositiontrscheme::MatrixAlgebraKit.TruncationStrategy: algorithm used for truncation of the two-site update
See also
Used as the algorithm argument of changebonds.
MPSKit.SketchedExpand Type
struct SketchedExpand{S} <: MPSKit.AlgorithmAn algorithm that expands the bond dimension like OptimalExpand — selecting the dominant directions of the projected two-site update orthogonal to the current state — but at single-site cost using the randomized "shrewd selection" of Controlled Bond Expansion (Gleis et al. Phys. Rev. Lett. 130, 246402 (2023)). A random sketch of the orthogonal complement is folded into the effective environment, collapsing the large bond before the two-site update is ever formed, and the dominant directions are read off a small singular value decomposition.
The state-preserving behaviour matches OptimalExpand.
Note
Only defined for FiniteMPS (through changebond!), so it can be used standalone or as the alg_expand strategy of DMRG. The reported ϵ_2site is a randomized estimate, and the folded application does not exploit JordanMPO sparsity.
Fields
alg_orth::Any: algorithm used to orthonormalize the sketched complement (passed as thealgofleft_orth!/right_orth!);nothingselects QR without oversampling and an SVD-based decomposition otherwisetrscheme::MatrixAlgebraKit.TruncationStrategy: algorithm used for truncating the expanded spaceoversampling::Int64: number of extra sketch columns drawn beyond the target rank (range-finder oversampling)
See also
Used as the algorithm argument of changebonds and changebonds!.
Note
SketchedExpand is experimental: it uses randomized controlled bond expansion (CBE), so its reported error estimate is itself randomized, and it is only defined for FiniteMPS.
Inspecting the virtual spaces
The bond dimension of an MPS or MPO is the dimension of the virtual space living on a given bond. The accessors below return that VectorSpace, whose dim gives the numeric bond dimension.
MPSKit.left_virtualspace Function
left_virtualspace(ψ::AbstractMPS, [pos=1:length(ψ)])Return the virtual space of the bond to the left of sites pos.
Warning
In rare cases, the gauge tensor on the virtual space might not be square, and as a result it cannot always be guaranteed that right_virtualspace(ψ, i - 1) == left_virtualspace(ψ, i)
MPSKit.right_virtualspace Function
right_virtualspace(ψ::AbstractMPS, [pos=1:length(ψ)])Return the virtual space of the bond to the right of site(s) pos.
Warning
In rare cases, the gauge tensor on the virtual space might not be square, and as a result it cannot always be guaranteed that right_virtualspace(ψ, i - 1) == left_virtualspace(ψ, i)
MPSKit.physicalspace Function
physicalspace(ψ::AbstractMPS, [pos=1:length(ψ)])Return the physical space of the site tensor at site i.
<!– Maintainer notes (docs-writer):
Symbols included: changebonds, changebonds!, OptimalExpand, RandExpand, SvdCut, VUMPSSvdCut, SketchedExpand, left_virtualspace, right_virtualspace, physicalspace.
Caveats / REVIEW items for the maintainer: (a) The 4-arg changebonds(ψ, H, alg, envs) default keyword/positional behavior for envs is inconsistent across algorithms: envs=nothing for RandExpand/SvdCut vs envs=environments(...) for OptimalExpand/SketchedExpand/VUMPSSvdCut. This is surfaced verbatim in the docstrings pulled in above; not restated here. (b) SvdCut applied to an InfiniteMPO carries an in-source TODO about generalizing to finite MPOs — worth confirming intended scope before promoting this further. (c) The singular changebond/changebond! functions exist and are documented in source but are NOT exported, so they are intentionally omitted from this reference page (kept consistent with canonical=false covering only exported, public-facing symbols). –>