-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sparse grid ao along (0,2) axes #114
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -160,7 +160,7 @@ | |||
" \n", | |||
" for line in output.split(\"\\n\"):\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we check if the unit [eV] was correct (or if it should be [meV])? I think it'd be neat to have a cut-off around 42meV (chemical accuracy). If the units are [eV] then we're probably sparsifying a bit too much (150eV error is >1000x worse error than ML models).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grid_AO_dm = grid_AO[0] @ density_matrix # (gsize, N) @ (N, N) -> (gsize, N) | ||
grid_AO_dm = jnp.expand_dims(grid_AO_dm, axis=0) # (1, gsize, N) | ||
grid_AO_dm = grid_AO[0] @ density_matrix # (gsize, N) @ (N, N) -> (gsize, N) | ||
grid_AO_dm = jnp.expand_dims(grid_AO_dm, axis=0) # (1, gsize, N) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing we can use the same code for this!
@@ -199,10 +199,18 @@ def init_dft_tensors_cpu(mol, opts, DIIS_iters=9): | |||
grid_weights = grids.weights # (grid_size,) = (45624,) for C6H6 | |||
coord_str = 'GTOval_cart_deriv1' if mol.cart else 'GTOval_sph_deriv1' | |||
grid_AO = mol.eval_gto(coord_str, grids.coords, 4) # (4, grid_size, N) = (4, 45624, 9) for C6H6. | |||
if opts.ao_threshold is not None: | |||
if opts.ao_threshold > 0.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like the simplicity: we just pre-process remove and only change grid_size so exchange_correlation code remains the same!
b26931d
to
cd2b2d5
Compare
When
ao_threshold
arg is specified, it reduces the grid size, if any slices along this axis are all zeros. The reduced grid_size applies togrid_AO
,grid_coords
, andgrid_weights
.