StatMech
Loading...
Searching...
No Matches
ManyBodyOperatorSpace< ScalarType > Class Template Reference

#include <OperatorSpace.hpp>

Inheritance diagram for ManyBodyOperatorSpace< ScalarType >:
Inheritance graph
Collaboration diagram for ManyBodyOperatorSpace< ScalarType >:
Collaboration graph

Public Types

using Scalar = ScalarType
 
using Base = ManyBodyOperatorSpaceBase< ManyBodyOperatorSpace< ScalarType > >
 
using BaseSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace< ScalarType > >::BaseSpace
 
using LocalSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace< ScalarType > >::LocalSpace
 
- Public Types inherited from ManyBodyOperatorSpaceBase< ManyBodyOperatorSpace< ScalarType > >
using BaseSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace< ScalarType > >::BaseSpace
 
using LocalSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace< ScalarType > >::LocalSpace
 
- Public Types inherited from OperatorSpaceBase< Derived >
typedef Eigen::NumTraits< ScalarType >::Real Real
 

Public Member Functions

__host__ __device__ ManyBodyOperatorSpace (BaseSpace const &baseSpace)
 Construct a ManyBodyOperatorSpace object by copying a BaseSpace object.
 
__host__ __device__ ManyBodyOperatorSpace (BaseSpace &&baseSpace)
 Construct a ManyBodyOperatorSpace object by moving a BaseSpace object.
 
__host__ __device__ ManyBodyOperatorSpace ()=default
 Default constructor.
 
__host__ __device__ ManyBodyOperatorSpace (ManyBodyOperatorSpace const &other)=default
 Copy constructor.
 
__host__ __device__ ManyBodyOperatorSpace (ManyBodyOperatorSpace &&other)=default
 Move constructor.
 
__host__ __device__ ~ManyBodyOperatorSpace ()=default
 Destructor.
 
- Public Member Functions inherited from ManyBodyOperatorSpaceBase< ManyBodyOperatorSpace< ScalarType > >
__host__ __device__ ManyBodyOperatorSpaceBase (BaseSpace const &baseSpace, int systemSize, LocalSpace const &locSpace)
 Construct a ManyBodyOperatorSpaceBase object by copying.
 
__host__ __device__ ManyBodyOperatorSpaceBase (BaseSpace &&baseSpace, int systemSize, LocalSpace &&locSpace)
 Construct a ManyBodyOperatorSpaceBase object by moving.
 
__host__ __device__ ManyBodyOperatorSpaceBase ()=default
 Default constructor.
 
__host__ __device__ ManyBodyOperatorSpaceBase (ManyBodyOperatorSpaceBase const &other)=default
 Copy constructor.
 
__host__ __device__ ManyBodyOperatorSpaceBase (ManyBodyOperatorSpaceBase &&other)=default
 Move constructor.
 
__host__ __device__ ~ManyBodyOperatorSpaceBase ()=default
 Destructor.
 
__host__ __device__ ManyBodyOperatorSpaceBaseoperator= (ManyBodyOperatorSpaceBase const &other)=default
 Copy assignment operator.
 
__host__ __device__ ManyBodyOperatorSpaceBaseoperator= (ManyBodyOperatorSpaceBase &&other)=default
 Move assignment operator.
 
- Public Member Functions inherited from OperatorSpaceBase< Derived >
__host__ __device__ OperatorSpaceBase (BaseSpace const &baseSpace)
 Construct a OperatorSpaceBase object by copying a BaseSpace object.
 
__host__ __device__ OperatorSpaceBase (BaseSpace &&baseSpace)
 Construct a OperatorSpaceBase object by moving a BaseSpace object.
 
__host__ __device__ OperatorSpaceBase ()=default
 Default constructor.
 
__host__ __device__ OperatorSpaceBase (OperatorSpaceBase const &other)=default
 Copy constructor.
 
__host__ __device__ OperatorSpaceBase (OperatorSpaceBase &&other)=default
 Move constructor.
 
__host__ __device__ ~OperatorSpaceBase ()=default
 Destructor.
 
__host__ __device__ OperatorSpaceBaseoperator= (OperatorSpaceBase const &other)=default
 Copy assignment operator.
 
__host__ __device__ OperatorSpaceBaseoperator= (OperatorSpaceBase &&other)=default
 Move assignment operator.
 
__host__ __device__ int dim () const
 
__host__ __device__ BaseSpace const & baseSpace () const
 
__host__ __device__ int baseDim () const
 
template<typename RealType >
__host__ __device__ void action (int &resBasisNum, Complex_t< RealType > &coeff, int opNum, int basisNum) const
 
template<typename RealType , class EigenDerived >
__host__ __device__ void action (int &resBasisNum, Complex_t< RealType > &coeff, int opNum, int basisNum, Eigen::DenseBase< EigenDerived > &config) const
 
__host__ __device__ std::pair< int, Complex_t< Real > > action (int opNum, int basisNum) const
 
__host__ void basisOp (Eigen::SparseMatrix< ScalarType > &res, int opNum) const
 
__host__ Eigen::SparseMatrix< ScalarTypebasisOp (int opNum) const
 
- Public Member Functions inherited from ManyBodySpaceBase< Derived >
__host__ __device__ ManyBodySpaceBase (int systemSize, LocSpace_t const &locSpace)
 Constructor1.
 
__host__ __device__ ManyBodySpaceBase (int systemSize, LocSpace_t &&locSpace)
 Constructor2.
 
template<typename... Args>
__host__ __device__ ManyBodySpaceBase (int systemSize, Args... args)
 Constructor3.
 
__host__ __device__ ManyBodySpaceBase ()=default
 Default constructor.
 
__host__ __device__ ManyBodySpaceBase (ManyBodySpaceBase const &other)
 Copy constructor.
 
__host__ __device__ ManyBodySpaceBase (ManyBodySpaceBase &&other)
 Move constructor.
 
__host__ __device__ ~ManyBodySpaceBase ()=default
 Destructor.
 
__host__ __device__ ManyBodySpaceBaseoperator= (ManyBodySpaceBase const &other)=delete
 Copy assignment operator (deleted)
 
__host__ __device__ Derived & operator= (ManyBodySpaceBase &&other)
 Move assignment operator.
 
__host__ __device__ bool operator== (ManyBodySpaceBase const &other) const
 Equality operator.
 
__host__ __device__ LocSpace_t const & locSpace () const
 
__host__ __device__ int sysSize () const
 
__host__ __device__ int dimLoc () const
 
__host__ __device__ int locState (int state, int pos) const
 
__host__ Derived const & printInString (int basisNum) const
 Print a basis state specified by the input (basisNum) in a string of integers.
 
__host__ __device__ Eigen::RowVectorXi ordinalToConfig (int basisNum) const
 
template<class EigenDerived >
__host__ __device__ int configToOrdinal (Eigen::DenseBase< EigenDerived > &config) const
 
__host__ __device__ int reverse (int state) const
 Reverse the input state.
 
__host__ __device__ Vector_t const & parityPair () const
 
__host__ __device__ int parityPair (int state) const
 
__host__ __device__ void computeParityPair () const
 
__host__ __device__ int translate (int state, int trans) const
 Translate the input state to the left by one.
 
template<class EigenDerived >
__host__ __device__ int translate (int state, int trans, Eigen::DenseBase< EigenDerived > &work) const
 
__host__ __device__ int transEqDim () const
 
__host__ __device__ Vector_t const & transEqClassRep () const
 
__host__ __device__ int transEqClassRep (int id) const
 
__host__ __device__ int transEqClassRep (int id, int trans) const
 
__host__ __device__ Vector_t const & transPeriod () const
 
__host__ __device__ int transPeriod (int id) const
 
__host__ __device__ Vector_t const & stateToTransEqClass () const
 
__host__ __device__ int stateToTransEqClass (int state) const
 
__host__ __device__ int stateToTransPeriod (int state) const
 
__host__ __device__ void computeTransEqClass () const
 
- Public Member Functions inherited from HilbertSpace< Derived >
__host__ __device__ int dim () const
 
__host__ __device__ bool operator== (HilbertSpace const &other) const
 

Private Attributes

BaseConverter< int > m_bConv
 

Operator overloads

friend HilbertSpace< ManyBodyOperatorSpace >
 
__host__ __device__ ManyBodyOperatorSpaceoperator= (ManyBodyOperatorSpace const &other)=default
 Copy assignment operator.
 
__host__ __device__ ManyBodyOperatorSpaceoperator= (ManyBodyOperatorSpace &&other)=default
 Move assignment operator.
 
__host__ __device__ int dim_impl () const
 

Implmentation for functions of OperatorSpaceBase

friend OperatorSpaceBase< ManyBodyOperatorSpace >
 
template<typename RealType >
__host__ __device__ void action_impl (int &resBasisNum, Complex_t< RealType > &coeff, int opNum, int basisNum) const
 

Implementation for functions of ManyBodySpaceBase

friend ManyBodySpaceBase< ManyBodyOperatorSpace >
 
__host__ __device__ int locState_impl (int state, int pos) const
 
__host__ __device__ Eigen::RowVectorXi ordinalToConfig_impl (int basisNum) const
 
template<class EigenDerived >
__host__ __device__ int configToOrdinal_impl (Eigen::DenseBase< EigenDerived > &config) const
 
template<class EigenDerived >
__host__ __device__ int translate_impl (int state, int trans) const
 
template<class EigenDerived >
__host__ __device__ int translate_impl (int state, int trans, Eigen::DenseBase< EigenDerived > &) const
 

Additional Inherited Members

- Protected Types inherited from ManyBodySpaceBase< Derived >
using Vector_t = Eigen::VectorX< int >
 
- Protected Attributes inherited from ManyBodySpaceBase< Derived >
int m_systemSize = 0
 
LocSpace_t m_locSpace
 
int m_transEqDim = -1
 
Vector_t m_transEqClassRep
 
Vector_t m_transPeriod
 
Vector_t m_stateToTransEqClass
 
Vector_t m_parityPair
 

Member Typedef Documentation

◆ Base

◆ BaseSpace

template<typename ScalarType >
using ManyBodyOperatorSpace< ScalarType >::BaseSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace<ScalarType> >::BaseSpace

◆ LocalSpace

template<typename ScalarType >
using ManyBodyOperatorSpace< ScalarType >::LocalSpace = typename HilbertSpaceTraits< ManyBodyOperatorSpace<ScalarType> >::LocalSpace

◆ Scalar

Constructor & Destructor Documentation

◆ ManyBodyOperatorSpace() [1/5]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::ManyBodyOperatorSpace ( BaseSpace const &  baseSpace)
inline

Construct a ManyBodyOperatorSpace object by copying a BaseSpace object.

Parameters
baseSpace
309 m_bConv(baseSpace.dimLoc() * baseSpace.dimLoc(), baseSpace.sysSize()) {
310 debug_constructor_printf(1(Custom Copy));
311 }
ManyBodyOperatorSpaceBase< ManyBodyOperatorSpace< ScalarType > > Base
Definition OperatorSpace.hpp:296
BaseConverter< int > m_bConv
Definition OperatorSpace.hpp:292
__host__ __device__ BaseSpace const & baseSpace() const
Definition OperatorSpace.hpp:79
Definition OperatorSpace.hpp:132

◆ ManyBodyOperatorSpace() [2/5]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::ManyBodyOperatorSpace ( BaseSpace &&  baseSpace)
inline

Construct a ManyBodyOperatorSpace object by moving a BaseSpace object.

Parameters
baseSpace
318 : Base(std::move(baseSpace), baseSpace.sysSize(),
320 m_bConv(baseSpace.dimLoc() * baseSpace.dimLoc(), baseSpace.sysSize()) {
321 debug_constructor_printf(2(Custom Move));
322 }

◆ ManyBodyOperatorSpace() [3/5]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::ManyBodyOperatorSpace ( )
default

Default constructor.

◆ ManyBodyOperatorSpace() [4/5]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::ManyBodyOperatorSpace ( ManyBodyOperatorSpace< ScalarType > const &  other)
default

Copy constructor.

◆ ManyBodyOperatorSpace() [5/5]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::ManyBodyOperatorSpace ( ManyBodyOperatorSpace< ScalarType > &&  other)
default

Move constructor.

◆ ~ManyBodyOperatorSpace()

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace< ScalarType >::~ManyBodyOperatorSpace ( )
default

Destructor.

Member Function Documentation

◆ action_impl()

template<typename ScalarType >
template<typename RealType >
__host__ __device__ void ManyBodyOperatorSpace< ScalarType >::action_impl ( int &  resBasisNum,
Complex_t< RealType > &  coeff,
int  opNum,
int  basisNum 
) const
inlineprivate
371 {
372 // debug_print(__func__ << " at Class:ManyBodyOperatorSpace");
373 resBasisNum = basisNum;
374 coeff = {1, 0};
375 int locOpNum, locBasisNum;
376 int base = 1;
377 for(int pos = 0; pos != this->sysSize(); ++pos, base *= this->baseSpace().dimLoc()) {
378 locOpNum = this->locState(opNum, pos);
379 locBasisNum = this->baseSpace().locState(basisNum, pos);
380 auto [resLocBasisNum, resLocCoeff] = this->locSpace().action(locOpNum, locBasisNum);
381 if(abs(resLocCoeff) == 0) {
382 coeff = 0;
383 resBasisNum = basisNum;
384 break;
385 }
386 coeff *= resLocCoeff;
387 resBasisNum += (resLocBasisNum - locBasisNum) * base;
388 }
389 }
__host__ __device__ LocSpace_t const & locSpace() const
Definition HilbertSpace.hpp:264
__host__ __device__ int locState(int state, int pos) const
Definition HilbertSpace.hpp:267
__host__ __device__ int sysSize() const
Definition HilbertSpace.hpp:265

◆ configToOrdinal_impl()

template<typename ScalarType >
template<class EigenDerived >
__host__ __device__ int ManyBodyOperatorSpace< ScalarType >::configToOrdinal_impl ( Eigen::DenseBase< EigenDerived > &  config) const
inlineprivate
405 {
406 return m_bConv.digitsToNumber(config);
407 }
__host__ __device__ Integer digitsToNumber(Input const &digits, Integer const base, Integer const length) const
Converts an array of integers to the corresponding integer in terms of the positional notation with g...
Definition BaseNnumber.hpp:166

◆ dim_impl()

template<typename ScalarType >
__host__ __device__ int ManyBodyOperatorSpace< ScalarType >::dim_impl ( ) const
inlineprivate
362 {
363 return this->baseSpace().dim() * this->baseSpace().dim();
364 }

◆ locState_impl()

template<typename ScalarType >
__host__ __device__ int ManyBodyOperatorSpace< ScalarType >::locState_impl ( int  state,
int  pos 
) const
inlineprivate
395 {
396 return this->m_bConv.digit(state, pos);
397 }
__host__ __device__ Integer digit(Integer const num, Integer const pos, Integer const base, Integer const length) const
Returns the (pos)-th digit of the input (num) in given base and length.
Definition BaseNnumber.hpp:113

◆ operator=() [1/2]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace & ManyBodyOperatorSpace< ScalarType >::operator= ( ManyBodyOperatorSpace< ScalarType > &&  other)
default

Move assignment operator.

Parameters
other

◆ operator=() [2/2]

template<typename ScalarType >
__host__ __device__ ManyBodyOperatorSpace & ManyBodyOperatorSpace< ScalarType >::operator= ( ManyBodyOperatorSpace< ScalarType > const &  other)
default

Copy assignment operator.

Parameters
other

◆ ordinalToConfig_impl()

template<typename ScalarType >
__host__ __device__ Eigen::RowVectorXi ManyBodyOperatorSpace< ScalarType >::ordinalToConfig_impl ( int  basisNum) const
inlineprivate
399 {
400 Eigen::RowVectorXi res;
401 m_bConv.printInDigits(res, basisNum);
402 return res;
403 }
__host__ __device__ auto printInDigits(Output &output, Integer const num, Integer const base, Integer const length) const -> typename std::enable_if< std::is_integral< Output >::value==false, BaseConverter const & >::type
Expresses an integer (num) in the positional notation with given (base) and (length)
Definition BaseNnumber.hpp:191

◆ translate_impl() [1/2]

template<typename ScalarType >
template<class EigenDerived >
__host__ __device__ int ManyBodyOperatorSpace< ScalarType >::translate_impl ( int  state,
int  trans 
) const
inlineprivate
410 {
411 return this->m_bConv.shiftDigits(state, trans);
412 }
__host__ __device__ Integer shiftDigits(Integer const num, Integer const trans, Integer const base, Integer const length) const
Shifts a number (num) to right by (trans) in terms of the positional notation with given base and len...
Definition BaseNnumber.hpp:139

◆ translate_impl() [2/2]

template<typename ScalarType >
template<class EigenDerived >
__host__ __device__ int ManyBodyOperatorSpace< ScalarType >::translate_impl ( int  state,
int  trans,
Eigen::DenseBase< EigenDerived > &   
) const
inlineprivate
415 {
416 return this->translate_impl(state, trans);
417 }
__host__ __device__ int translate_impl(int state, int trans) const
Definition OperatorSpace.hpp:410

Member Data Documentation

◆ HilbertSpace< ManyBodyOperatorSpace >

◆ m_bConv

template<typename ScalarType >
BaseConverter<int> ManyBodyOperatorSpace< ScalarType >::m_bConv
private

◆ ManyBodySpaceBase< ManyBodyOperatorSpace >

◆ OperatorSpaceBase< ManyBodyOperatorSpace >


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