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

Implementation of EquivariantPowerSpectrum and EquivariantPowerSpectrumByPair convenience calculators #317

Closed
wants to merge 15 commits into from

Conversation

jwa7
Copy link
Collaborator

@jwa7 jwa7 commented Jul 4, 2024

Implements:

  1. a lambda-SOAP (i.e. EquivariantPowerSpectrum) calculator that wraps DensityCorrelations
  2. a CorrelateTensorWithDensity calculator that performs a single CG tensor product between a tensor of arbitrary body order and a density (body-order 2) tensor, where the samples between the tensor and density are different.
  3. a EquivariantPowerSpectrumByPair calculator, which generates a SphericalExpansion and SphericalExpansionByPair, manipulates the metadata appropriately, then uses CorrelateTensorWithDensity calculator to perform rho_i x g_ij to generate an Equivariant power spectrum by pair

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

Copy link

github-actions bot commented Jul 4, 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

Copy link
Owner

@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 only looked at naming! One other thing that we could do here would be SoapBiSpectrum, for the invariant only-part

# ======================================================================


class LambdaSoap(TorchModule):
Copy link
Owner

Choose a reason for hiding this comment

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

I think I would prefer something like LambdaPowerSpectrum/LambdaSoapPowerSpectrum/EquivariantPowerSpectrum/EquivariantSoapPowerSpectrum

I'm fighting against the SOAP == PowerSpectrum thinking, and making this explicit would help IMO

self,
spherical_expansion_hypers: dict,
atom_types: Optional[List[int]] = None,
angular_cutoff: Optional[int] = None,
Copy link
Owner

Choose a reason for hiding this comment

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

do we really want this as a separate hyper for angular cutoff? Should we use the one from spx hypers instead?

spherical_expansion_hypers: dict,
atom_types: Optional[List[int]] = None,
angular_cutoff: Optional[int] = None,
selected_keys: Optional[Labels] = None,
Copy link
Owner

Choose a reason for hiding this comment

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

this should be part of compute/forward: different calls to the same calculator might request different keys

return lsoap


class LambdaSoapXSphExByPair(TorchModule):
Copy link
Owner

Choose a reason for hiding this comment

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

This is \rho^2 x g_ij, right? since g_ij is SphericalExpansionByPair, this should be BispectrumByPair IMO (with potential Lambda, Soap, Equivariant in there as well).

@jwa7 jwa7 changed the title Implementation of LambdaSoap and LambdaSoapXSphExByPair convenience calculators Implementation of EquivariantPowerSpectrum and EquivariantPowerSpectrumByPair convenience calculators Jul 9, 2024
@jwa7 jwa7 closed this Sep 19, 2024
@Luthaf Luthaf deleted the pi_x_gij branch October 10, 2024 10:23
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.

3 participants