Skip to content

Commit

Permalink
Update for recent gbasis and grid API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tovrstra committed Feb 26, 2024
1 parent fb5f96c commit 575c3f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/horton3/runall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
# --

set -e
denspart-from-horton3 h2o_sto3g.fchk density.npz
denspart density.npz results.npz
denspart-write-extxyz results.npz results.xyz
8 changes: 4 additions & 4 deletions src/denspart/adapters/horton3.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _setup_grid(atnums, atcoords, nrad, nang, store_atgrids):
becke._radii[54] = 3.5
oned = GaussChebyshev(nrad)
rgrid = BeckeRTransform(1e-4, 1.5).transform_1d_grid(oned)
grid = MolGrid.from_size(atnums, atcoords, rgrid, nang, becke, store=store_atgrids)
grid = MolGrid.from_size(atnums, atcoords, nang, rgrid, becke, store=store_atgrids)
assert np.isfinite(grid.points).all()
assert np.isfinite(grid.weights).all()
assert (grid.weights >= 0).all()
Expand Down Expand Up @@ -154,7 +154,7 @@ def _compute_stuff(iodata, points, gradient, orbitals, chunk_size):
)
coeffs, occs = iodata.mo.coeffs, iodata.mo.occs
one_rdm = np.dot(coeffs * occs, coeffs.T)
basis, coord_types = from_iodata(iodata)
basis = from_iodata(iodata)

# Prepare result dictionary.
result = {"density": np.zeros(len(points))}
Expand All @@ -179,12 +179,12 @@ def _compute_stuff(iodata, points, gradient, orbitals, chunk_size):
print(f"Computing stuff: {istart} ... {iend} / {len(points)}")
# Basis functions are computed upfront for efficiency.
print(" basis")
basis_grid = evaluate_basis(basis, points[istart:iend], coord_type=coord_types)
basis_grid = evaluate_basis(basis, points[istart:iend])
if gradient:
print(" basis_gradient")
basis_gradient_grid = np.array(
[
evaluate_deriv_basis(basis, points[istart:iend], orders, coord_type=coord_types)
evaluate_deriv_basis(basis, points[istart:iend], orders)
for orders in np.identity(3, dtype=int)
]
)
Expand Down

0 comments on commit 575c3f5

Please sign in to comment.