Skip to content

CGs: introduce general TensorCorrelator and refactor DensityCorrelations #316

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

Closed
wants to merge 16 commits into from

Conversation

jwa7
Copy link
Member

@jwa7 jwa7 commented Jul 3, 2024

Some changes:

  1. Add a keep_l_in_keys parameter for the DensityCorrelations calculator. This defaults to false, maintaining the previous behaviour. This makes it easier to write the pair correlator as l_{x} and k_{x} combination info needs to be kept in the keys for further CG tensor products. While this adds complexity to DensityCorrelations, the idea is for this complexity to in the end be wrapped by higher-level, more specific calculators (i.e. a lambda-SOAP calculator), such that the normal user doesn't need to worry about complex metadata things like this.
  2. body_order replaces correlation_order as the parameter in DensityCorrelations. "body_order" as a key dimension is returned in the output TensorMaps, as this is also useful to know for a general CG tensor product. Since we don't yet have global metadata, keeping it in keys is best for now.
  3. A match_keys argument has also been added, and the core routines that precompute tensor products of keys metadata have been modified. Internally, the keys metadata dimensions are categorised into 'standard' (i.e. order_nu, o3_lambda, o3_sigma), 'CG combination' (i..e the l and k lists), and 'other' key names. Standard and combination dimensions are handled as usual, but the other dimensions are either matched (based on match_keys argument) or fully multiplied.
  4. Arbitrary properties dimensions are now handled. Previously, the function assumes that (and handles by hard-coding) only "neighbor_type" and "n" properties dimensions are present in the TensorBlocks being combined. Now, arbitrary properties can be combined. The requirement is that the properties dimension names are different between the two blocks being combined. Property renaming is then handled by the wrapping method _correlate_density of DensityCorrelations. Properties of the arbitrary body order tensor are named (i.e. for radial channels) "n_1", "n_2", ..., "n_{nu - 1}", and the nu=1 tensor being combined on the current iteration is renamed so that its property dimension is "n_{nu}". Suffixing with "_{x}" is chosen and applied generically, except for dimensions suffixed with "type", i.e. "neighbor_type" becomes "neighbor{x}_type".

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

@jwa7 jwa7 added the Python Issues related to the Python API label Jul 3, 2024
@jwa7 jwa7 requested a review from Luthaf July 3, 2024 11:14
@jwa7 jwa7 changed the title Minor changes to metadata structure in DensityCorrelations Add keep_l_in_keys param to DensityCorrelations, and keep "order_nu" keys dimension Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 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 requested a review from Luthaf July 3, 2024 11:29
@jwa7 jwa7 changed the title Add keep_l_in_keys param to DensityCorrelations, and keep "order_nu" keys dimension Modifications to DensityCorrelations Jul 4, 2024
@jwa7 jwa7 changed the title Modifications to DensityCorrelations CGs: introduce general TensorCorrelator and refactor DensityCorrelations Jul 17, 2024
@jwa7 jwa7 marked this pull request as draft July 17, 2024 11:59
@Luthaf
Copy link
Member

Luthaf commented Sep 19, 2024

Should this be closed?

@jwa7 jwa7 closed this Sep 19, 2024
@jwa7 jwa7 deleted the pairs branch September 19, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Issues related to the Python API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants