Skip to content

Conversation

@adrn
Copy link
Collaborator

@adrn adrn commented Aug 13, 2025

I think most potential methods should have a default time value so that you can call, e.g.,

pot.gradient(xyz)

without having to specify a time.

I marked this as a WIP because I'm not sure this is the best path, but here is one possible implementation. I added new dispatches with default values and added a global definition of the default time value (0 - does any other time make sense??).

A few things to consider / still need to be done:

  • Should this only be allowed on static potentials? If so, we need to add some easily JIT-able way of detecting whether a potential is static or has time-dependent parameters.
  • The default time is currently a Quantity, but it should really be a dimensionless value. The only default times I think are worth discussing are 0, inf, -inf, or nan. Probably only 0 makes sense. None of them need to have a unit attached.

@adrn adrn requested a review from nstarman August 13, 2025 00:43
@nstarman
Copy link
Contributor

I really like this. I wonder if this isn't related to the discussion about having xyz work with a scalar r if it's spherically symmetric... We discussed some kind of MD or flag or something. I recall there being difficulties with optimizing this for JIT...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants