Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment > Class Template Reference

Matrix-free two-site Hamiltonian compiled from environments and MPO sites. More...

#include <two_site_effective_hamiltonian.hpp>

Public Types

using center_type = std::remove_cvref_t< Center >
 
using codomain_type = block_tensor_codomain_t< center_type >
 
using domain_type = block_tensor_domain_t< center_type >
 
using first_mpo_type = std::remove_cvref_t< FirstMpo >
 
using key_type = block_tensor_key_t< center_type >
 
using left_environment_type = std::remove_cvref_t< LeftEnvironment >
 
using plan_type = RabcContractionPlan< scalar_type, key_type, block_tensor_key_t< left_environment_type >, key_type, block_tensor_key_t< right_environment_type > >
 
using right_environment_type = std::remove_cvref_t< RightEnvironment >
 
using scalar_type = block_tensor_value_t< center_type >
 
using second_mpo_type = std::remove_cvref_t< SecondMpo >
 

Public Member Functions

template<MutableBlockTensorView Output, detail::MpoEffectiveCenter Input>
requires detail::CompatibleTwoSiteCenters<Output, Input> && std::same_as<block_tensor_value_t<Output>, scalar_type> && std::same_as<block_tensor_key_t<Output>, key_type> && std::same_as<block_tensor_domain_t<Output>, domain_type> && std::same_as<block_tensor_codomain_t<Output>, codomain_type>
void operator() (Output &output, Input const &input)
 Overwrite a compatible fixed center with one planned Hamiltonian apply.
 
auto plan () const noexcept -> plan_type const &
 Return the immutable sparse coefficient plan used by the prepared backend.
 
auto prepared_intermediate_count () const noexcept -> std::size_t
 Return the number of retained right-first intermediate blocks.
 
auto term_count () const noexcept -> std::size_t
 Return the number of compiled logical R/A/B/C contributions.
 
 TwoSiteEffectiveHamiltonian (center_type const &prototype, left_environment_type left_environment, first_mpo_type first_mpo, second_mpo_type second_mpo, right_environment_type right_environment)
 Compile one fixed-center sparse effective-Hamiltonian plan.
 

Detailed Description

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
requires detail::CompatibleMpoEffectiveScalars<Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment>
class uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >

Matrix-free two-site Hamiltonian compiled from environments and MPO sites.

Construction joins the stored logical keys of the left environment, two adjacent MPO sites, and right environment into an immutable sparse R/A/B/C term plan for one fixed center structure and snapshots their scalar coefficients into an immutable sparse f(r,a,b,c) tensor. Construction also selects and prepares the current R/A/B/C backend so repeated applications reuse its schedule and intermediate workspace. No whole-center dense projection or high-rank BlockTensor intermediate is formed. The two environments are retained by value. If either is a borrowed view, its ultimate payload owner must outlive this operation object.

Template Parameters
CenterFixed two-site center structure used to compile block ordinals.
LeftEnvironmentLeft (bra bond, auxiliary, ket bond) environment.
FirstMpoLeft MPO site with (left auxiliary, ket, right auxiliary, bra) key order.
SecondMpoRight MPO site with the same key convention.
RightEnvironmentRight (bra bond, auxiliary, ket bond) environment.

Member Typedef Documentation

◆ center_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::center_type = std::remove_cvref_t<Center>

◆ codomain_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::codomain_type = block_tensor_codomain_t<center_type>

◆ domain_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::domain_type = block_tensor_domain_t<center_type>

◆ first_mpo_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::first_mpo_type = std::remove_cvref_t<FirstMpo>

◆ key_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::key_type = block_tensor_key_t<center_type>

◆ left_environment_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::left_environment_type = std::remove_cvref_t<LeftEnvironment>

◆ plan_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::plan_type = RabcContractionPlan<scalar_type, key_type, block_tensor_key_t<left_environment_type>, key_type, block_tensor_key_t<right_environment_type> >

◆ right_environment_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::right_environment_type = std::remove_cvref_t<RightEnvironment>

◆ scalar_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::scalar_type = block_tensor_value_t<center_type>

◆ second_mpo_type

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
using uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::second_mpo_type = std::remove_cvref_t<SecondMpo>

Constructor & Destructor Documentation

◆ TwoSiteEffectiveHamiltonian()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::TwoSiteEffectiveHamiltonian ( center_type const &  prototype,
left_environment_type  left_environment,
first_mpo_type  first_mpo,
second_mpo_type  second_mpo,
right_environment_type  right_environment 
)
inline

Compile one fixed-center sparse effective-Hamiltonian plan.

Parameters
prototypeCenter value whose exact boundary and stored keys define the vector space.
left_environmentLeft environment retained by value.
first_mpoLeft MPO site whose coefficients are compiled into f.
second_mpoRight MPO site whose coefficients are compiled into f.
right_environmentRight environment retained by value.
Exceptions
std::invalid_argumentIf spaces are incompatible or the center stored pattern is not closed under the represented Hamiltonian.

Member Function Documentation

◆ operator()()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
template<MutableBlockTensorView Output, detail::MpoEffectiveCenter Input>
requires detail::CompatibleTwoSiteCenters<Output, Input> && std::same_as<block_tensor_value_t<Output>, scalar_type> && std::same_as<block_tensor_key_t<Output>, key_type> && std::same_as<block_tensor_domain_t<Output>, domain_type> && std::same_as<block_tensor_codomain_t<Output>, codomain_type>
void uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::operator() ( Output &  output,
Input const &  input 
)
inline

Overwrite a compatible fixed center with one planned Hamiltonian apply.

The sparse R/A/B/C kernel backend owns contraction ordering, intermediate reuse, batching, placement, and communication.

Precondition
Distinct input and output views do not overlap numerical storage.

◆ plan()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
auto uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::plan ( ) const -> plan_type const&
inlinenoexcept

Return the immutable sparse coefficient plan used by the prepared backend.

◆ prepared_intermediate_count()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
auto uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::prepared_intermediate_count ( ) const -> std::size_t
inlinenoexcept

Return the number of retained right-first intermediate blocks.

◆ term_count()

template<detail::MpoEffectiveCenter Center, detail::MpoEffectiveEnvironment LeftEnvironment, detail::MpoEffectiveSite FirstMpo, detail::MpoEffectiveSite SecondMpo, detail::MpoEffectiveEnvironment RightEnvironment>
auto uni20::tensor_network::TwoSiteEffectiveHamiltonian< Center, LeftEnvironment, FirstMpo, SecondMpo, RightEnvironment >::term_count ( ) const -> std::size_t
inlinenoexcept

Return the number of compiled logical R/A/B/C contributions.


The documentation for this class was generated from the following file: