v2DM-DOCI  1.0
doci2DM::PHM Class Reference

#include <PHM.h>

+ Inheritance diagram for doci2DM::PHM:
+ Collaboration diagram for doci2DM::PHM:

Public Member Functions

 PHM (int, int)
 
 PHM (const PHM &)=default
 
 PHM (PHM &&)=default
 
virtual ~PHM ()=default
 
PHMoperator= (const PHM &)=default
 
PHMoperator= (PHM &&)=default
 
double operator() (int a, int b, int c, int d) const
 
const MatrixgetBlock (int a, int b) const
 
MatrixgetBlock (int a, int b)
 
int gN () const
 
int gL () const
 
void G (const TPM &)
 
Matrix Gimg (const TPM &) const
 
Matrix Gbuild () const
 
void sep_pm (BlockMatrix &, BlockMatrix &)
 
void sqrt (int)
 
void invert ()
 
void L_map (const BlockMatrix &, const BlockMatrix &)
 
void WriteToFile (hid_t &group_id) const
 
void ReadFromFile (hid_t &group_id)
 
void WriteFullToFile (hid_t &group_id) const
 
void setDim (int, int, int)
 
BlockStructureoperator+= (const BlockStructure< BlockType > &)
 
BlockStructureoperator-= (const BlockStructure< BlockType > &)
 
BlockStructuredaxpy (double alpha, const BlockStructure< BlockType > &)
 
BlockStructureoperator*= (double)
 
BlockStructureoperator/= (double)
 
BlockType & operator[] (int block)
 
const BlockType & operator[] (int block) const
 
double & operator() (int block, int i, int j)
 
double operator() (int block, int i, int j) const
 
double & operator() (int block, int index)
 
double operator() (int block, int index) const
 
int gnr () const
 
int gdim (int) const
 
int gdeg (int) const
 
double trace () const
 
double ddot (const BlockStructure< BlockType > &) const
 
void dscal (double alpha)
 
double min () const
 
double max () const
 
void fill_Random ()
 
void fill_Random (int)
 
virtual void L_map (const BlockStructure< BlockType > &, const BlockStructure< BlockType > &)
 
virtual BlockStructure< BlockType > & mprod (const BlockStructure< BlockType > &, const BlockStructure< BlockType > &)
 
void symmetrize ()
 
void sort ()
 
template<>
void sort ()
 
virtual void sep_pm (BlockStructure< BlockType > &, BlockStructure< BlockType > &)
 

Private Member Functions

void constr_lists (int L)
 

Private Attributes

int L
 
int N
 

Static Private Attributes

static std::unique_ptr< helpers::tmatrix< int > > s2ph = nullptr
 table translating single particles indices to two particle indices More...
 
static std::unique_ptr< helpers::tmatrix< int > > ph2s = nullptr
 table translating two particles indices to single particle indices More...
 
static std::unique_ptr< helpers::tmatrix< int > > s2b = nullptr
 table translating single particles indices to the correct 2x2 block More...
 
static std::unique_ptr< helpers::tmatrix< int > > b2s = nullptr
 table translating the block index to the single particle indices More...
 

Friends

std::ostream & operator<< (std::ostream &output, PHM &phm)
 

Detailed Description

Definition at line 38 of file PHM.h.

Constructor & Destructor Documentation

PHM::PHM ( int  L,
int  N 
)
Parameters
Lthe number of levels
Nthe number of particles

Definition at line 40 of file PHM.cpp.

+ Here is the call graph for this function:

doci2DM::PHM::PHM ( const PHM )
default
doci2DM::PHM::PHM ( PHM &&  )
default
virtual doci2DM::PHM::~PHM ( )
virtualdefault

Member Function Documentation

void PHM::constr_lists ( int  L)
private

Definition at line 56 of file PHM.cpp.

+ Here is the caller graph for this function:

template<class BlockType >
BlockStructure< BlockType > & BlockStructure::daxpy ( double  alpha,
const BlockStructure< BlockType > &  blockmat_pl 
)
inherited

add the matrix matrix_pl times the constant alpha to this

Parameters
alphathe constant to multiply the matrix_pl with
blockmat_plthe BlockStructure to be multiplied by alpha and added to this

Definition at line 172 of file BlockStructure.cpp.

template<class BlockType >
double BlockStructure::ddot ( const BlockStructure< BlockType > &  blocks_in) const
inherited
Returns
inproduct of (*this) blocks with blocks_in, defined as Tr (A B)
Parameters
blocks_ininput matrix

Definition at line 293 of file BlockStructure.cpp.

template<class BlockType >
void BlockStructure::dscal ( double  alpha)
inherited

Scale the blocks (*this) with parameter alpha

Parameters
alphascalefactor

Definition at line 320 of file BlockStructure.cpp.

template<class BlockType >
void BlockStructure::fill_Random ( )
inherited

Fill the matrix with random numbers.

Definition at line 331 of file BlockStructure.cpp.

template<class BlockType >
void BlockStructure::fill_Random ( int  seed)
inherited

Fill the matrix with random numbers.

Parameters
seedthe seed to use

Definition at line 342 of file BlockStructure.cpp.

void PHM::G ( const TPM tpm)

Create the G condition from a TPM

Parameters
tpmthe TPM to use

Definition at line 230 of file PHM.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Matrix PHM::Gbuild ( ) const

Build the full G matrix out of *this object

Returns
the full dense G matrix

Definition at line 296 of file PHM.cpp.

template<class BlockType >
int BlockStructure::gdeg ( int  i) const
inherited
Returns
the degeneracy of the block with index i

Definition at line 268 of file BlockStructure.cpp.

+ Here is the caller graph for this function:

template<class BlockType >
int BlockStructure::gdim ( int  i) const
inherited
Returns
the dimension of the Matrix on the block with index i

Definition at line 259 of file BlockStructure.cpp.

+ Here is the caller graph for this function:

const Matrix & PHM::getBlock ( int  a,
int  b 
) const

Get a 2x2 block of the G matrix, corresponding with indices a and b

Parameters
athe first sp index
bthe second sp index
Returns
the 2x2 matrix

Definition at line 203 of file PHM.cpp.

+ Here is the caller graph for this function:

Matrix & PHM::getBlock ( int  a,
int  b 
)

Get a 2x2 block of the G matrix, corresponding with indices a and b

Parameters
athe first sp index
bthe second sp index
Returns
the 2x2 matrix

Definition at line 218 of file PHM.cpp.

Matrix PHM::Gimg ( const TPM tpm) const

Build the G matrix using the full G matrix image

Parameters
tpmthe TPM to use
Returns
the full G matrix

Definition at line 262 of file PHM.cpp.

int PHM::gL ( ) const

Definition at line 191 of file PHM.cpp.

int PHM::gN ( ) const

Definition at line 186 of file PHM.cpp.

template<class BlockType >
int BlockStructure::gnr ( ) const
inherited
Returns
the blocks.size() of blocks

Definition at line 250 of file BlockStructure.cpp.

+ Here is the caller graph for this function:

void PHM::invert ( )
virtual

Invert positive semidefinite symmetric blocks which is stored in (*this), original matrix (*this) is destroyed

Reimplemented from doci2DM::BlockStructure< BlockType >.

Definition at line 366 of file PHM.cpp.

+ Here is the call graph for this function:

void PHM::L_map ( const BlockMatrix map,
const BlockMatrix object 
)

Definition at line 375 of file PHM.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class BlockType >
void BlockStructure::L_map ( const BlockStructure< BlockType > &  map,
const BlockStructure< BlockType > &  object 
)
virtualinherited

Multiply symmetric blocks object left en right with symmetric blocks map to form another symmetric blocks and put it in (*this): this = map*object*map

Parameters
mapBlockStructure that will be multiplied to the left en to the right of matrix object
objectcentral BlockStructure

Definition at line 367 of file BlockStructure.cpp.

template<class BlockType>
double doci2DM::BlockStructure< BlockType >::max ( ) const
inherited
template<class BlockType>
double doci2DM::BlockStructure< BlockType >::min ( ) const
inherited
template<class BlockType >
BlockStructure< BlockType > & BlockStructure::mprod ( const BlockStructure< BlockType > &  A,
const BlockStructure< BlockType > &  B 
)
virtualinherited

BlockStructure product of two general blockmatrices A en B, put result in this

Parameters
Aleft matrix
Bright matrix

Definition at line 380 of file BlockStructure.cpp.

double PHM::operator() ( int  a,
int  b,
int  c,
int  d 
) const

The access operator for the G matrix. It's a bit complicated due to the fact that we don't store the full blown G matrix. We construct each element on the fly

Parameters
athe first sp index
bthe second sp index
cthe thirth sp index
dthe fourth sp index
Returns
the G matrix element

Definition at line 129 of file PHM.cpp.

template<class BlockType>
double& doci2DM::BlockStructure< BlockType >::operator() ( int  block,
int  i,
int  j 
)
inherited
template<class BlockType>
double doci2DM::BlockStructure< BlockType >::operator() ( int  block,
int  i,
int  j 
) const
inherited
template<class BlockType>
double& doci2DM::BlockStructure< BlockType >::operator() ( int  block,
int  index 
)
inherited
template<class BlockType>
double doci2DM::BlockStructure< BlockType >::operator() ( int  block,
int  index 
) const
inherited
template<class BlockType >
BlockStructure< BlockType > & BlockStructure::operator*= ( double  c)
inherited

Definition at line 196 of file BlockStructure.cpp.

template<class BlockType >
BlockStructure< BlockType > & BlockStructure::operator+= ( const BlockStructure< BlockType > &  blockmat_pl)
inherited

overload the += operator for matrices

Parameters
blockmat_plThe matrix you want to add to this

Definition at line 143 of file BlockStructure.cpp.

template<class BlockType >
BlockStructure< BlockType > & BlockStructure::operator-= ( const BlockStructure< BlockType > &  blockmat_pl)
inherited

overload the -= operator for matrices

Parameters
blockmat_plThe matrix you want to deduct from this

Definition at line 157 of file BlockStructure.cpp.

template<class BlockType >
BlockStructure< BlockType > & BlockStructure::operator/= ( double  c)
inherited

/= operator overloaded: divide by a constant

Parameters
cthe number to divide your matrix through

Definition at line 186 of file BlockStructure.cpp.

PHM& doci2DM::PHM::operator= ( const PHM )
default
PHM& doci2DM::PHM::operator= ( PHM &&  )
default
template<class BlockType >
BlockType & BlockStructure::operator[] ( int  block)
inherited

[] overloaded, will return a reference to the block block in the blocks.

Parameters
blockindex of the block to be returned
Returns
A reference to the Matrix object located on blocks[block].

Definition at line 91 of file BlockStructure.cpp.

template<class BlockType >
const BlockType & BlockStructure::operator[] ( int  block) const
inherited

[] overloaded, const version, will return a const reference to the block block in the blocks.

Parameters
blockindex of the block to be returned
Returns
A reference to the Matrix object located on blocks[block].

Definition at line 102 of file BlockStructure.cpp.

void PHM::ReadFromFile ( hid_t &  group_id)

Read a PHM object from a HDF5 group. The PHM object must already exist and have the correct dimensions. It will fill the object called on

Parameters
group_idreference to the HDF5 group to use

Definition at line 499 of file PHM.cpp.

+ Here is the call graph for this function:

void PHM::sep_pm ( BlockMatrix pos,
BlockMatrix neg 
)

Use the 2x2 sep_pm for all the 2x2 blocks instead of the full blown sep_pm

Parameters
posthe positive part of the matrix
negthe negative part of the matrix

Definition at line 343 of file PHM.cpp.

+ Here is the call graph for this function:

template<class BlockType >
void BlockStructure::sep_pm ( BlockStructure< BlockType > &  pos,
BlockStructure< BlockType > &  neg 
)
virtualinherited

Definition at line 410 of file BlockStructure.cpp.

template<class BlockType >
void BlockStructure::setDim ( int  block,
int  dim,
int  degeneracy 
)
inherited

function that allocates the memory of the blocks block with dimension dim sets and the degeneracy of the matrix

Parameters
blockthe index of the block that will be allocated
dimthe dimension of the particular block to be allocated
degeneracythe degeneracy of block "block"

Definition at line 76 of file BlockStructure.cpp.

+ Here is the caller graph for this function:

template<class BlockType>
void doci2DM::BlockStructure< BlockType >::sort ( )
inherited
template<>
void doci2DM::BlockStructure< Vector >::sort ( )
inherited

Definition at line 402 of file BlockStructure.cpp.

void PHM::sqrt ( int  option)
virtual

Pull the sqrt out of this matrix. Optimized for the structure of the 2x2 matrices

Parameters
option1 => positive sqrt, -1 => negative sqrt

Reimplemented from doci2DM::BlockStructure< BlockType >.

Definition at line 357 of file PHM.cpp.

+ Here is the call graph for this function:

template<class BlockType >
void BlockStructure::symmetrize ( )
inherited

Copy upper triangle into lower triangle.

Definition at line 393 of file BlockStructure.cpp.

template<class BlockType >
double BlockStructure::trace ( ) const
inherited
Returns
the trace of the matrix, each block matrix is weighed with its degeneracy.

Definition at line 277 of file BlockStructure.cpp.

+ Here is the caller graph for this function:

void PHM::WriteFullToFile ( hid_t &  group_id) const

Definition at line 435 of file PHM.cpp.

+ Here is the call graph for this function:

void PHM::WriteToFile ( hid_t &  group_id) const

Write a PHM object to a HDF5 group

Parameters
group_idreference to the HDF5 group to use

Definition at line 388 of file PHM.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
doci2DM::PHM phm 
)
friend

Definition at line 320 of file PHM.cpp.

Member Data Documentation

std::unique_ptr< helpers::tmatrix< int > > PHM::b2s = nullptr
staticprivate

table translating the block index to the single particle indices

Definition at line 108 of file PHM.h.

int doci2DM::PHM::L
private

Definition at line 94 of file PHM.h.

int doci2DM::PHM::N
private

Definition at line 96 of file PHM.h.

std::unique_ptr< helpers::tmatrix< int > > PHM::ph2s = nullptr
staticprivate

table translating two particles indices to single particle indices

Definition at line 102 of file PHM.h.

std::unique_ptr< helpers::tmatrix< int > > PHM::s2b = nullptr
staticprivate

table translating single particles indices to the correct 2x2 block

Definition at line 105 of file PHM.h.

std::unique_ptr< helpers::tmatrix< int > > PHM::s2ph = nullptr
staticprivate

table translating single particles indices to two particle indices

Definition at line 99 of file PHM.h.


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