HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
SparseHamiltonian< Ham > Class Template Reference

#include <hamsparse.h>

+ Inheritance diagram for SparseHamiltonian< Ham >:
+ Collaboration diagram for SparseHamiltonian< Ham >:

Public Member Functions

 SparseHamiltonian (int L, int Nu, int Nd, double J, double U)
 
virtual ~SparseHamiltonian ()
 
void BuildHam ()
 
void BuildSparseHam ()
 
void PrintSparse () const
 
void PrintRawELL () const
 
virtual void mvprod (double *, double *, double) const
 
double * Umatrix () const
 

Protected Attributes

double * Up_data
 The array to hold the data (ELL format) for the up hamiltonian. More...
 
double * Down_data
 The array to hold the data (ELL format) for the down hamiltonian. More...
 
unsigned int * Up_ind
 The array to hold the indices for the up hamiltonian. More...
 
unsigned int * Down_ind
 The array to hold the indices for the down hamiltonian. More...
 
int size_Up
 Maximum number of non zero elements in a row for the up hamiltonian. More...
 
int size_Down
 Maximum number of non zero elements in a row for the down hamiltonian. More...
 

Detailed Description

template<class Ham>
class SparseHamiltonian< Ham >

Store the Hamiltonian for 1D Hubbard in the (sparse) ELL format

Author
Ward Poelmans wpoel.nosp@m.y86@.nosp@m.gmail.nosp@m..com

Definition at line 27 of file hamsparse.h.

Constructor & Destructor Documentation

template<class Ham >
SparseHamiltonian< Ham >::SparseHamiltonian ( int  L,
int  Nu,
int  Nd,
double  J,
double  U 
)

Constructor of the SparseHamiltonian class

Parameters
LNumber of lattice sites
NuNumber of Up Electrons
NdNumber of Down Electrons
JThe hopping strengh
UThe onsite interaction strength

Definition at line 35 of file hamsparse.cpp.

template<class Ham >
SparseHamiltonian< Ham >::~SparseHamiltonian ( )
virtual

Destructor of the SparseHamiltonian class

Definition at line 52 of file hamsparse.cpp.

Member Function Documentation

template<class Ham >
void SparseHamiltonian< Ham >::BuildHam ( )

Definition at line 68 of file hamsparse.cpp.

template<class Ham >
void SparseHamiltonian< Ham >::BuildSparseHam ( )

Builds and fills the sparse hamiltonian

Definition at line 77 of file hamsparse.cpp.

template<class Ham >
void SparseHamiltonian< Ham >::mvprod ( double *  x,
double *  y,
double  alpha 
) const
virtual

Matrix vector product with (sparse) hamiltonian: y = ham*x + alpha*y

Parameters
xthe input vector
ythe output vector
alphathe scaling value

Definition at line 259 of file hamsparse.cpp.

+ Here is the call graph for this function:

template<class Ham >
void SparseHamiltonian< Ham >::PrintRawELL ( ) const

Prints the Raw ELL array's.

Definition at line 206 of file hamsparse.cpp.

template<class Ham >
void SparseHamiltonian< Ham >::PrintSparse ( ) const

Prints the Sparse Hamiltonian

Definition at line 166 of file hamsparse.cpp.

template<class Ham >
double * SparseHamiltonian< Ham >::Umatrix ( ) const

Builds the interaction diagonal

Returns
pointer to interaction vector. You have to free this yourself

Definition at line 290 of file hamsparse.cpp.

Member Data Documentation

template<class Ham >
double* SparseHamiltonian< Ham >::Down_data
protected

The array to hold the data (ELL format) for the down hamiltonian.

Definition at line 50 of file hamsparse.h.

template<class Ham >
unsigned int* SparseHamiltonian< Ham >::Down_ind
protected

The array to hold the indices for the down hamiltonian.

Definition at line 55 of file hamsparse.h.

template<class Ham >
int SparseHamiltonian< Ham >::size_Down
protected

Maximum number of non zero elements in a row for the down hamiltonian.

Definition at line 60 of file hamsparse.h.

template<class Ham >
int SparseHamiltonian< Ham >::size_Up
protected

Maximum number of non zero elements in a row for the up hamiltonian.

Definition at line 58 of file hamsparse.h.

template<class Ham >
double* SparseHamiltonian< Ham >::Up_data
protected

The array to hold the data (ELL format) for the up hamiltonian.

Definition at line 48 of file hamsparse.h.

template<class Ham >
unsigned int* SparseHamiltonian< Ham >::Up_ind
protected

The array to hold the indices for the up hamiltonian.

Definition at line 53 of file hamsparse.h.


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