Skip to content

Commit

Permalink
Update nmax values in examples (#104)
Browse files Browse the repository at this point in the history
* Make nmax much smaller in examples due to improved diagonalization routine

* Change `config.numcores` back to -1
  • Loading branch information
timcallow authored Dec 9, 2021
1 parent eb32c10 commit bfc9c82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/boundary_comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# compute the total energy
dirichlet_out = model.CalcEnergy(
25, 4, grid_params={"ngrid": 1000}, scf_params={"mixfrac": 0.7}
4, 4, grid_params={"ngrid": 1000}, scf_params={"mixfrac": 0.7}
)
energy_dirichlet = dirichlet_out["energy"]

Expand Down
4 changes: 2 additions & 2 deletions examples/func_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
model = models.ISModel(atom, xfunc_id="lda_x", cfunc_id="lda_c_pw", spinpol=True)

# compute the total energy
lda_out = model.CalcEnergy(20, 3, scf_params={"mixfrac": 0.6})
lda_out = model.CalcEnergy(2, 2, scf_params={"mixfrac": 0.6})
energy_lda = lda_out["energy"]

# now change the exchange and correlation functionals
Expand All @@ -26,7 +26,7 @@
print(model.info)

# compute the total energy again
clmb_out = model.CalcEnergy(20, 3)
clmb_out = model.CalcEnergy(2, 2)
energy_clmb = clmb_out["energy"]

print("Total free energy with LDA :" + str(energy_lda.F_tot))
Expand Down
7 changes: 3 additions & 4 deletions examples/pressure_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@

# compute the total energy
# define the number of levels to scan for
# note that nmax should be much greater than the actual levels interested in
# and should be tested for convergence
nmax = 40
lmax = 3
# test these nos for convergence
nmax = 2
lmax = 2
scf_output = model.CalcEnergy(nmax, lmax, grid_params={"ngrid": 2000})

# with the energy output compute the pressure
Expand Down
6 changes: 2 additions & 4 deletions examples/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
model = models.ISModel(He, bc="neumann")

# compute the total energy
# define the number of levels to scan for
# note that nmax should be much greater than the actual levels interested in
# and should be tested for convergence
nmax = 20
# define the number of levels to scan for, should be tested for convergence
nmax = 2
lmax = 2
output = model.CalcEnergy(nmax, lmax, grid_params={"ngrid": 1000})

Expand Down

0 comments on commit bfc9c82

Please sign in to comment.