Skip to content
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

For all current calculators, implement the option to return only metadata #238

Open
jwa7 opened this issue Sep 28, 2023 · 1 comment
Open
Labels
C / C++ Issues related to the C and C++ API Python Issues related to the Python API

Comments

@jwa7
Copy link
Member

jwa7 commented Sep 28, 2023

In the process of writing a new API for Clebsch Gordan iterations (see PR #237), it became apparent that generating pseudo-outputs of the CG calculation process (whereby TensorMaps with the correct metadata are returned but with no actual CG combinations are performed) is useful.

The input for public functions of the CG API is currently a TensorMap such as a rascaline.SphericalExpansion. Therefore, to calculate the metadata produced by CG iterations, one still needs to calculate the actual SphericalExpansion in the first place. Part of the point of pre-calculating metadata is cheaply see the size of descriptors generated with a given choice of hyperparameters, which isn't necessarily trivial to 'guess', especially when performing CG iterations.

It would therefore be useful if, for all rascaline calculators, one could calculate only the metadata. There may also be benefits when using jax, though with no expertise on this I'll let @Luthaf comment.

@Luthaf Luthaf added Python Issues related to the Python API C / C++ Issues related to the C and C++ API labels Sep 28, 2023
@Luthaf
Copy link
Member

Luthaf commented Sep 28, 2023

Couple of points: we already have code to do this in Rust: https://github.com/Luthaf/rascaline/blob/55ad1f14363812639c865801a6d517d8c5f363f6/rascaline/src/calculator.rs#L288.
We mainly need to expose this code to the C and then Python API.

Regarding jax, it looks like we need to be able to give the output shape of an operation without actually running it when defining custom primitives, cf https://jax.readthedocs.io/en/latest/notebooks/How_JAX_primitives_work.html#abstract-evaluation-rules, the "Abstract Evaluation Rules" section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C / C++ Issues related to the C and C++ API Python Issues related to the Python API
Projects
None yet
Development

No branches or pull requests

2 participants