HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
MomBasis Class Reference

#include <helpers.h>

Public Member Functions

 MomBasis (int L, int Nu, int Nd)
 
virtual ~MomBasis ()
 
myint getUp (int K, int index) const
 
myint getDown (int K, int index) const
 
int findUp (int K, myint ket) const
 
int findDown (int K, myint ket) const
 
int getdim () const
 
int getdimK (int K) const
 
void Print () const
 
void getvec (int K, int i, myint &upket, myint &downket) const
 
int getL () const
 
int getNu () const
 
int getNd () const
 
const std::pair< myint, myint > & operator() (int K, int index) const
 
std::shared_ptr< class KBlockgetBlock (int K) const
 

Private Member Functions

void BuildBase ()
 

Private Attributes

int L
 number of sites More...
 
int Nu
 number of up electrons More...
 
int Nd
 number of up electrons More...
 
int dim
 dimension of the hilbert space More...
 
std::vector< std::shared_ptr
< class KBlock > > 
basisblocks
 

Detailed Description

Stores a full basis in the momentum space. Stores a list of L KBlock classes, each class holding the basis of one K block.

Definition at line 85 of file helpers.h.

Constructor & Destructor Documentation

MomBasis::MomBasis ( int  L,
int  Nu,
int  Nd 
)

Build a momentum basis for specified system

Parameters
Lchain length
Nunumber of spin ups
Ndnumber of spin downs

Definition at line 295 of file helpers.cpp.

+ Here is the call graph for this function:

virtual MomBasis::~MomBasis ( )
inlinevirtual

Definition at line 90 of file helpers.h.

Member Function Documentation

void MomBasis::BuildBase ( )
private

Definition at line 427 of file helpers.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int MomBasis::findDown ( int  K,
myint  ket 
) const

Find the index of a basisvector for spin down

Parameters
Kthe K block index
ketthe basisvector
Returns
the index of ket

Definition at line 357 of file helpers.cpp.

int MomBasis::findUp ( int  K,
myint  ket 
) const

Find the index of a basisvector for spin up

Parameters
Kthe K block index
ketthe basisvector
Returns
the index of ket

Definition at line 340 of file helpers.cpp.

std::shared_ptr< class KBlock > MomBasis::getBlock ( int  K) const

Definition at line 421 of file helpers.cpp.

+ Here is the caller graph for this function:

int MomBasis::getdim ( ) const

Definition at line 368 of file helpers.cpp.

+ Here is the caller graph for this function:

int MomBasis::getdimK ( int  K) const
Parameters
Kthe K block
Returns
the dimension of K block K

Definition at line 377 of file helpers.cpp.

+ Here is the caller graph for this function:

myint MomBasis::getDown ( int  K,
int  index 
) const

Get a spin down basisvector in block K with index=index

Parameters
Kthe K block index
indexthe index within the K block
Returns
the spin down basisvector

Definition at line 327 of file helpers.cpp.

+ Here is the call graph for this function:

int MomBasis::getL ( ) const

Definition at line 383 of file helpers.cpp.

+ Here is the caller graph for this function:

int MomBasis::getNd ( ) const

Definition at line 393 of file helpers.cpp.

+ Here is the caller graph for this function:

int MomBasis::getNu ( ) const

Definition at line 388 of file helpers.cpp.

+ Here is the caller graph for this function:

myint MomBasis::getUp ( int  K,
int  index 
) const

Get a spin up basisvector in block K with index=index

Parameters
Kthe K block index
indexthe index within the K block
Returns
the spin up basisvector

Definition at line 314 of file helpers.cpp.

+ Here is the call graph for this function:

void MomBasis::getvec ( int  K,
int  i,
myint upket,
myint downket 
) const

Definition at line 408 of file helpers.cpp.

const std::pair< myint, myint > & MomBasis::operator() ( int  K,
int  index 
) const

Definition at line 415 of file helpers.cpp.

void MomBasis::Print ( ) const

Definition at line 398 of file helpers.cpp.

Member Data Documentation

std::vector< std::shared_ptr<class KBlock> > MomBasis::basisblocks
private

Definition at line 131 of file helpers.h.

int MomBasis::dim
private

dimension of the hilbert space

Definition at line 129 of file helpers.h.

int MomBasis::L
private

number of sites

Definition at line 122 of file helpers.h.

int MomBasis::Nd
private

number of up electrons

Definition at line 126 of file helpers.h.

int MomBasis::Nu
private

number of up electrons

Definition at line 124 of file helpers.h.


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