Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
e883168d
Commit
e883168d
authored
Jan 16, 2020
by
Francois Gygi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into scan
parents
e1a0d16e
186b7a81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
19 deletions
+10
-19
ExchangeOperator.C
src/ExchangeOperator.C
+6
-15
ExchangeOperator.h
src/ExchangeOperator.h
+3
-3
qb.C
src/qb.C
+1
-1
No files found.
src/ExchangeOperator.C
View file @
e883168d
...
...
@@ -253,7 +253,7 @@ double ExchangeOperator::update_energy(bool compute_stress)
if
(
gamma_only_
)
return
eex_
=
compute_exchange_at_gamma_
(
s_
.
wf
,
0
,
compute_stress
);
else
return
eex_
=
compute_exchange_for_general_case_
(
&
s_
,
0
,
compute_stress
);
return
eex_
=
compute_exchange_for_general_case_
(
s_
.
wf
,
0
,
compute_stress
);
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -265,7 +265,7 @@ double ExchangeOperator::update_operator(bool compute_stress)
if
(
gamma_only_
)
eex_
=
compute_exchange_at_gamma_
(
s_
.
wf
,
&
dwf0_
,
compute_stress
);
else
eex_
=
compute_exchange_for_general_case_
(
&
s_
,
&
dwf0_
,
compute_stress
);
eex_
=
compute_exchange_for_general_case_
(
s_
.
wf
,
&
dwf0_
,
compute_stress
);
// wf0_ is kept as a reference state
wf0_
=
s_
.
wf
;
...
...
@@ -288,12 +288,6 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
const
Context
&
ctxt
=
s_
.
wf
.
sd
(
ispin
,
ikp
)
->
c
().
context
();
if
(
s_
.
wf
.
sd
(
ispin
,
ikp
)
->
basis
().
real
()
)
{
#if 0
update_sigma();
DoubleMatrix dc_proxy(dwf.sd(ispin,ikp)->c());
DoubleMatrix dcref_proxy(dwf_ref.sd(ispin,ikp)->c());
dc_proxy += dcref_proxy;
#else
DoubleMatrix
c_proxy
(
s_
.
wf
.
sd
(
ispin
,
ikp
)
->
c
());
DoubleMatrix
dc_proxy
(
dwf
.
sd
(
ispin
,
ikp
)
->
c
());
DoubleMatrix
cref_proxy
(
wf_ref
.
sd
(
ispin
,
ikp
)
->
c
());
...
...
@@ -324,7 +318,6 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
// |dwf> += mix * |wf_ref> * matproj2
dc_proxy
.
gemm
(
'n'
,
'n'
,
mix
,
cref_proxy
,
matproj2
,
1
.
0
);
#endif
}
else
// complex wave functions
{
...
...
@@ -361,12 +354,12 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
}
////////////////////////////////////////////////////////////////////////////////
double
ExchangeOperator
::
apply_operator
(
Wavefunction
&
dwf
)
void
ExchangeOperator
::
apply_operator
(
Wavefunction
&
dwf
)
{
cout
<<
"ExchangeOperator::apply_operator"
<<
endl
;
// apply sigmaHF to s_.wf and store result in dwf
// use the reference function wf0_ and reference sigma(wf) dwf0_
apply_VXC_
(
1
.
0
,
wf0_
,
dwf0_
,
dwf
);
return
eex_
;
}
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -387,14 +380,12 @@ void ExchangeOperator::cell_moved(void)
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
double
ExchangeOperator
::
compute_exchange_for_general_case_
(
const
Sample
*
s
,
Wavefunction
*
dwf
,
bool
compute_stress
)
double
ExchangeOperator
::
compute_exchange_for_general_case_
(
const
Wavefunction
&
wf
,
Wavefunction
*
dwf
,
bool
compute_stress
)
{
Timer
tm
;
tm
.
start
();
const
Wavefunction
&
wf
=
s
->
wf
;
const
double
omega
=
wf
.
cell
().
volume
();
const
int
nkpoints
=
wf
.
nkp
();
const
int
nspin
=
wf
.
nspin
();
...
...
src/ExchangeOperator.h
View file @
e883168d
...
...
@@ -43,8 +43,8 @@ class ExchangeOperator
// copy of wf
Wavefunction
wfc_
;
double
compute_exchange_for_general_case_
(
const
Sample
*
s
,
Wavefunction
*
d
wf
,
bool
compute_stress
);
double
compute_exchange_for_general_case_
(
const
Wavefunction
&
wf
,
Wavefunction
*
dwf
,
bool
compute_stress
);
double
compute_exchange_at_gamma_
(
const
Wavefunction
&
wf
,
Wavefunction
*
dwf
,
bool
compute_stress
);
void
apply_VXC_
(
double
mix
,
Wavefunction
&
wf_ref
,
...
...
@@ -190,7 +190,7 @@ class ExchangeOperator
double
eex
()
{
return
eex_
;
};
double
update_energy
(
bool
compute_stress
);
double
update_operator
(
bool
compute_stress
);
double
apply_operator
(
Wavefunction
&
dwf
);
void
apply_operator
(
Wavefunction
&
dwf
);
void
add_stress
(
std
::
valarray
<
double
>
&
sigma_exc
);
void
cell_moved
(
void
);
};
...
...
src/qb.C
View file @
e883168d
...
...
@@ -356,7 +356,7 @@ int main(int argc, char **argv, char **envp)
// first argument is "-server"
string
inputfilename
(
argv
[
2
]);
string
outputfilename
(
argv
[
3
]);
bool
echo
=
fals
e
;
bool
echo
=
tru
e
;
ui
.
processCmdsServer
(
inputfilename
,
outputfilename
,
"[qbox]"
,
echo
);
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment