Skip to content

Clebsch-Gordan correlate_tensors method#266

Closed
jwa7 wants to merge 5 commits intomasterfrom
cg_correlate
Closed

Clebsch-Gordan correlate_tensors method#266
jwa7 wants to merge 5 commits intomasterfrom
cg_correlate

Conversation

@jwa7
Copy link
Member

@jwa7 jwa7 commented Dec 19, 2023

Following on from PR #237, and completes a TODO item in #239 , the next public API function implemented is the correlate_tensors method. This takes two arbitrary TensorMaps and performs a single Clebsch-Gordan tensor product. The function correlate_density previously implemented in #237, is a special case of this method, used to correlate a density descriptor with itself.

As this is the general case, the method cannot take computational shortcuts as in correlate_density. As such, the public API function signature is simplified to:

def correlate_tensors(
    tensor_1: TensorMap,
    tensor_2: TensorMap,
    selected_keys: Optional[Union[Labels, List[Labels]]] = None,
) -> TensorMap:

where arg selected_keys controls the output of angular and parity channels, and therefore the block combinations performed.

Other Changes

  • Unit tests sped up by reducing parametrization and lowering max angular/radial channels of input hypers re @Luthaf comment in Future directions for CG iterations #239
  • Breaking change to correlate_density: TensorMaps are now returned with the "order_nu" and "inversion_sigma" key dimensions, even if they are not sparse (i.e. redundant). This metadata should be carried around to allow passing of TensorMaps to CG functions that require it (i.e. correlate_tensors), and can always be easily removed by the user if they wish. Once TensorMaps can be tagged with global (i.e. non-sparse) metadata, they will be moved there (another breaking change, for the future)

@jwa7 jwa7 self-assigned this Dec 19, 2023
@jwa7 jwa7 mentioned this pull request Dec 20, 2023
10 tasks
@github-actions
Copy link

github-actions bot commented Dec 20, 2023

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 closed this Jul 17, 2024
@jwa7 jwa7 deleted the cg_correlate branch July 17, 2024 12:03
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.

1 participant