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
6e3b72bc
Commit
6e3b72bc
authored
Oct 29, 2020
by
Francois Gygi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
58c08b1a
2067ca05
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
29 deletions
+60
-29
Occ.h
src/Occ.h
+43
-15
PrintCmd.h
src/PrintCmd.h
+16
-13
SpectrumCmd.cpp
src/SpectrumCmd.cpp
+0
-0
release.cpp
src/release.cpp
+1
-1
No files found.
src/Occ.h
View file @
6e3b72bc
...
...
@@ -90,8 +90,6 @@ class Occ : public Var
sum
+=
sd
.
occ
(
i
);
if
(
ui
->
onpe0
()
)
cout
<<
" total electronic charge: "
<<
sum
<<
endl
;
// adjust total number of electrons
//wf.set_nel((int)sum);
}
if
(
argc
==
4
)
...
...
@@ -131,19 +129,25 @@ class Occ : public Var
Wavefunction
&
wf
=
s
->
wf
;
// ispin-1 in next line: spins are numbered starting from 1 in
// the set occ command
SlaterDet
&
sd
=
*
wf
.
sd
(
ispin
-
1
,
0
);
// n-1 in next line: states are numbered starting from 1 in
// the set occ command
sd
.
set_occ
(
n
-
1
,
f
);
// recompute total electronic charge
double
sum
=
0
.
0
;
for
(
int
isp
=
0
;
isp
<
wf
.
nspin
();
isp
++
)
for
(
int
i
=
0
;
i
<
wf
.
nst
(
isp
);
i
++
)
sum
+=
wf
.
sd
(
isp
,
0
)
->
occ
(
i
);
for
(
int
isp_loc
=
0
;
isp_loc
<
wf
.
nsp_loc
();
++
isp_loc
)
{
SlaterDet
&
sd
=
*
wf
.
sd
(
isp_loc
,
0
);
if
(
(
ispin
-
1
)
==
wf
.
isp_global
(
isp_loc
)
)
{
// n-1 in next line: states are numbered starting from 1 in
// the set occ command
sd
.
set_occ
(
n
-
1
,
f
);
}
// recompute total electronic charge
for
(
int
i
=
0
;
i
<
sd
.
nst
();
i
++
)
sum
+=
sd
.
occ
(
i
);
}
double
tsum
;
MPI_Allreduce
(
&
sum
,
&
tsum
,
1
,
MPI_DOUBLE
,
MPI_SUM
,
MPIdata
::
sp_comm
());
sum
=
tsum
;
if
(
ui
->
onpe0
()
)
cout
<<
" total electronic charge: "
<<
sum
<<
endl
;
// adjust total number of electrons
//wf.set_nel((int)sum);
}
return
0
;
}
...
...
@@ -156,13 +160,36 @@ class Occ : public Var
const
Wavefunction
&
wf
=
s
->
wf
;
st
<<
" occupation numbers"
<<
endl
;
// collect occupation numbers for all spins in occtmp[ispin][n]
std
::
vector
<
vector
<
double
>
>
occtmp
;
occtmp
.
resize
(
wf
.
nspin
());
for
(
int
ispin
=
0
;
ispin
<
wf
.
nspin
();
ispin
++
)
{
const
SlaterDet
&
sd
=
*
wf
.
sd
(
ispin
,
0
);
const
int
nst
=
sd
.
nst
();
const
int
nst
=
wf
.
nst
(
ispin
);
occtmp
[
ispin
].
resize
(
nst
,
0
.
0
);
int
isp_loc
=
wf
.
isp_local
(
ispin
);
if
(
isp_loc
>=
0
)
{
const
SlaterDet
&
sd
=
*
wf
.
sd
(
isp_loc
,
0
);
for
(
int
n
=
0
;
n
<
nst
;
n
++
)
{
occtmp
[
ispin
][
n
]
=
sd
.
occ
(
n
);
}
}
vector
<
double
>
tmp
(
nst
);
MPI_Allreduce
(
&
occtmp
[
ispin
][
0
],
&
tmp
[
0
],
nst
,
MPI_DOUBLE
,
MPI_SUM
,
MPIdata
::
sp_comm
());
occtmp
[
ispin
]
=
tmp
;
}
for
(
int
ispin
=
0
;
ispin
<
wf
.
nspin
();
++
ispin
)
{
const
int
nst
=
wf
.
nst
(
ispin
);
for
(
int
n
=
0
;
n
<
nst
;
n
++
)
{
st
<<
setw
(
7
)
<<
setprecision
(
4
)
<<
sd
.
occ
(
n
)
;
st
<<
setw
(
7
)
<<
setprecision
(
4
)
<<
occtmp
[
ispin
][
n
]
;
if
(
(
n
%
10
)
==
9
)
st
<<
endl
;
}
if
(
nst
%
10
!=
0
)
...
...
@@ -171,6 +198,7 @@ class Occ : public Var
st
<<
endl
;
}
st
<<
" total electronic charge: "
<<
wf
.
nel
();
return
st
.
str
();
}
...
...
src/PrintCmd.h
View file @
6e3b72bc
...
...
@@ -45,25 +45,28 @@ class PrintCmd : public Cmd
int
action
(
int
argc
,
char
**
argv
)
{
if
(
ui
->
onpe0
()
)
if
(
argc
!=
2
)
{
if
(
argc
!=
2
)
{
if
(
ui
->
onpe0
()
)
cout
<<
" use: print variable"
<<
endl
;
return
1
;
}
return
1
;
}
Var
*
varptr
=
ui
->
findVar
(
argv
[
1
]);
if
(
varptr
)
{
cout
<<
varptr
->
print
()
<<
endl
;
}
else
Var
*
varptr
=
ui
->
findVar
(
argv
[
1
]);
if
(
varptr
)
{
string
s
=
varptr
->
print
();
if
(
ui
->
onpe0
()
)
cout
<<
s
<<
endl
;
}
else
{
// variable is not in the variable list
if
(
ui
->
onpe0
()
)
{
// variable is not in the variable list
cout
<<
" no such variable: "
<<
argv
[
1
]
<<
endl
;
return
1
;
}
return
1
;
}
return
0
;
}
...
...
src/SpectrumCmd.cpp
View file @
6e3b72bc
This diff is collapsed.
Click to expand it.
src/release.cpp
View file @
6e3b72bc
...
...
@@ -19,5 +19,5 @@
#include "release.h"
std
::
string
release
(
void
)
{
return
std
::
string
(
"rel1_72_0"
);
return
std
::
string
(
"rel1_72_0
dev
"
);
}
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