Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Concepts | Typedefs | Enumerations | Functions | Variables
uni20::tensor_network Namespace Reference

Classes

struct  DmrgLanczosOptions
 Numerical policy for one lightweight DMRG local Lanczos solve. More...
 
struct  DmrgLanczosResult
 Approximate local ground state produced by fixed-step DMRG Lanczos. More...
 
class  FiniteMpo
 Homogeneous finite MPO owner with exact auxiliary connectivity. More...
 
class  FiniteMps
 Homogeneous finite MPS owner with exact bond connectivity. More...
 
struct  InstalledMpsBond
 Bond data retained after installing a two-site MPS split. More...
 
class  LocalTwoSiteEffectiveHamiltonian
 Apply a local two-site operator to a fixed BlockTensor center. More...
 
class  MpoEnvironmentCache
 Directional MPO environment cache borrowed from finite MPS and MPO owners. More...
 
class  PreparedRightFirstRabcContraction
 Prepared right-first executor for one fixed R/A/B/C structure. More...
 
struct  rabc_contract_op
 Fixed-output sparse R/A/B/C contraction operation tag. More...
 
class  RabcContractionPlan
 Immutable sparse coefficient tensor for an R/A/B/C contraction. More...
 
struct  RabcTerm
 One nonzero coefficient in R_r += f(r,a,b,c) A_a B_b transpose(C_c). More...
 
struct  RightFirstRabcBackend
 Executor that reuses right-first (B_b,C_c) intermediates. More...
 
struct  TwoSiteDmrgOptions
 Numerical policies for one finite-chain two-site DMRG update. More...
 
struct  TwoSiteDmrgRunOptions
 Policies for an alternating finite-chain two-site DMRG run. More...
 
struct  TwoSiteDmrgRunResult
 Result of an alternating finite-chain two-site DMRG run. More...
 
struct  TwoSiteDmrgStepResult
 Diagnostics and selected bond data from one DMRG bond update. More...
 
struct  TwoSiteDmrgSweepSummary
 Aggregate diagnostics for one completed directional DMRG sweep. More...
 
class  TwoSiteEffectiveHamiltonian
 Matrix-free two-site Hamiltonian compiled from environments and MPO sites. More...
 
struct  TwoSiteMpsSplit
 Directionally absorbed two-site MPS factors and retained bond data. More...
 

Concepts

concept  RabcPlan
 Concrete logical R/A/B/C coefficient-plan type.
 

Typedefs

using DetailedTwoSiteDmrgPerformanceMeasurements = performance::DetailedMeasurements< TwoSiteDmrgPerformanceEvent, static_cast< std::size_t >(TwoSiteDmrgPerformanceEvent::count)>
 Detailed DMRG measurements including per-sector block-SVD batch timings.
 
template<typename Scalar , class BraBond , class Auxiliary , class KetBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using MpoEnvironment = BlockTensor< Scalar, Domain< BraBond, Auxiliary >, Codomain< KetBond >, Storage >
 Left or right MPO environment with (bra bond, auxiliary, ket bond) key order.
 
template<typename Scalar , class LeftAuxiliary , class InputPhysical , class RightAuxiliary , class OutputPhysical , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using MpoSite = BlockTensor< Scalar, Domain< LeftAuxiliary, InputPhysical >, Codomain< RightAuxiliary, OutputPhysical >, Storage >
 One MPO site with input physical and left auxiliary domain factors.
 
template<typename Scalar , class LeftBond , class Physical , class RightBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using MpsSite = BlockTensor< Scalar, Domain< LeftBond, Physical >, Codomain< RightBond >, Storage >
 One MPS site with the physical factor on the domain side.
 
template<typename Scalar , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using ScalarEnvironment = BlockTensor< Scalar, Domain<>, Codomain<>, Storage >
 Rank-zero BlockTensor used for a scalar boundary environment.
 
template<typename Scalar , class LeftBond , class LeftPhysical , class RightPhysical , class RightBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using TwoSiteCenter = BlockTensor< Scalar, Domain< LeftBond, LeftPhysical, RightPhysical >, Codomain< RightBond >, Storage >
 Two adjacent MPS sites combined into one optimization center.
 
using TwoSiteDmrgPerformanceMeasurements = performance::DurationMeasurements< TwoSiteDmrgPerformanceEvent, static_cast< std::size_t >(TwoSiteDmrgPerformanceEvent::count)>
 Coarse inclusive wall-duration measurements for two-site DMRG phases.
 
template<typename Scalar , class LeftPhysical , class RightPhysical , BlockTensorStorage Storage = PackedSparseBlockStorage<>>
using TwoSiteLocalOperator = BlockTensor< Scalar, Domain< Dual< LeftPhysical >, Dual< RightPhysical > >, Codomain< Dual< LeftPhysical >, Dual< RightPhysical > >, Storage >
 Charge-preserving operator acting on two adjacent physical spaces.
 

Enumerations

enum class  MpsSweepDirection { left_to_right , right_to_left }
 Direction in which a two-site split moves the MPS canonical center. More...
 
enum class  TwoSiteDmrgPerformanceEvent {
  run , sweep , bond_update , center_construction ,
  local_eigensolver , effective_hamiltonian_application , krylov_vector_allocation , krylov_vector_update ,
  krylov_reduction , block_svd , svd_sector_batch , state_selection ,
  factor_materialization , environment_update , count
}
 Stable phase identifiers for two-site DMRG performance measurements. More...
 

Functions

template<detail::TwoSiteSvdCenter Center, class Measurements , class Event >
requires uni20::LapackScalar<block_tensor_value_t<Center>> && performance::BatchMeasurementPolicy<Measurements, Event>
auto decompose_two_site_center (Center const &center, linalg::SvdOptions options, Measurements &measurements, Event batch_event)
 Factorize a canonical two-site MPS center by its internal cut with performance measurements.
 
template<detail::TwoSiteSvdCenter Center>
requires uni20::LapackScalar<block_tensor_value_t<Center>>
auto decompose_two_site_center (Center const &center, linalg::SvdOptions options={})
 Factorize a canonical two-site MPS center by its internal cut.
 
template<uni20::LapackRealOrComplex Scalar, class Vector , krylov::KrylovMatrixFreeOperator< Vector, Scalar > Ops>
auto dmrg_lanczos_ground_state (Ops &ops, Vector const &initial, DmrgLanczosOptions< uni20::make_real_t< Scalar > > const &options={}) -> DmrgLanczosResult< uni20::make_real_t< Scalar >, Vector >
 Perform a lightweight fixed-step Lanczos local ground-state update.
 
template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView BraSite, detail::EnvironmentMpoView Mpo, detail::EnvironmentMatrixView KetSite>
requires detail::CompatibleEnvironmentUpdateScalars<Environment, BraSite, Mpo, KetSite> && detail::CompatibleLeftEnvironmentUpdateSpaces<Environment, BraSite, Mpo, KetSite> && detail::EnvironmentStorageFor<OutputStorage, block_tensor_value_t<Environment>>
auto extend_left_environment (Environment const &environment, BraSite const &bra_site, Mpo const &mpo, KetSite const &ket_site)
 Extend a left MPO environment across distinct bra and ket MPS sites.
 
template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView Site, detail::EnvironmentMpoView Mpo>
auto extend_left_environment (Environment const &environment, Site const &site, Mpo const &mpo)
 Extend a left MPO environment using one site as both bra and ket.
 
template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView BraSite, detail::EnvironmentMpoView Mpo, detail::EnvironmentMatrixView KetSite>
requires detail::CompatibleEnvironmentUpdateScalars<Environment, BraSite, Mpo, KetSite> && detail::CompatibleRightEnvironmentUpdateSpaces<Environment, BraSite, Mpo, KetSite> && detail::EnvironmentStorageFor<OutputStorage, block_tensor_value_t<Environment>>
auto extend_right_environment (Environment const &environment, BraSite const &bra_site, Mpo const &mpo, KetSite const &ket_site)
 Extend a right MPO environment across distinct bra and ket MPS sites.
 
template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView Site, detail::EnvironmentMpoView Mpo>
auto extend_right_environment (Environment const &environment, Site const &site, Mpo const &mpo)
 Extend a right MPO environment using one site as both bra and ket.
 
template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
consteval auto kernel_accepts_types (RightFirstRabcBackend< IntermediateStorage, ContractionSelector > const &, rabc_contract_op const &, Output &, Plan const &, A const &, B const &, C const &)
 Report right-first eligibility for matrix-block operands.
 
template<class Hamiltonian >
 LocalTwoSiteEffectiveHamiltonian (Hamiltonian) -> LocalTwoSiteEffectiveHamiltonian< std::remove_cvref_t< Hamiltonian > >
 
template<typename Value , SparseBlockStorage Storage = SeparateSparseBlockStorage<>>
requires Scalar<Value> && detail::EnvironmentStorageFor<Storage, Value>
auto make_identity_mpo_environment (BlockSpace const &bond, LocalSpace const &auxiliary, std::size_t auxiliary_index) -> MpoEnvironment< Value, BlockSpace, LocalSpace, BlockSpace, Storage >
 Construct an identity MPO environment at one scalar auxiliary state.
 
template<typename Value , SparseBlockStorage Storage = SeparateSparseBlockStorage<>, class Context >
requires Scalar<Value> && detail::EnvironmentStorageFor<Storage, Value> && requires( BlockSpace const& bond, LocalSpace const& auxiliary, std::vector<typename MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>::key_type> keys, Context& context) { MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>( uninitialized, bond.symmetry(), Domain{bond, auxiliary}, Codomain{bond}, std::move(keys), context); }
auto make_identity_mpo_environment (BlockSpace const &bond, LocalSpace const &auxiliary, std::size_t auxiliary_index, Context &context) -> MpoEnvironment< Value, BlockSpace, LocalSpace, BlockSpace, Storage >
 Construct an identity MPO environment in an explicit leaf allocation context.
 
template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
requires detail::CompatibleMpoEffectiveScalars<Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment>
auto make_two_site_effective_hamiltonian (Center const &prototype, LeftEnvironment const &left_environment, FirstMpo const &first_mpo, SecondMpo const &second_mpo, RightEnvironment const &right_environment)
 Compile a two-site effective Hamiltonian borrowing environment payloads.
 
template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, class Decomposition >
requires detail::MpsSiteStorage<OutputStorage, typename Decomposition::scalar_type>
auto materialize_two_site_mps_split (Decomposition const &decomposition, BlockSvdSelection< typename Decomposition::real_type > const &selection, MpsSweepDirection direction, BlockSvdMaterializationOptions options={})
 Materialize selected SVD states as a directional pair of owning MPS sites.
 
template<class MpsChain , class MpoChain >
 MpoEnvironmentCache (MpsChain const &, MpoChain const &, std::size_t, std::size_t) -> MpoEnvironmentCache< MpsChain, MpoChain >
 Deduce chain owner types while retaining the default environment storage.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto optimize_two_site_dmrg_bond (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, std::size_t first_site, MpsSweepDirection direction, TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &options, Measurements &measurements, CenterStorage center_storage={})
 Optimize and replace one adjacent MPS pair with a measured ground-state DMRG step.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto optimize_two_site_dmrg_bond (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, std::size_t first_site, MpsSweepDirection direction, TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &options={}, CenterStorage center_storage={})
 Optimize and replace one adjacent MPS pair without performance measurements.
 
template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
auto prepare_rabc_contract (linalg::backend_list< RightFirstRabcBackend< IntermediateStorage, ContractionSelector > > selector, Output const &output, Plan plan, A const &a, B const &b, C const &c)
 Prepare the single right-first backend selected for fixed R/A/B/C operands.
 
template<detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
auto prepare_rabc_contract (Output const &output, Plan plan, A const &a, B const &b, C const &c)
 Select and prepare the R/A/B/C backend for one fixed block structure.
 
template<linalg::KernelBackendSelector BackendSelector, MutableBlockTensorView Output, RabcPlan Plan, BlockTensorView A, BlockTensorView B, BlockTensorView C>
void rabc_contract (BackendSelector &&selector, Output &output, Plan const &plan, A const &a, B const &b, C const &c)
 Execute a fixed-output sparse R/A/B/C contraction with an explicit backend selector.
 
template<MutableBlockTensorView Output, RabcPlan Plan, BlockTensorView A, BlockTensorView B, BlockTensorView C>
void rabc_contract (Output &output, Plan const &plan, A const &a, B const &b, C const &c)
 Execute a sparse R/A/B/C contraction using the output storage policy.
 
template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage SiteStorage, class Decomposition >
requires std::same_as<Bond, BlockSpace> && detail::MpsSiteStorage<SiteStorage, Scalar>
auto replace_two_site_from_svd (FiniteMps< Scalar, Bond, Physical, SiteStorage > &mps, std::size_t first_index, Decomposition const &decomposition, BlockSvdSelection< typename Decomposition::real_type > const &selection, MpsSweepDirection direction, BlockSvdMaterializationOptions options={})
 Materialize and install a selected two-site split in a finite MPS.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto run_two_site_dmrg (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, TwoSiteDmrgRunOptions< make_real_t< typename MpsChain::value_type > > const &options, Measurements &measurements, CenterStorage center_storage={})
 Run measured alternating directional sweeps until terminal-energy convergence.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto run_two_site_dmrg (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, TwoSiteDmrgRunOptions< make_real_t< typename MpsChain::value_type > > const &options={}, CenterStorage center_storage={})
 Run alternating directional sweeps without performance measurements.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto sweep_two_site_dmrg (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, MpsSweepDirection direction, TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &options, Measurements &measurements, CenterStorage center_storage={})
 Traverse every adjacent bond once in one measured two-site DMRG direction.
 
template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto sweep_two_site_dmrg (MpsChain &mps, MpoChain const &mpo, MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &cache, MpsSweepDirection direction, TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &options={}, CenterStorage center_storage={})
 Traverse every adjacent bond once without performance measurements.
 
template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C> && (detail::right_first_types_compatible<IntermediateStorage, ContractionSelector, Output, typename std::remove_cvref_t<Plan>::scalar_type, A, B, C>())
auto try_kernel (RightFirstRabcBackend< IntermediateStorage, ContractionSelector > const &backend, rabc_contract_op const &, Output &output, Plan const &plan, A const &a, B const &b, C const &c) -> linalg::KernelAttempt
 Execute a storage-domain right-first R/A/B/C contraction.
 
constexpr auto two_site_dmrg_performance_event_name (TwoSiteDmrgPerformanceEvent event) noexcept -> std::string_view
 Return the stable display name of one DMRG performance event.
 
template<class Center , class LeftEnvironment , class FirstMpo , class SecondMpo , class RightEnvironment >
 TwoSiteEffectiveHamiltonian (Center const &, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment) -> TwoSiteEffectiveHamiltonian< std::remove_cvref_t< Center >, std::remove_cvref_t< LeftEnvironment >, std::remove_cvref_t< FirstMpo >, std::remove_cvref_t< SecondMpo >, std::remove_cvref_t< RightEnvironment > >
 

Variables

template<class T >
constexpr bool is_rabc_contraction_plan = false
 
template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
constexpr bool is_rabc_contraction_plan< RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey > > = true
 

Typedef Documentation

◆ DetailedTwoSiteDmrgPerformanceMeasurements

Detailed DMRG measurements including per-sector block-SVD batch timings.

◆ MpoEnvironment

template<typename Scalar , class BraBond , class Auxiliary , class KetBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::MpoEnvironment = typedef BlockTensor<Scalar, Domain<BraBond, Auxiliary>, Codomain<KetBond>, Storage>

Left or right MPO environment with (bra bond, auxiliary, ket bond) key order.

◆ MpoSite

template<typename Scalar , class LeftAuxiliary , class InputPhysical , class RightAuxiliary , class OutputPhysical , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::MpoSite = typedef BlockTensor<Scalar, Domain<LeftAuxiliary, InputPhysical>, Codomain<RightAuxiliary, OutputPhysical>, Storage>

One MPO site with input physical and left auxiliary domain factors.

◆ MpsSite

template<typename Scalar , class LeftBond , class Physical , class RightBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::MpsSite = typedef BlockTensor<Scalar, Domain<LeftBond, Physical>, Codomain<RightBond>, Storage>

One MPS site with the physical factor on the domain side.

◆ ScalarEnvironment

template<typename Scalar , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::ScalarEnvironment = typedef BlockTensor<Scalar, Domain<>, Codomain<>, Storage>

Rank-zero BlockTensor used for a scalar boundary environment.

◆ TwoSiteCenter

template<typename Scalar , class LeftBond , class LeftPhysical , class RightPhysical , class RightBond , BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::TwoSiteCenter = typedef BlockTensor<Scalar, Domain<LeftBond, LeftPhysical, RightPhysical>, Codomain<RightBond>, Storage>

Two adjacent MPS sites combined into one optimization center.

◆ TwoSiteDmrgPerformanceMeasurements

Coarse inclusive wall-duration measurements for two-site DMRG phases.

◆ TwoSiteLocalOperator

template<typename Scalar , class LeftPhysical , class RightPhysical , BlockTensorStorage Storage = PackedSparseBlockStorage<>>
using uni20::tensor_network::TwoSiteLocalOperator = typedef BlockTensor<Scalar, Domain<Dual<LeftPhysical>, Dual<RightPhysical> >, Codomain<Dual<LeftPhysical>, Dual<RightPhysical> >, Storage>

Charge-preserving operator acting on two adjacent physical spaces.

Enumeration Type Documentation

◆ MpsSweepDirection

Direction in which a two-site split moves the MPS canonical center.

Enumerator
left_to_right 

Absorb singular values into the right site.

right_to_left 

Absorb singular values into the left site.

◆ TwoSiteDmrgPerformanceEvent

Stable phase identifiers for two-site DMRG performance measurements.

Enumerator
run 
sweep 
bond_update 
center_construction 
local_eigensolver 
effective_hamiltonian_application 
krylov_vector_allocation 
krylov_vector_update 
krylov_reduction 
block_svd 
svd_sector_batch 
state_selection 
factor_materialization 
environment_update 
count 

Function Documentation

◆ decompose_two_site_center() [1/2]

template<detail::TwoSiteSvdCenter Center, class Measurements , class Event >
requires uni20::LapackScalar<block_tensor_value_t<Center>> && performance::BatchMeasurementPolicy<Measurements, Event>
auto uni20::tensor_network::decompose_two_site_center ( Center const &  center,
linalg::SvdOptions  options,
Measurements &  measurements,
Event  batch_event 
)

Factorize a canonical two-site MPS center by its internal cut with performance measurements.

The input boundary is Domain<left bond, left physical, right physical> -> Codomain<right bond>. A zero-copy repartition presents the matrix boundary Domain<left bond, left physical> -> Codomain<right bond, Dual<right physical>> to the staged block-SVD implementation.

Parameters
centerTwo-site center supported by the selected block-SVD implementation.
optionsDense SVD vector options applied independently by charge.
measurementsExplicit measurement policy or collector.
batch_eventEvent identifying the per-charge factorization batch.
Returns
Reusable decomposition whose spectrum may be selected repeatedly.

◆ decompose_two_site_center() [2/2]

template<detail::TwoSiteSvdCenter Center>
requires uni20::LapackScalar<block_tensor_value_t<Center>>
auto uni20::tensor_network::decompose_two_site_center ( Center const &  center,
linalg::SvdOptions  options = {} 
)

Factorize a canonical two-site MPS center by its internal cut.

This ordinary overload instantiates no performance measurements.

Parameters
centerTwo-site center supported by the selected block-SVD implementation.
optionsDense SVD vector options applied independently by charge.
Returns
Reusable decomposition whose spectrum may be selected repeatedly.

◆ dmrg_lanczos_ground_state()

template<uni20::LapackRealOrComplex Scalar, class Vector , krylov::KrylovMatrixFreeOperator< Vector, Scalar > Ops>
auto uni20::tensor_network::dmrg_lanczos_ground_state ( Ops &  ops,
Vector const &  initial,
DmrgLanczosOptions< uni20::make_real_t< Scalar > > const &  options = {} 
) -> DmrgLanczosResult<uni20::make_real_t<Scalar>, Vector>

Perform a lightweight fixed-step Lanczos local ground-state update.

This is the DMRG local optimization policy, not a general convergence-seeking eigensolver. It uses the Hermitian three-term recurrence without full reorthogonalization, solves one small real tridiagonal projected problem, and always returns its smallest Ritz pair. Exact invariant-subspace breakdown may stop before the requested number of matvecs. The basis is limited by the problem dimension.

Exceptions
std::invalid_argumentIf the problem, initial vector, or iteration count is invalid.
std::runtime_errorIf a complex projection has a non-negligible imaginary diagonal.
Template Parameters
ScalarReal or complex local wavefunction scalar with LAPACK coverage.
VectorOpaque local wavefunction type.
OpsMatrix-free vector and effective-Hamiltonian operations.
Parameters
opsMatrix-free operations for the fixed local problem.
initialCurrent two-site wavefunction used as the starting vector.
optionsFixed local work policy.
Returns
Approximate smallest Ritz pair and local-work diagnostics.

◆ extend_left_environment() [1/2]

template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView BraSite, detail::EnvironmentMpoView Mpo, detail::EnvironmentMatrixView KetSite>
requires detail::CompatibleEnvironmentUpdateScalars<Environment, BraSite, Mpo, KetSite> && detail::CompatibleLeftEnvironmentUpdateSpaces<Environment, BraSite, Mpo, KetSite> && detail::EnvironmentStorageFor<OutputStorage, block_tensor_value_t<Environment>>
auto uni20::tensor_network::extend_left_environment ( Environment const &  environment,
BraSite const &  bra_site,
Mpo const &  mpo,
KetSite const &  ket_site 
)

Extend a left MPO environment across distinct bra and ket MPS sites.

Computes each reachable output block as a sparse sum of coefficient * conj(bra)^T * environment * ket contributions.

Template Parameters
OutputStorageSparse local storage selected for the result.
Parameters
environmentEnvironment immediately to the left of the site.
bra_siteBra MPS site whose left bond meets the environment.
mpoMPO site whose left auxiliary meets the environment.
ket_siteKet MPS site whose left bond meets the environment.

◆ extend_left_environment() [2/2]

template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView Site, detail::EnvironmentMpoView Mpo>
auto uni20::tensor_network::extend_left_environment ( Environment const &  environment,
Site const &  site,
Mpo const &  mpo 
)

Extend a left MPO environment using one site as both bra and ket.

Parameters
environmentEnvironment immediately to the left of the site.
siteMPS site used as both bra and ket.
mpoMPO site whose left auxiliary meets the environment.

◆ extend_right_environment() [1/2]

template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView BraSite, detail::EnvironmentMpoView Mpo, detail::EnvironmentMatrixView KetSite>
requires detail::CompatibleEnvironmentUpdateScalars<Environment, BraSite, Mpo, KetSite> && detail::CompatibleRightEnvironmentUpdateSpaces<Environment, BraSite, Mpo, KetSite> && detail::EnvironmentStorageFor<OutputStorage, block_tensor_value_t<Environment>>
auto uni20::tensor_network::extend_right_environment ( Environment const &  environment,
BraSite const &  bra_site,
Mpo const &  mpo,
KetSite const &  ket_site 
)

Extend a right MPO environment across distinct bra and ket MPS sites.

Computes each reachable output block as a sparse sum of coefficient * conj(bra) * environment * ket^T contributions.

Template Parameters
OutputStorageSparse local storage selected for the result.
Parameters
environmentEnvironment immediately to the right of the site.
bra_siteBra MPS site whose right bond meets the environment.
mpoMPO site whose right auxiliary meets the environment.
ket_siteKet MPS site whose right bond meets the environment.

◆ extend_right_environment() [2/2]

template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, detail::EnvironmentMatrixView Environment, detail::EnvironmentMatrixView Site, detail::EnvironmentMpoView Mpo>
auto uni20::tensor_network::extend_right_environment ( Environment const &  environment,
Site const &  site,
Mpo const &  mpo 
)

Extend a right MPO environment using one site as both bra and ket.

Parameters
environmentEnvironment immediately to the right of the site.
siteMPS site used as both bra and ket.
mpoMPO site whose right auxiliary meets the environment.

◆ kernel_accepts_types()

template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
consteval auto uni20::tensor_network::kernel_accepts_types ( RightFirstRabcBackend< IntermediateStorage, ContractionSelector > const &  ,
rabc_contract_op const &  ,
Output &  ,
Plan const &  ,
A const &  ,
B const &  ,
C const &   
)

Report right-first eligibility for matrix-block operands.

◆ LocalTwoSiteEffectiveHamiltonian()

template<class Hamiltonian >
uni20::tensor_network::LocalTwoSiteEffectiveHamiltonian ( Hamiltonian  ) -> LocalTwoSiteEffectiveHamiltonian< std::remove_cvref_t< Hamiltonian > >

◆ make_identity_mpo_environment() [1/2]

template<typename Value , SparseBlockStorage Storage = SeparateSparseBlockStorage<>>
requires Scalar<Value> && detail::EnvironmentStorageFor<Storage, Value>
auto uni20::tensor_network::make_identity_mpo_environment ( BlockSpace const &  bond,
LocalSpace const &  auxiliary,
std::size_t  auxiliary_index 
) -> MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>

Construct an identity MPO environment at one scalar auxiliary state.

One identity matrix block is stored for every bond sector. The environment key order is (bra bond, auxiliary, ket bond).

Template Parameters
ValueScalar element type.
StorageSparse local storage selected for the result.
Parameters
bondExact bra and ket bond space.
auxiliaryMPO boundary auxiliary space.
auxiliary_indexIdentity-charge auxiliary state to activate.
Exceptions
std::invalid_argumentIf symmetries differ, the index is invalid, or the selected auxiliary state is not the identity charge.

◆ make_identity_mpo_environment() [2/2]

template<typename Value , SparseBlockStorage Storage = SeparateSparseBlockStorage<>, class Context >
requires Scalar<Value> && detail::EnvironmentStorageFor<Storage, Value> && requires( BlockSpace const& bond, LocalSpace const& auxiliary, std::vector<typename MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>::key_type> keys, Context& context) { MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>( uninitialized, bond.symmetry(), Domain{bond, auxiliary}, Codomain{bond}, std::move(keys), context); }
auto uni20::tensor_network::make_identity_mpo_environment ( BlockSpace const &  bond,
LocalSpace const &  auxiliary,
std::size_t  auxiliary_index,
Context &  context 
) -> MpoEnvironment<Value, BlockSpace, LocalSpace, BlockSpace, Storage>

Construct an identity MPO environment in an explicit leaf allocation context.

Template Parameters
ContextLeaf allocation context accepted by the selected storage.
Parameters
bondExact bra and ket bond space.
auxiliaryMPO boundary auxiliary space.
auxiliary_indexIdentity-charge auxiliary state to activate.
contextAllocation context retained by the result storage.
Returns
Identity environment allocated through context.
Exceptions
std::invalid_argumentIf symmetries differ, the index is invalid, or the selected auxiliary state is not the identity charge.

◆ make_two_site_effective_hamiltonian()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
requires detail::CompatibleMpoEffectiveScalars<Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment>
auto uni20::tensor_network::make_two_site_effective_hamiltonian ( Center const &  prototype,
LeftEnvironment const &  left_environment,
FirstMpo const &  first_mpo,
SecondMpo const &  second_mpo,
RightEnvironment const &  right_environment 
)

Compile a two-site effective Hamiltonian borrowing environment payloads.

The returned operation retains identity mapped views by value, so keys, boundaries, and block descriptors are not borrowed from temporary view objects. Environment payload owners must outlive the returned operation. MPO coefficients are snapshotted into the sparse f plan and the MPO payloads are not retained.

Parameters
prototypeCenter value whose exact boundary and stored keys define the vector space.
left_environmentLeft environment payload owner.
first_mpoLeft MPO site compiled into the sparse coefficient plan.
second_mpoRight MPO site compiled into the sparse coefficient plan.
right_environmentRight environment payload owner.
Returns
Compiled operation containing zero-copy environment views and an owned f plan.

◆ materialize_two_site_mps_split()

template<SparseBlockStorage OutputStorage = SeparateSparseBlockStorage<>, class Decomposition >
requires detail::MpsSiteStorage<OutputStorage, typename Decomposition::scalar_type>
auto uni20::tensor_network::materialize_two_site_mps_split ( Decomposition const &  decomposition,
BlockSvdSelection< typename Decomposition::real_type > const &  selection,
MpsSweepDirection  direction,
BlockSvdMaterializationOptions  options = {} 
)

Materialize selected SVD states as a directional pair of owning MPS sites.

Uni20 reconstructs the repartitioned center as right_singular_vectors_adjoint * singular_values * left_singular_vectors. A left-to-right split absorbs the singular values into the second site; a right-to-left split absorbs them into the first site.

Template Parameters
OutputStorageSparse local storage for both returned sites.
Parameters
decompositionReusable decomposition from decompose_two_site_center().
selectionNonempty selected singular-state set.
directionSide that receives the singular values.
optionsSelected bond label and materialization options.
Returns
Two canonical owning MPS sites, the diagonal selected spectrum, and exact truncation statistics.
Exceptions
std::invalid_argumentIf the selection is empty or the sweep direction is invalid.

◆ MpoEnvironmentCache()

template<class MpsChain , class MpoChain >
uni20::tensor_network::MpoEnvironmentCache ( MpsChain const &  ,
MpoChain const &  ,
std::size_t  ,
std::size_t   
) -> MpoEnvironmentCache< MpsChain, MpoChain >

Deduce chain owner types while retaining the default environment storage.

◆ optimize_two_site_dmrg_bond() [1/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto uni20::tensor_network::optimize_two_site_dmrg_bond ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
std::size_t  first_site,
MpsSweepDirection  direction,
TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &  options,
Measurements &  measurements,
CenterStorage  center_storage = {} 
)

Optimize and replace one adjacent MPS pair with a measured ground-state DMRG step.

The operation forms the current two-site center, obtains the two reusable environments outside the pair, solves the fixed sparse effective Hamiltonian, performs staged block-SVD truncation, and installs the directional split. The existing internal-bond label is preserved. After replacement, only the completed-side environment needed by the next step is rebuilt.

Exceptions
std::invalid_argumentIf the pair, cache, direction, or options are invalid.
Template Parameters
MpsChainConcrete finite MPS owner type.
MpoChainConcrete finite MPO owner type.
EnvironmentStorageSparse local storage used by the cache.
MeasurementsCompile-time-selected performance measurement policy.
CenterStorageLocal ordinary-block storage used by the transient center and Krylov vectors.
Parameters
mpsMutable MPS whose selected pair is replaced by the fixed-work local update.
mpoImmutable MPO defining the effective Hamiltonian.
cacheEnvironment cache attached to exactly mps and mpo.
first_siteIndex of the left site in the active pair.
directionDirection in which the canonical center moves.
optionsFixed-work local solve and global SVD-truncation policies.
measurementsExplicit performance measurement policy or collector.
center_storageStateless policy tag selecting center allocation and block execution.
Returns
Local energy, residual and work diagnostics, and selected bond data.

◆ optimize_two_site_dmrg_bond() [2/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto uni20::tensor_network::optimize_two_site_dmrg_bond ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
std::size_t  first_site,
MpsSweepDirection  direction,
TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &  options = {},
CenterStorage  center_storage = {} 
)

Optimize and replace one adjacent MPS pair without performance measurements.

◆ prepare_rabc_contract() [1/2]

template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
auto uni20::tensor_network::prepare_rabc_contract ( linalg::backend_list< RightFirstRabcBackend< IntermediateStorage, ContractionSelector > >  selector,
Output const &  output,
Plan  plan,
A const &  a,
B const &  b,
C const &  c 
)

Prepare the single right-first backend selected for fixed R/A/B/C operands.

Preparation validates the fixed block structures, derives the backend-specific schedule, and allocates reusable intermediate storage. This overload intentionally accepts the currently supported one-entry prepared selector; future backend lists must define how preparation chooses and retains one accepted backend.

Parameters
selectorSelected R/A/B/C backend and nested dense selector.
outputPrototype fixed output structure.
planExecution-neutral coefficient plan transferred into the executor.
aPrototype left block family.
bPrototype center block family.
cPrototype right block family.
Precondition
The plan's coordinate keys were constructed for the symmetry, domain, and codomain semantics of these four operand families.
Returns
Prepared executor owning the plan, schedule, and workspace.

◆ prepare_rabc_contract() [2/2]

template<detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C>
auto uni20::tensor_network::prepare_rabc_contract ( Output const &  output,
Plan  plan,
A const &  a,
B const &  b,
C const &  c 
)

Select and prepare the R/A/B/C backend for one fixed block structure.

Parameters
outputPrototype fixed output structure and storage policy.
planExecution-neutral coefficient plan transferred into the executor.
aPrototype left block family.
bPrototype center block family.
cPrototype right block family.
Precondition
The plan's coordinate keys were constructed for the symmetry, domain, and codomain semantics of these four operand families.
Returns
Prepared executor selected from the output storage policy.

◆ rabc_contract() [1/2]

template<linalg::KernelBackendSelector BackendSelector, MutableBlockTensorView Output, RabcPlan Plan, BlockTensorView A, BlockTensorView B, BlockTensorView C>
void uni20::tensor_network::rabc_contract ( BackendSelector &&  selector,
Output &  output,
Plan const &  plan,
A const &  a,
B const &  b,
C const &  c 
)

Execute a fixed-output sparse R/A/B/C contraction with an explicit backend selector.

Computes R_r = sum(f(r,a,b,c) A_a B_b transpose(C_c)). The sparse plan contains only mathematical coefficients and block keys. The selected backend resolves keys to storage bindings and chooses contraction order, intermediate reuse, placement, and communication. Stored output blocks with no contributing term are overwritten with zero.

Precondition
Output numerical storage does not overlap any input family.
The plan's coordinate keys were constructed for the symmetry, domain, and codomain semantics of the supplied operand families.
Template Parameters
BackendSelectorExplicit R/A/B/C backend selector.
Parameters
selectorOrdered backend selector.
outputExisting fixed-structure R block family.
planImmutable sparse coefficient tensor f.
aLeft environment block family.
bInput center block family.
cRight environment block family, stored before transposition.

◆ rabc_contract() [2/2]

template<MutableBlockTensorView Output, RabcPlan Plan, BlockTensorView A, BlockTensorView B, BlockTensorView C>
void uni20::tensor_network::rabc_contract ( Output &  output,
Plan const &  plan,
A const &  a,
B const &  b,
C const &  c 
)

Execute a sparse R/A/B/C contraction using the output storage policy.

Backend selection occurs while output storage and execution policy remain available. Input placement remains visible to the selected backend through the fixed block-tensor views.

Precondition
The plan's coordinate keys were constructed for the symmetry, domain, and codomain semantics of the supplied operand families.

◆ replace_two_site_from_svd()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage SiteStorage, class Decomposition >
requires std::same_as<Bond, BlockSpace> && detail::MpsSiteStorage<SiteStorage, Scalar>
auto uni20::tensor_network::replace_two_site_from_svd ( FiniteMps< Scalar, Bond, Physical, SiteStorage > &  mps,
std::size_t  first_index,
Decomposition const &  decomposition,
BlockSvdSelection< typename Decomposition::real_type > const &  selection,
MpsSweepDirection  direction,
BlockSvdMaterializationOptions  options = {} 
)

Materialize and install a selected two-site split in a finite MPS.

Both replacement sites are constructed before FiniteMps::replace_pair() validates and changes the chain. The returned diagonal tensor records the selected Schmidt spectrum even though its values have been absorbed into one installed site.

Parameters
mpsFinite MPS receiving the replacement pair.
first_indexIndex of the left site in the pair.
decompositionReusable two-site decomposition.
selectionNonempty selected singular-state set.
directionSweep direction controlling singular-value absorption.
optionsSelected internal-bond label.
Returns
Installed bond spectrum and truncation statistics.

◆ run_two_site_dmrg() [1/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto uni20::tensor_network::run_two_site_dmrg ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
TwoSiteDmrgRunOptions< make_real_t< typename MpsChain::value_type > > const &  options,
Measurements &  measurements,
CenterStorage  center_storage = {} 
)

Run measured alternating directional sweeps until terminal-energy convergence.

The terminal local Ritz value is treated as the installed global state energy only when the terminal split has zero discarded weight. Convergence compares two consecutive such terminal energies. An invalid terminal energy clears the comparison state, so provisional local values never stop the run. Per-bond installed spectra are summarized and released after each traversal.

Exceptions
std::invalid_argumentIf the chain, cache, or options are invalid.
Template Parameters
MpsChainConcrete finite MPS owner type.
MpoChainConcrete finite MPO owner type.
EnvironmentStorageSparse local storage used by the cache.
MeasurementsCompile-time-selected performance measurement policy.
CenterStorageLocal ordinary-block storage used by the transient center and Krylov vectors.
Parameters
mpsMutable finite MPS, initially canonical for the first direction.
mpoImmutable finite MPO.
cacheEnvironment cache attached to both chain objects.
optionsRun, local-solve, and truncation policies.
measurementsExplicit performance measurement policy or collector.
center_storageStateless policy tag selecting center allocation and block execution.
Returns
Ordered sweep summaries and final convergence state.

◆ run_two_site_dmrg() [2/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto uni20::tensor_network::run_two_site_dmrg ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
TwoSiteDmrgRunOptions< make_real_t< typename MpsChain::value_type > > const &  options = {},
CenterStorage  center_storage = {} 
)

Run alternating directional sweeps without performance measurements.

◆ sweep_two_site_dmrg() [1/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, class Measurements , BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type> && performance::DurationMeasurementPolicy<Measurements, TwoSiteDmrgPerformanceEvent>
auto uni20::tensor_network::sweep_two_site_dmrg ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
MpsSweepDirection  direction,
TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &  options,
Measurements &  measurements,
CenterStorage  center_storage = {} 
)

Traverse every adjacent bond once in one measured two-site DMRG direction.

A left-to-right sweep visits 0 ... L-2; a right-to-left sweep visits L-2 ... 0. Each step leaves the environment on its completed side ready for the next pair.

Exceptions
std::invalid_argumentIf the chain has fewer than two sites or the direction is invalid.
Template Parameters
MpsChainConcrete finite MPS owner type.
MpoChainConcrete finite MPO owner type.
EnvironmentStorageSparse local storage used by the cache.
MeasurementsCompile-time-selected performance measurement policy.
CenterStorageLocal ordinary-block storage used by the transient center and Krylov vectors.
Parameters
mpsMutable finite MPS.
mpoImmutable finite MPO.
cacheEnvironment cache attached to both chain objects.
directionTraversal and singular-value absorption direction.
optionsShared local-solve and truncation policies for the sweep.
measurementsExplicit performance measurement policy or collector.
center_storageStateless policy tag selecting center allocation and block execution.
Returns
One result per bond in visitation order.

◆ sweep_two_site_dmrg() [2/2]

template<class MpsChain , class MpoChain , SparseBlockStorage EnvironmentStorage, BlockTensorStorage CenterStorage = typename MpsChain::storage_policy>
requires detail::TwoSiteCenterStorageFor<CenterStorage, typename MpsChain::value_type>
auto uni20::tensor_network::sweep_two_site_dmrg ( MpsChain &  mps,
MpoChain const &  mpo,
MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage > &  cache,
MpsSweepDirection  direction,
TwoSiteDmrgOptions< make_real_t< typename MpsChain::value_type > > const &  options = {},
CenterStorage  center_storage = {} 
)

Traverse every adjacent bond once without performance measurements.

◆ try_kernel()

template<class IntermediateStorage , class ContractionSelector , detail::WritableRabcTensor Output, RabcPlan Plan, detail::ReadableRabcTensor A, detail::ReadableRabcTensor B, detail::ReadableRabcTensor C>
requires detail::CompatibleRabcOperands<Output, Plan, A, B, C> && (detail::right_first_types_compatible<IntermediateStorage, ContractionSelector, Output, typename std::remove_cvref_t<Plan>::scalar_type, A, B, C>())
auto uni20::tensor_network::try_kernel ( RightFirstRabcBackend< IntermediateStorage, ContractionSelector > const &  backend,
rabc_contract_op const &  ,
Output &  output,
Plan const &  plan,
A const &  a,
B const &  b,
C const &  c 
) -> linalg::KernelAttempt

Execute a storage-domain right-first R/A/B/C contraction.

◆ two_site_dmrg_performance_event_name()

constexpr auto uni20::tensor_network::two_site_dmrg_performance_event_name ( TwoSiteDmrgPerformanceEvent  event) -> std::string_view
constexprnoexcept

Return the stable display name of one DMRG performance event.

Precondition
event is not TwoSiteDmrgPerformanceEvent::count.
Parameters
eventEvent identifier to name.
Returns
Static event name suitable for reports and table labels.

◆ TwoSiteEffectiveHamiltonian()

template<class Center , class LeftEnvironment , class FirstMpo , class SecondMpo , class RightEnvironment >
uni20::tensor_network::TwoSiteEffectiveHamiltonian ( Center const &  ,
LeftEnvironment  ,
FirstMpo  ,
SecondMpo  ,
RightEnvironment   
) -> TwoSiteEffectiveHamiltonian< std::remove_cvref_t< Center >, std::remove_cvref_t< LeftEnvironment >, std::remove_cvref_t< FirstMpo >, std::remove_cvref_t< SecondMpo >, std::remove_cvref_t< RightEnvironment > >

Variable Documentation

◆ is_rabc_contraction_plan

template<class T >
constexpr bool uni20::tensor_network::is_rabc_contraction_plan = false
inlineconstexpr

◆ is_rabc_contraction_plan< RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey > >

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
constexpr bool uni20::tensor_network::is_rabc_contraction_plan< RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey > > = true
inlineconstexpr