20 #include "DMRGSCFwtilde.h" 24 iHandler = iHandler_in;
27 for (
int irrep = 0; irrep < iHandler->
getNirreps(); irrep++){
28 Nocc_dmrg[ irrep ] = iHandler->
getNOCC( irrep ) + iHandler->
getNDMRG( irrep );
31 wmattilde =
new double***[ iHandler->
getNirreps() ];
32 for (
int irrep_pq = 0; irrep_pq < iHandler->
getNirreps(); irrep_pq++){
33 wmattilde[ irrep_pq ] =
new double**[ iHandler->
getNirreps() ];
34 for (
int irrep_rs = 0; irrep_rs < iHandler->
getNirreps(); irrep_rs++){
35 const unsigned int sizeblock_pr = Nocc_dmrg[ irrep_pq ] * Nocc_dmrg[ irrep_rs ];
36 const unsigned int sizeblock_qs = iHandler->
getNORB( irrep_pq ) * iHandler->
getNORB( irrep_rs );
37 wmattilde[ irrep_pq ][ irrep_rs ] =
new double*[ sizeblock_pr ];
38 for (
unsigned int combined_pr = 0; combined_pr < sizeblock_pr; combined_pr++){
39 wmattilde[ irrep_pq ][ irrep_rs ][ combined_pr ] =
new double[ sizeblock_qs ];
48 for (
int irrep_pq = 0; irrep_pq < iHandler->
getNirreps(); irrep_pq++){
49 for (
int irrep_rs = 0; irrep_rs < iHandler->
getNirreps(); irrep_rs++){
50 const unsigned int sizeblock_pr = Nocc_dmrg[ irrep_pq ] * Nocc_dmrg[ irrep_rs ];
51 for (
unsigned int combined_pr = 0; combined_pr < sizeblock_pr; combined_pr++){
52 delete [] wmattilde[ irrep_pq ][ irrep_rs ][ combined_pr ];
54 delete [] wmattilde[ irrep_pq ][ irrep_rs ];
56 delete [] wmattilde[ irrep_pq ];
66 for (
int irrep_pq = 0; irrep_pq < iHandler->
getNirreps(); irrep_pq++){
67 for (
int irrep_rs = 0; irrep_rs < iHandler->
getNirreps(); irrep_rs++){
68 const unsigned int sizeblock_pr = Nocc_dmrg[ irrep_pq ] * Nocc_dmrg[ irrep_rs ];
69 const unsigned int sizeblock_qs = iHandler->
getNORB( irrep_pq ) * iHandler->
getNORB( irrep_rs );
70 for (
unsigned int combined_pr = 0; combined_pr < sizeblock_pr; combined_pr++){
71 for (
unsigned int combined_qs = 0; combined_qs < sizeblock_qs; combined_qs++){
72 wmattilde[ irrep_pq ][ irrep_rs ][ combined_pr ][ combined_qs ] = 0.0;
80 void CheMPS2::DMRGSCFwtilde::set(
const int irrep_pq,
const int irrep_rs,
const int p,
const int q,
const int r,
const int s,
const double val){
82 wmattilde[ irrep_pq ][ irrep_rs ][ p + Nocc_dmrg[ irrep_pq ] * r ][ q + iHandler->
getNORB(irrep_pq) * s ] = val;
88 return wmattilde[ irrep_pq ][ irrep_rs ][ p + Nocc_dmrg[ irrep_pq ] * r ][ q + iHandler->
getNORB(irrep_pq) * s ];
94 return wmattilde[ irrep_pq ][ irrep_rs ][ p + Nocc_dmrg[ irrep_pq ] * r ];
int getNORB(const int irrep) const
Get the number of orbitals for an irrep.
virtual ~DMRGSCFwtilde()
Destructor.
double get(const int irrep_pq, const int irrep_rs, const int p, const int q, const int r, const int s) const
Get an element of w_tilde_pqrs.
DMRGSCFwtilde(DMRGSCFindices *iHandler_in)
Constructor.
int getNDMRG(const int irrep) const
Get the number of active orbitals for an irrep.
int getNOCC(const int irrep) const
Get the number of occupied orbitals for an irrep.
void set(const int irrep_pq, const int irrep_rs, const int p, const int q, const int r, const int s, const double val)
Set an element of w_tilde_pqrs.
double * getBlock(const int irrep_pq, const int irrep_rs, const int p, const int r)
Get the (pr) subblock of w_tilde_pqrs, which is stored as w_tilde[ I_pq ][ I_rs ][ p + ( Nocc[I_pq] +...
int getNirreps() const
Get the number of irreps.