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

#include <helpers.h>

Public Member Functions

 BasisList (int L, int Nu, int Nd)
 
virtual ~BasisList ()
 
bool Exists (int K, int S, int Sz) const
 
SubBasisGet (int K, int S, int Sz)
 
void Create (int K, int S, int Sz, MomBasis &orig, int dim)
 
void Print () const
 
void DoProjection (int K, int S, int Sz, MomBasis const &orig)
 
void MakeEmpty ()
 
void Clean (int Sz)
 

Static Public Attributes

static const int EMPTY = -1
 Constant used to keep track of which basis are allocted. More...
 

Private Attributes

int L
 number of sites More...
 
int Nu
 number of up electrons More...
 
int Nd
 number of up electrons More...
 
int totS
 
int Smax
 maximum value of S More...
 
std::vector< int > ind_list
 Array to keep track of SubBasis exist and which ones not. More...
 
std::vector< SubBasislist
 

Detailed Description

Class to keep track of which (sub)Basis are already created and keeps track of new ones.

Definition at line 265 of file helpers.h.

Constructor & Destructor Documentation

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

Create a BasisList to build a SpinBasis with given numbers

Parameters
Lthe chain length
Nuthe number of up spins of the final basis
Ndthe number of down spins of the final basis

Definition at line 799 of file helpers.cpp.

virtual BasisList::~BasisList ( )
inlinevirtual

Definition at line 270 of file helpers.h.

Member Function Documentation

void BasisList::Clean ( int  Sz)

Free the memory of all SubBasis for Sz and higher

Definition at line 936 of file helpers.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BasisList::Create ( int  K,
int  S,
int  Sz,
MomBasis orig,
int  dim 
)

Create a SubBasis with quantum numbers K, S and Sz from momentum basis orig and let it have dimension dim

Parameters
Kthe K quantun number of the new SubBasis
Sthe S quantun number of the new SubBasis
Szthe Sz quantun number of the new SubBasis
origthe original momentum basis from which to build the new SubBasis
dimthe dimension of the SubBasis

Definition at line 856 of file helpers.cpp.

+ Here is the caller graph for this function:

void BasisList::DoProjection ( int  K,
int  S,
int  Sz,
MomBasis const &  orig 
)

Projects the final space out of the rest. We build a matrix where the rows are the basis vectors of all other subspaces. Normally, this would be the columns we you can build a projection matrix P = A A^T but for performance we use the rows (so we can use memcpy). We then do a SVD on this matrix to find the kernel. The vectors that span the null space are the basisvectors we where looking for and we copy them to the destination coeffs matrix with memcpy.

Parameters
Kthe K number of the block where are looking for
Sthe spin number of the block where are looking for
Szthe spin projection number of the block where are looking for
Kthe K number of the block where are looking for
origthe orginal momentum basis of the blocks

Definition at line 888 of file helpers.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BasisList::Exists ( int  K,
int  S,
int  Sz 
) const

Check if a SubBasis with given quantum numbers exists

Parameters
Kthe K quantun number of the SubBasis
Sthe S quantun number of the SubBasis
Szthe Sz quantun number of the SubBasis
Returns
true or false if it exists

Definition at line 822 of file helpers.cpp.

+ Here is the caller graph for this function:

SubBasis & BasisList::Get ( int  K,
int  S,
int  Sz 
)

Getter for a SubBasis with given quantum numbers exists

Parameters
Kthe K quantun number of the SubBasis
Sthe S quantun number of the SubBasis
Szthe Sz quantun number of the SubBasis
Returns
the SubBasis object requested

Definition at line 840 of file helpers.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BasisList::MakeEmpty ( )

Delete everything in this BasisList

Definition at line 952 of file helpers.cpp.

+ Here is the caller graph for this function:

void BasisList::Print ( ) const

Definition at line 862 of file helpers.cpp.

+ Here is the call graph for this function:

Member Data Documentation

const int BasisList::EMPTY = -1
static

Constant used to keep track of which basis are allocted.

Definition at line 287 of file helpers.h.

std::vector<int> BasisList::ind_list
private

Array to keep track of SubBasis exist and which ones not.

Definition at line 303 of file helpers.h.

int BasisList::L
private

number of sites

Definition at line 291 of file helpers.h.

std::vector<SubBasis> BasisList::list
private

Definition at line 305 of file helpers.h.

int BasisList::Nd
private

number of up electrons

Definition at line 295 of file helpers.h.

int BasisList::Nu
private

number of up electrons

Definition at line 293 of file helpers.h.

int BasisList::Smax
private

maximum value of S

Definition at line 300 of file helpers.h.

int BasisList::totS
private

Definition at line 297 of file helpers.h.


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