HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
|
#include <helpers.h>
Public Member Functions | |
BasisList (int L, int Nu, int Nd) | |
virtual | ~BasisList () |
bool | Exists (int K, int S, int Sz) const |
SubBasis & | Get (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< SubBasis > | list |
Class to keep track of which (sub)Basis are already created and keeps track of new ones.
BasisList::BasisList | ( | int | L, |
int | Nu, | ||
int | Nd | ||
) |
Create a BasisList to build a SpinBasis with given numbers
L | the chain length |
Nu | the number of up spins of the final basis |
Nd | the number of down spins of the final basis |
Definition at line 799 of file helpers.cpp.
void BasisList::Clean | ( | int | Sz | ) |
Free the memory of all SubBasis for Sz and higher
Definition at line 936 of file helpers.cpp.
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
K | the K quantun number of the new SubBasis |
S | the S quantun number of the new SubBasis |
Sz | the Sz quantun number of the new SubBasis |
orig | the original momentum basis from which to build the new SubBasis |
dim | the dimension of the SubBasis |
Definition at line 856 of file helpers.cpp.
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.
K | the K number of the block where are looking for |
S | the spin number of the block where are looking for |
Sz | the spin projection number of the block where are looking for |
K | the K number of the block where are looking for |
orig | the orginal momentum basis of the blocks |
Definition at line 888 of file helpers.cpp.
bool BasisList::Exists | ( | int | K, |
int | S, | ||
int | Sz | ||
) | const |
Check if a SubBasis with given quantum numbers exists
K | the K quantun number of the SubBasis |
S | the S quantun number of the SubBasis |
Sz | the Sz quantun number of the SubBasis |
Definition at line 822 of file helpers.cpp.
SubBasis & BasisList::Get | ( | int | K, |
int | S, | ||
int | Sz | ||
) |
Getter for a SubBasis with given quantum numbers exists
K | the K quantun number of the SubBasis |
S | the S quantun number of the SubBasis |
Sz | the Sz quantun number of the SubBasis |
Definition at line 840 of file helpers.cpp.
void BasisList::MakeEmpty | ( | ) |
Delete everything in this BasisList
Definition at line 952 of file helpers.cpp.
void BasisList::Print | ( | ) | const |
|
static |
|
private |