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
75919ee2
Commit
75919ee2
authored
Apr 28, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test negative density in HSE and RSH functionals
parent
c9400235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
HSEFunctional.C
src/HSEFunctional.C
+17
-2
RSHFunctional.C
src/RSHFunctional.C
+18
-2
No files found.
src/HSEFunctional.C
View file @
75919ee2
...
...
@@ -708,6 +708,14 @@ void gcor2(double a, double a1, double b1, double b2, double b3, double b4,
void
PBE_correlation
(
const
double
rho
,
const
double
grad
,
double
*
ec
,
double
*
vc1
,
double
*
vc2
)
{
*
ec
=
0
.
0
;
*
vc1
=
0
.
0
;
*
vc2
=
0
.
0
;
if
(
rho
<
1.e-18
)
{
return
;
}
const
double
third
=
1
.
0
/
3
.
0
;
const
double
pi32third
=
3
.
09366772628014
;
/* (3*pi^2 ) ^(1/3) */
...
...
@@ -775,6 +783,13 @@ void PBE_correlation_sp(const double rho_up, const double rho_dn,
const
double
grad_up
,
const
double
grad_dn
,
const
double
grad
,
double
*
ec
,
double
*
vc1_up
,
double
*
vc1_dn
,
double
*
vc2
)
{
*
ec
=
0
.
0
;
*
vc1_up
=
0
.
0
;
*
vc1_dn
=
0
.
0
;
*
vc2
=
0
.
0
;
const
double
rh_up
=
(
rho_up
<
1.e-18
)
?
0
.
0
:
rho_up
;
const
double
rh_dn
=
(
rho_dn
<
1.e-18
)
?
0
.
0
:
rho_dn
;
const
double
third
=
1
.
0
/
3
.
0
;
const
double
third2
=
2
.
0
/
3
.
0
;
...
...
@@ -803,10 +818,10 @@ void PBE_correlation_sp(const double rho_up, const double rho_dn,
// f = spin-scaling factor from [c] (9)
// construct ec, using [c] (8)
const
double
rhotot
=
rh
o_up
+
rho
_dn
;
const
double
rhotot
=
rh
_up
+
rh
_dn
;
const
double
rh13
=
pow
(
rhotot
,
third
);
const
double
zet
=
(
rh
o_up
-
rho
_dn
)
/
rhotot
;
const
double
zet
=
(
rh
_up
-
rh
_dn
)
/
rhotot
;
const
double
g
=
0
.
5
*
(
pow
(
1
.
0
+
zet
,
third2
)
+
pow
(
1
.
0
-
zet
,
third2
)
);
const
double
fk
=
pi32third
*
rh13
;
const
double
rs
=
alpha
/
fk
;
...
...
src/RSHFunctional.C
View file @
75919ee2
...
...
@@ -717,6 +717,15 @@ void RSHFunctional::gcor2(double a, double a1, double b1, double b2,
void
RSHFunctional
::
PBE_correlation
(
const
double
rho
,
const
double
grad
,
double
*
ec
,
double
*
vc1
,
double
*
vc2
)
{
*
ec
=
0
.
0
;
*
vc1
=
0
.
0
;
*
vc2
=
0
.
0
;
if
(
rho
<
1.e-18
)
{
return
;
}
const
double
third
=
1
.
0
/
3
.
0
;
const
double
pi32third
=
3
.
09366772628014
;
/* (3*pi^2 ) ^(1/3) */
const
double
alpha
=
1
.
91915829267751
;
/* pow(9.0*pi/4.0, third)*/
...
...
@@ -783,6 +792,13 @@ void RSHFunctional::PBE_correlation_sp(const double rho_up, const double rho_dn,
const
double
grad_up
,
const
double
grad_dn
,
const
double
grad
,
double
*
ec
,
double
*
vc1_up
,
double
*
vc1_dn
,
double
*
vc2
)
{
*
ec
=
0
.
0
;
*
vc1_up
=
0
.
0
;
*
vc1_dn
=
0
.
0
;
*
vc2
=
0
.
0
;
const
double
rh_up
=
(
rho_up
<
1.e-18
)
?
0
.
0
:
rho_up
;
const
double
rh_dn
=
(
rho_dn
<
1.e-18
)
?
0
.
0
:
rho_dn
;
const
double
third
=
1
.
0
/
3
.
0
;
const
double
third2
=
2
.
0
/
3
.
0
;
...
...
@@ -811,10 +827,10 @@ void RSHFunctional::PBE_correlation_sp(const double rho_up, const double rho_dn,
// f = spin-scaling factor from [c] (9)
// construct ec, using [c] (8)
const
double
rhotot
=
rh
o_up
+
rho
_dn
;
const
double
rhotot
=
rh
_up
+
rh
_dn
;
const
double
rh13
=
pow
(
rhotot
,
third
);
const
double
zet
=
(
rh
o_up
-
rho
_dn
)
/
rhotot
;
const
double
zet
=
(
rh
_up
-
rh
_dn
)
/
rhotot
;
const
double
g
=
0
.
5
*
(
pow
(
1
.
0
+
zet
,
third2
)
+
pow
(
1
.
0
-
zet
,
third2
)
);
const
double
fk
=
pi32third
*
rh13
;
const
double
rs
=
alpha
/
fk
;
...
...
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