Skip to content

CG utils: implement ClebschGordanProduct and refactor DensityCorrelations #318

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

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

jwa7
Copy link
Member

@jwa7 jwa7 commented Jul 17, 2024

Implements a general TensorCorrelator class and refactors DensityCorrelations to be built on top of this. The former allows the CG tensor product of two arbitrary TensorMaps (under some constraints, mostly to do with the metadata structure as explained in the class documentation), while the latter is a convenience class specifically for computing iterative density auto-correlations.

Closes #312


📚 Documentation preview 📚: https://rascaline--318.org.readthedocs.build/en/318/

@jwa7 jwa7 requested a review from Luthaf July 17, 2024 11:41
Copy link

github-actions bot commented Jul 17, 2024

Here is a pre-built version of the code in this pull request: wheels.zip, you can install it locally by unzipping wheels.zip and using pip to install the file matching your system

@jwa7 jwa7 changed the title Implement TensorCorrelator and refactor DensityCorrelations CG utils: implement TensorCorrelator and refactor DensityCorrelations Jul 17, 2024
Copy link
Member

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new TensorCorrelator, but I'm still not convinced by having a single DensityCorrelations for both self- and cross-correlations.

I would split it into something like SelfCorrelator and CrossCorrelator, maybe renaming TensorCorrelator to ClebschGordanProduct?

@jwa7
Copy link
Member Author

jwa7 commented Jul 18, 2024

I somewhat agree with splitting DensityCorrelations, but think its name should still point to the fact that these are density correlations (which is important for what it's actually doing). So I'd suggest DensitySelfCorrelations DensityCrossCorrelations.

And to be fair, thinking about it, I'm not sure DensityCrossCorrelations is even useful. An EquivariantTriSpectrumByPair (for instance) is p_i x p_i x p_i x p_ij, i.e. TensorCorrelator(DensitySelfCorrelations(p_i, n_correlations=2), p_ij), right?

There isn't a use case where doing density cross correlations is actually useful, because the building block is an arbitrary body order density auto-correlation, which is then correlated with a different density (or something else).

@jwa7
Copy link
Member Author

jwa7 commented Jul 18, 2024

So instead I think DensityCorrelations can just stay as being named like this, and the API changed to only accept a single density (not tensor and density), with the skip_redundant parameter having a single meaning where it is always valid.

DensityCorrelations then collapses back to what it always was before, a convenient way to compute density auto-correlations to arbitrary correlation order.

@Luthaf
Copy link
Member

Luthaf commented Jul 22, 2024

So instead I think DensityCorrelations can just stay as being named like this, and the API changed to only accept a single density (not tensor and density), with the skip_redundant parameter having a single meaning where it is always valid.

That sounds good to me!

@jwa7 jwa7 requested a review from Luthaf September 9, 2024 22:12
@Luthaf Luthaf changed the title CG utils: implement TensorCorrelator and refactor DensityCorrelations CG utils: implement ClebschGordanProduct and refactor DensityCorrelations Sep 18, 2024
@Luthaf Luthaf merged commit a4d7247 into master Sep 19, 2024
25 checks passed
@Luthaf Luthaf deleted the tensor_corr branch September 19, 2024 09:53
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.

clebsch_gordan: extend what can be passed to selected_keys
2 participants