Commit 211d90a8 by Huihuo Zheng Committed by Francois Gygi

adjust blocking factors of square matrices

parent 7c62abc5
...@@ -281,15 +281,16 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref, ...@@ -281,15 +281,16 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
DoubleMatrix dcref_proxy(dwf_ref.sd(ispin,ikp)->c()); DoubleMatrix dcref_proxy(dwf_ref.sd(ispin,ikp)->c());
dc_proxy += dcref_proxy; dc_proxy += dcref_proxy;
#else #else
DoubleMatrix matproj1(ctxt,nst,nst);
DoubleMatrix matproj2(ctxt,nst,nst);
DoubleMatrix matenergy(ctxt,nst,nst);
DoubleMatrix c_proxy(s_.wf.sd(ispin,ikp)->c()); DoubleMatrix c_proxy(s_.wf.sd(ispin,ikp)->c());
DoubleMatrix dc_proxy(dwf.sd(ispin,ikp)->c()); DoubleMatrix dc_proxy(dwf.sd(ispin,ikp)->c());
DoubleMatrix cref_proxy(wf_ref.sd(ispin,ikp)->c()); DoubleMatrix cref_proxy(wf_ref.sd(ispin,ikp)->c());
DoubleMatrix dcref_proxy(dwf_ref.sd(ispin,ikp)->c()); DoubleMatrix dcref_proxy(dwf_ref.sd(ispin,ikp)->c());
int nb = c_proxy.nb();
DoubleMatrix matproj1(ctxt,nst,nst,nb,nb);
DoubleMatrix matproj2(ctxt,nst,nst,nb,nb);
DoubleMatrix matenergy(ctxt,nst,nst,nb,nb);
// matproj1 = <wf_ref|wf> => matproj1 // matproj1 = <wf_ref|wf> => matproj1
matproj1.gemm('t','n',2.0,cref_proxy,c_proxy,0.0); matproj1.gemm('t','n',2.0,cref_proxy,c_proxy,0.0);
matproj1.ger(-1.0,cref_proxy,0,c_proxy,0); matproj1.ger(-1.0,cref_proxy,0,c_proxy,0);
...@@ -314,14 +315,15 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref, ...@@ -314,14 +315,15 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
} }
else // complex wave functions else // complex wave functions
{ {
ComplexMatrix matproj1(ctxt,nst,nst);
ComplexMatrix matproj2(ctxt,nst,nst);
ComplexMatrix matenergy(ctxt,nst,nst);
ComplexMatrix &c(s_.wf.sd(ispin,ikp)->c()); ComplexMatrix &c(s_.wf.sd(ispin,ikp)->c());
ComplexMatrix &dc(dwf.sd(ispin,ikp)->c()); ComplexMatrix &dc(dwf.sd(ispin,ikp)->c());
ComplexMatrix &cref(wf_ref.sd(ispin,ikp)->c()); ComplexMatrix &cref(wf_ref.sd(ispin,ikp)->c());
ComplexMatrix &dcref(dwf_ref.sd(ispin,ikp)->c()); ComplexMatrix &dcref(dwf_ref.sd(ispin,ikp)->c());
int nb = c.nb();
ComplexMatrix matproj1(ctxt,nst,nst,nb,nb);
ComplexMatrix matproj2(ctxt,nst,nst,nb,nb);
ComplexMatrix matenergy(ctxt,nst,nst,nb,nb);
// matproj1 = <wf_ref|wf> // matproj1 = <wf_ref|wf>
matproj1.gemm('c','n',1.0,cref,c,0.0); matproj1.gemm('c','n',1.0,cref,c,0.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment