Permalink
Browse files

Merge pull request #1065 from raimis/port_psimrcc

Port psimrcc to Windows
  • Loading branch information...
dgasmith committed Jul 10, 2018
2 parents 6de9c81 + c5ab1d6 commit 571029c94e0e742ef19fa7dcd34983f5e9354c38
@@ -109,7 +109,7 @@ psimrcc(SharedWavefunction ref_wfn, Options &options)
int nactmo = moinfo->get_nactv();
int nactel = moinfo->get_nactive_ael() + moinfo->get_nactive_bel();
if(nactel > 2 and nactmo > 2){
if(nactel > 2 && nactmo > 2){
outfile->Printf("\n WARNING: PSIMRCC detected that you are not using a CAS(2,n) or CAS(m,2) active space");
outfile->Printf("\n You requested a CAS(%d,%d) space. In this case the program will run",nactel,nactmo);
outfile->Printf("\n but will negled matrix elements of the effective Hamiltonian between");
@@ -125,7 +125,7 @@ psimrcc(SharedWavefunction ref_wfn, Options &options)
mrpt2(ref_wfn, options);
}else{
mrccsd(ref_wfn, options);
if(nactel > 2 and nactmo > 2){
if(nactel > 2 && nactmo > 2){
outfile->Printf("\n WARNING: PSIMRCC detected that you are not using a CAS(2,n) or CAS(m,2) active space");
outfile->Printf("\n You requested a CAS(%d,%d) space. In this case the program will run",nactel,nactmo);
outfile->Printf("\n but will negled matrix elements of the effective Hamiltonian between");
@@ -99,7 +99,7 @@ void MRCCSD_T::compute()
}
}
if(not options_.get_bool("DIAGONALIZE_HEFF")){
if(!options_.get_bool("DIAGONALIZE_HEFF")){
double Heff_E = 0.0;
for(int mu = 0; mu < nrefs; ++mu){
for(int nu = 0; nu < nrefs; ++nu){
@@ -63,7 +63,7 @@ void MRCCSD_T::compute_restricted()
compute_ooo_triples_restricted();
compute_ooO_triples_restricted();
if(not closed_shell_case){
if(!closed_shell_case){
compute_oOO_triples_restricted();
compute_OOO_triples_restricted();
}
@@ -107,7 +107,7 @@ void MRCCSD_T::compute_restricted()
}
}
if(not options_.get_bool("DIAGONALIZE_HEFF")){
if(!options_.get_bool("DIAGONALIZE_HEFF")){
double Heff_E = 0.0;
for(int mu = 0; mu < nrefs; ++mu){
for(int nu = 0; nu < nrefs; ++nu){
@@ -156,7 +156,7 @@ void MRCCSD_T::compute_ooo_triples_restricted()
size_t j_abs = o->get_tuple_abs_index(ijk.ind_abs<1>());
size_t k_abs = o->get_tuple_abs_index(ijk.ind_abs<2>());
if((i_abs < j_abs) and (j_abs < k_abs)){
if((i_abs < j_abs) && (j_abs < k_abs)){
int i_sym = o->get_tuple_irrep(ijk.ind_abs<0>());
int j_sym = o->get_tuple_irrep(ijk.ind_abs<1>());
@@ -310,7 +310,7 @@ void MRCCSD_T::compute_OOO_triples_restricted()
size_t j_abs = o->get_tuple_abs_index(ijk.ind_abs<1>());
size_t k_abs = o->get_tuple_abs_index(ijk.ind_abs<2>());
if((i_abs < j_abs) and (j_abs < k_abs)){
if((i_abs < j_abs) && (j_abs < k_abs)){
int i_sym = o->get_tuple_irrep(ijk.ind_abs<0>());
int j_sym = o->get_tuple_irrep(ijk.ind_abs<1>());
@@ -120,7 +120,7 @@ void MRCCSD_T::compute_ooO_triples_spin_adapted()
size_t j_abs = o->get_tuple_abs_index(ijk.ind_abs<1>());
size_t k_abs = o->get_tuple_abs_index(ijk.ind_abs<2>());
if((i_abs <= j_abs) and (j_abs <= k_abs)){
if((i_abs <= j_abs) && (j_abs <= k_abs)){
int i_sym = o->get_tuple_irrep(ijk.ind_abs<0>());
int j_sym = o->get_tuple_irrep(ijk.ind_abs<1>());
int k_sym = o->get_tuple_irrep(ijk.ind_abs<2>());
@@ -269,7 +269,7 @@ void MRCCSD_T::compute_ooO_triples_spin_adapted()
//////////////
// IJK CASE //
//////////////
if((i_abs < j_abs) and (j_abs <= k_abs)){
if((i_abs < j_abs) && (j_abs <= k_abs)){
for(int mu = 0; mu < nrefs; ++mu){
T[mu][ijk_sym]->zero();
}
@@ -375,7 +375,7 @@ void MRCCSD_T::compute_ooO_triples_spin_adapted()
//////////////
// IKJ CASE //
//////////////
if((i_abs <= j_abs) and (j_abs < k_abs)){
if((i_abs <= j_abs) && (j_abs < k_abs)){
for(int mu = 0; mu < nrefs; ++mu){
T[mu][ijk_sym]->zero();
@@ -482,7 +482,7 @@ void MRCCSD_T::compute_ooO_triples_spin_adapted()
//////////////
// JKI CASE //
//////////////
if((i_abs < j_abs) and (j_abs < k_abs)){
if((i_abs < j_abs) && (j_abs < k_abs)){
for(int mu = 0; mu < nrefs; ++mu){
T[mu][ijk_sym]->zero();
@@ -589,7 +589,7 @@ void MRCCSD_T::compute_ooO_triples_spin_adapted()
//////////////
// AAA CASE //
//////////////
if((i_abs < j_abs) and (j_abs < k_abs)){
if((i_abs < j_abs) && (j_abs < k_abs)){
for(int mu = 0; mu < nrefs; ++mu){
T[mu][ijk_sym]->zero();
@@ -43,7 +43,7 @@ void MRCCSD_T::compute_ooo_contribution_to_Heff(int i,int j,int k,int mu,BlockMa
double sign_internal_excitation = moinfo->get_sign_internal_excitation(mu,nu);
// Set (alpha)->(alpha) single excitations
if((alpha_internal_excitation.size() == 1) and (beta_internal_excitation.size() == 0)){
if((alpha_internal_excitation.size() == 1) && (beta_internal_excitation.size() == 0)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_A_ooo_contribution_to_Heff(alpha_internal_excitation[0].first,alpha_internal_excitation[0].second,i,j,k,mu,T3);
}
}
@@ -60,15 +60,15 @@ void MRCCSD_T::compute_ooO_contribution_to_Heff(int i,int j,int k,int mu,BlockMa
double sign_internal_excitation = moinfo->get_sign_internal_excitation(mu,nu);
// Set (alpha)->(alpha) single excitations
if((alpha_internal_excitation.size() == 1) and (beta_internal_excitation.size() == 0)){
if((alpha_internal_excitation.size() == 1) && (beta_internal_excitation.size() == 0)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_A_ooO_contribution_to_Heff(alpha_internal_excitation[0].first,alpha_internal_excitation[0].second,i,j,k,mu,T3);
}
// Set (beta)->(beta) single excitations
if((alpha_internal_excitation.size() == 0) and (beta_internal_excitation.size() == 1)){
if((alpha_internal_excitation.size() == 0) && (beta_internal_excitation.size() == 1)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_B_ooO_contribution_to_Heff(beta_internal_excitation[0].first,beta_internal_excitation[0].second,i,j,k,mu,T3);
}
// Set (alpha,beta)->(alpha,beta) double excitations
if((alpha_internal_excitation.size() == 1) and (beta_internal_excitation.size() == 1)){
if((alpha_internal_excitation.size() == 1) && (beta_internal_excitation.size() == 1)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_AB_ooO_contribution_to_Heff(alpha_internal_excitation[0].first, beta_internal_excitation[0].first,
alpha_internal_excitation[0].second,beta_internal_excitation[0].second,i,j,k,mu,T3);
}
@@ -86,15 +86,15 @@ void MRCCSD_T::compute_oOO_contribution_to_Heff(int i,int j,int k,int mu,BlockMa
double sign_internal_excitation = moinfo->get_sign_internal_excitation(mu,nu);
// Set (alpha)->(alpha) single excitations
if((alpha_internal_excitation.size() == 1) and (beta_internal_excitation.size() == 0)){
if((alpha_internal_excitation.size() == 1) && (beta_internal_excitation.size() == 0)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_A_oOO_contribution_to_Heff(alpha_internal_excitation[0].first,alpha_internal_excitation[0].second,i,j,k,mu,T3);
}
// Set (beta)->(beta) single excitations
if((alpha_internal_excitation.size() == 0) and (beta_internal_excitation.size() == 1)){
if((alpha_internal_excitation.size() == 0) && (beta_internal_excitation.size() == 1)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_B_oOO_contribution_to_Heff(beta_internal_excitation[0].first,beta_internal_excitation[0].second,i,j,k,mu,T3);
}
// Set (alpha,beta)->(alpha,beta) double excitations
if((alpha_internal_excitation.size() == 1) and (beta_internal_excitation.size() == 1)){
if((alpha_internal_excitation.size() == 1) && (beta_internal_excitation.size() == 1)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_AB_oOO_contribution_to_Heff(alpha_internal_excitation[0].first, beta_internal_excitation[0].first,
alpha_internal_excitation[0].second,beta_internal_excitation[0].second,i,j,k,mu,T3);
}
@@ -112,7 +112,7 @@ void MRCCSD_T::compute_OOO_contribution_to_Heff(int i,int j,int k,int mu,BlockMa
double sign_internal_excitation = moinfo->get_sign_internal_excitation(mu,nu);
// Set (beta)->(beta) single excitations
if((alpha_internal_excitation.size() == 0) and (beta_internal_excitation.size() == 1)){
if((alpha_internal_excitation.size() == 0) && (beta_internal_excitation.size() == 1)){
d_h_eff[nu][mu] += sign_internal_excitation * compute_B_OOO_contribution_to_Heff(beta_internal_excitation[0].first,beta_internal_excitation[0].second,i,j,k,mu,T3);
}
}
@@ -39,7 +39,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff(int u_abs,int x_abs,int i_ab
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int jk_sym = oo->get_tuple_irrep(j_abs,k_abs);
@@ -48,7 +48,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff(int u_abs,int x_abs,int i_ab
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -66,7 +66,7 @@ double MRCCSD_T::compute_A_ooO_contribution_to_Heff(int u_abs,int x_abs,int i_ab
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int jk_sym = oo->get_tuple_irrep(j_abs,k_abs);
@@ -75,7 +75,7 @@ double MRCCSD_T::compute_A_ooO_contribution_to_Heff(int u_abs,int x_abs,int i_ab
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -93,7 +93,7 @@ double MRCCSD_T::compute_A_oOO_contribution_to_Heff(int u_abs,int x_abs,int i_ab
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int jk_sym = oo->get_tuple_irrep(j_abs,k_abs);
@@ -102,7 +102,7 @@ double MRCCSD_T::compute_A_oOO_contribution_to_Heff(int u_abs,int x_abs,int i_ab
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -39,7 +39,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff_restricted(int u_abs,int x_a
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int ij_sym = oo->get_tuple_irrep(i_abs,j_abs);
@@ -52,7 +52,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff_restricted(int u_abs,int x_a
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -62,7 +62,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff_restricted(int u_abs,int x_a
}
}
if(j_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -72,7 +72,7 @@ double MRCCSD_T::compute_A_ooo_contribution_to_Heff_restricted(int u_abs,int x_a
}
}
if(k_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -90,7 +90,7 @@ double MRCCSD_T::compute_A_ooO_contribution_to_Heff_restricted(int u_abs,int x_a
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int ik_sym = oo->get_tuple_irrep(i_abs,k_abs);
@@ -101,7 +101,7 @@ double MRCCSD_T::compute_A_ooO_contribution_to_Heff_restricted(int u_abs,int x_a
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -111,7 +111,7 @@ double MRCCSD_T::compute_A_ooO_contribution_to_Heff_restricted(int u_abs,int x_a
}
}
if(j_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
@@ -129,7 +129,7 @@ double MRCCSD_T::compute_A_oOO_contribution_to_Heff_restricted(int u_abs,int x_a
int i_sym = o->get_tuple_irrep(i_abs);
int j_sym = o->get_tuple_irrep(j_abs);
int k_sym = o->get_tuple_irrep(k_abs);
int ijk_sym = i_sym xor j_sym xor k_sym;
int ijk_sym = i_sym ^ j_sym ^ k_sym;
int x_sym = v->get_tuple_irrep(x_abs);
int jk_sym = oo->get_tuple_irrep(j_abs,k_abs);
@@ -138,7 +138,7 @@ double MRCCSD_T::compute_A_oOO_contribution_to_Heff_restricted(int u_abs,int x_a
size_t jk_rel = oo->get_tuple_rel_index(j_abs,k_abs);
if(i_abs == u_abs){
CCIndexIterator ef("[vv]",ijk_sym xor x_sym);
CCIndexIterator ef("[vv]",ijk_sym ^ x_sym);
for(ef.first(); !ef.end(); ef.next()){
int ef_sym = vv->get_tuple_irrep(ef.ind_abs<0>(),ef.ind_abs<1>());
size_t ef_rel = vv->get_tuple_rel_index(ef.ind_abs<0>(),ef.ind_abs<1>());
Oops, something went wrong.

0 comments on commit 571029c

Please sign in to comment.