Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Davison, Jacob
tfimsrg
Commits
35659c7e
Commit
35659c7e
authored
Aug 26, 2019
by
Jacob Davison
Browse files
changes to track TensorFlow device
parent
6bb3648b
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.py
View file @
35659c7e
...
...
@@ -18,7 +18,8 @@ import os, sys
#from memory_profiler import profile
import
itertools
import
random
sess
=
tf
.
compat
.
v1
.
Session
(
config
=
tf
.
compat
.
v1
.
ConfigProto
(
log_device_placement
=
True
))
sess
.
close
()
# user files
# sys.path.append('C:\\Users\\davison\\Research\\exact_diagonalization\\')
from
oop_imsrg.hamiltonian
import
*
...
...
main3b.py
View file @
35659c7e
...
...
@@ -156,7 +156,7 @@ def main3b(n_holes, n_particles, ref=None, d=1.0, g=0.5, pb=0.0):
# --- Solve the IM-SRG flow
y0
=
unravel
(
ha
.
E
,
ha
.
f
,
ha
.
G
,
wg
.
W
)
print
(
'sum(Ws**2)'
,
np
.
sum
(
wg
.
W
**
2
))
solver
=
ode
(
derivative
,
jac
=
None
)
solver
.
set_integrator
(
'vode'
,
method
=
'bdf'
,
order
=
5
,
nsteps
=
500
)
solver
.
set_f_params
(
ha
,
ot
,
wg
,
fl
)
...
...
@@ -175,7 +175,7 @@ def main3b(n_holes, n_particles, ref=None, d=1.0, g=0.5, pb=0.0):
Es
,
fs
,
Gs
,
Ws
=
ravel
(
ys
,
ha
.
n_sp_states
)
s_vals
.
append
(
solver
.
t
)
E_vals
.
append
(
Es
)
print
(
'sum(Ws**2)'
,
np
.
sum
(
Ws
**
2
))
iters
+=
1
if
iters
%
10
==
0
:
print
(
"iter: {:>6d}
\t
scale param: {:0.4f}
\t
E = {:0.9f}"
.
format
(
iters
,
solver
.
t
,
Es
))
...
...
Write
Preview
Supports
Markdown
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