pomerol  2.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

Monomial quantum operator. More...

#include <MonomialOperator.hpp>

Inheritance diagram for Pomerol::MonomialOperator:
Inheritance graph
[legend]
Collaboration diagram for Pomerol::MonomialOperator:
Collaboration graph
[legend]

Public Types

using BlocksBimap = boost::bimaps::bimap< boost::bimaps::set_of< BlockNumber >, boost::bimaps::set_of< BlockNumber > >
 A bi-map container for connections between invariant subspaces established by a monomial operator. More...
 
using BlockMapping = BlocksBimap::value_type
 A single subspace-to-subspace connection established by a monomial operator. More...
 
- Public Types inherited from Pomerol::ComputableObject
enum  StatusEnum { Constructed, Prepared, Computed }
 Computation status of the object. More...
 

Public Member Functions

template<typename ScalarType , typename... IndexTypes>
 MonomialOperator (libcommute::expression< ScalarType, IndexTypes... > const &MO, HilbertSpace< IndexTypes... > const &HS, StatesClassification const &S, Hamiltonian const &H)
 
bool isComplex () const
 Is the monomial operator a complex-valued matrix? More...
 
MonomialOperatorPartgetPartFromLeftIndex (BlockNumber LeftIndex)
 
MonomialOperatorPart const & getPartFromLeftIndex (BlockNumber LeftIndex) const
 
MonomialOperatorPartgetPartFromRightIndex (BlockNumber RightIndex)
 
MonomialOperatorPart const & getPartFromRightIndex (BlockNumber RightIndex) const
 
BlockNumber getLeftIndex (BlockNumber RightIndex) const
 
BlockNumber getRightIndex (BlockNumber LeftIndex) const
 
BlocksBimap const & getBlockMapping () const
 
template<typename... IndexTypes>
void prepare (HilbertSpace< IndexTypes... > const &HS)
 
void compute (MPI_Comm const &comm=MPI_COMM_WORLD)
 
- Public Member Functions inherited from Pomerol::ComputableObject
 ComputableObject ()=default
 
StatusEnum getStatus () const
 Return the current computation status. More...
 
void setStatus (StatusEnum Status_in)
 

Protected Member Functions

template<bool Complex>
LOperatorTypeRC< Complex > const & getMOp () const
 

Protected Attributes

bool MOpComplex
 Whether the MOp object is complex-valued. More...
 
std::shared_ptr< void > MOp
 A type-erased real/complex-valued libcommute::loperator object. More...
 
bool Complex
 Whether the stored parts are complex-valued. More...
 
StatesClassification const & S
 Information about invariant subspaces of the Hamiltonian. More...
 
Hamiltonian const & H
 The Hamiltonian. More...
 
std::unordered_map< std::size_t, BlockNumbermapPartsFromRight
 A map between positions of parts in the parts list and the respective right subspace indices. More...
 
std::unordered_map< std::size_t, BlockNumbermapPartsFromLeft
 A map between positions of parts in the parts list and the respective left subspace indices. More...
 
BlocksBimap LeftRightBlocks
 Left-to-right connections between invariant subspaces established by this monomial operator. More...
 
std::vector< MonomialOperatorPartparts
 List of parts (matrix blocks). More...
 
- Protected Attributes inherited from Pomerol::ComputableObject
StatusEnum Status = Constructed
 Current computation status. More...
 

Friends

class FieldOperatorContainer
 

Detailed Description

Monomial quantum operator.

This class stores an operator \(\hat M\), which is a monomial, i.e. a product of fermionic and/or bosonic creation/annihilation operators. The operator is stored as a list of matrix blocks (MonomialOperatorPart), each connecting a pair of invariant subspaces of the Hamiltonian. For a given right invariant subspace, there exists at most one part connecting it to a left subspace (and the other way around).

Definition at line 57 of file MonomialOperator.hpp.

Member Typedef Documentation

◆ BlockMapping

using Pomerol::MonomialOperator::BlockMapping = BlocksBimap::value_type

A single subspace-to-subspace connection established by a monomial operator.

Definition at line 62 of file MonomialOperator.hpp.

◆ BlocksBimap

using Pomerol::MonomialOperator::BlocksBimap = boost::bimaps::bimap<boost::bimaps::set_of<BlockNumber>, boost::bimaps::set_of<BlockNumber> >

A bi-map container for connections between invariant subspaces established by a monomial operator.

Definition at line 60 of file MonomialOperator.hpp.

Constructor & Destructor Documentation

◆ MonomialOperator()

template<typename ScalarType , typename... IndexTypes>
Pomerol::MonomialOperator::MonomialOperator ( libcommute::expression< ScalarType, IndexTypes... > const &  MO,
HilbertSpace< IndexTypes... > const &  HS,
StatesClassification const &  S,
Hamiltonian const &  H 
)
inline

Constructor.

Template Parameters
ScalarTypeScalar type (either double or std::complex<double>) of the expression MO.
IndexTypesTypes of indices carried by operators in the expression MO.
Parameters
[in]MOExpression of the monomial operator \(\hat M\).
[in]HSHilbert space.
[in]SInformation about invariant subspaces of the Hamiltonian.
[in]HThe Hamiltonian.
Precondition
MO is a monomial operator.

Definition at line 109 of file MonomialOperator.hpp.

Member Function Documentation

◆ compute()

void Pomerol::MonomialOperator::compute ( MPI_Comm const &  comm = MPI_COMM_WORLD)

Compute matrix elements of all parts in parallel.

Parameters
[in]commMPI communicator used to parallelize the computation.
Precondition
prepare() has been called.

◆ getBlockMapping()

BlocksBimap const& Pomerol::MonomialOperator::getBlockMapping ( ) const

Return a constant reference to the left-to-right connection map.

Precondition
prepare() has been called.

◆ getLeftIndex()

BlockNumber Pomerol::MonomialOperator::getLeftIndex ( BlockNumber  RightIndex) const

For a given right invariant subspace, return the corresponding left invariant subspace.

Parameters
[in]RightIndexIndex of the right subspace.
Returns
Index of the left subspace.
Precondition
prepare() has been called.

◆ getMOp()

template<bool Complex>
LOperatorTypeRC<Complex> const& Pomerol::MonomialOperator::getMOp ( ) const
inlineprotected

Return a constant reference to the stored libcommute::loperator object.

Template Parameters
ComplexRequest a reference to the complex-valued linear operator.
Precondition
The compile-time value of Complex must agree with the result of isComplex().

Definition at line 75 of file MonomialOperator.hpp.

◆ getPartFromLeftIndex() [1/2]

MonomialOperatorPart& Pomerol::MonomialOperator::getPartFromLeftIndex ( BlockNumber  LeftIndex)

Return a reference to the part by a given left invariant subspace.

Parameters
[in]LeftIndexIndex of the left invariant subspace
Precondition
prepare() has been called.

◆ getPartFromLeftIndex() [2/2]

MonomialOperatorPart const& Pomerol::MonomialOperator::getPartFromLeftIndex ( BlockNumber  LeftIndex) const

Return a constant reference to the part by a given left invariant subspace.

Parameters
[in]LeftIndexIndex of the left invariant subspace
Precondition
prepare() has been called.

◆ getPartFromRightIndex() [1/2]

MonomialOperatorPart& Pomerol::MonomialOperator::getPartFromRightIndex ( BlockNumber  RightIndex)

Return a reference to the part by a given right invariant subspace.

Parameters
[in]RightIndexIndex of the right invariant subspace
Precondition
prepare() has been called.

◆ getPartFromRightIndex() [2/2]

MonomialOperatorPart const& Pomerol::MonomialOperator::getPartFromRightIndex ( BlockNumber  RightIndex) const

Return a constant reference to the part by a given right invariant subspace.

Parameters
[in]RightIndexIndex of the right invariant subspace
Precondition
prepare() has been called.

◆ getRightIndex()

BlockNumber Pomerol::MonomialOperator::getRightIndex ( BlockNumber  LeftIndex) const

For a given left invariant subspace, return the corresponding right invariant subspace.

Parameters
[in]LeftIndexIndex of the left subspace.
Returns
Index of the right subspace.
Precondition
prepare() has been called.

◆ isComplex()

bool Pomerol::MonomialOperator::isComplex ( ) const
inline

Is the monomial operator a complex-valued matrix?

Definition at line 123 of file MonomialOperator.hpp.

◆ prepare()

template<typename... IndexTypes>
void Pomerol::MonomialOperator::prepare ( HilbertSpace< IndexTypes... > const &  HS)
inline

Allocate memory for all parts.

Template Parameters
IndexTypesTypes of indices carried by operators acting in the Hilbert space HS.
Parameters
[in]HSThe Hilbert space.

Definition at line 160 of file MonomialOperator.hpp.

Friends And Related Function Documentation

◆ FieldOperatorContainer

friend class FieldOperatorContainer
friend

Definition at line 65 of file MonomialOperator.hpp.

Field Documentation

◆ Complex

bool Pomerol::MonomialOperator::Complex
protected

Whether the stored parts are complex-valued.

Definition at line 81 of file MonomialOperator.hpp.

◆ H

Hamiltonian const& Pomerol::MonomialOperator::H
protected

The Hamiltonian.

Definition at line 86 of file MonomialOperator.hpp.

◆ LeftRightBlocks

BlocksBimap Pomerol::MonomialOperator::LeftRightBlocks
protected

Left-to-right connections between invariant subspaces established by this monomial operator.

Definition at line 94 of file MonomialOperator.hpp.

◆ mapPartsFromLeft

std::unordered_map<std::size_t, BlockNumber> Pomerol::MonomialOperator::mapPartsFromLeft
protected

A map between positions of parts in the parts list and the respective left subspace indices.

Definition at line 91 of file MonomialOperator.hpp.

◆ mapPartsFromRight

std::unordered_map<std::size_t, BlockNumber> Pomerol::MonomialOperator::mapPartsFromRight
protected

A map between positions of parts in the parts list and the respective right subspace indices.

Definition at line 89 of file MonomialOperator.hpp.

◆ MOp

std::shared_ptr<void> Pomerol::MonomialOperator::MOp
protected

A type-erased real/complex-valued libcommute::loperator object.

Definition at line 70 of file MonomialOperator.hpp.

◆ MOpComplex

bool Pomerol::MonomialOperator::MOpComplex
protected

Whether the MOp object is complex-valued.

Definition at line 68 of file MonomialOperator.hpp.

◆ parts

std::vector<MonomialOperatorPart> Pomerol::MonomialOperator::parts
protected

List of parts (matrix blocks).

Definition at line 97 of file MonomialOperator.hpp.

◆ S

StatesClassification const& Pomerol::MonomialOperator::S
protected

Information about invariant subspaces of the Hamiltonian.

Definition at line 84 of file MonomialOperator.hpp.


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