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

fix sh l=0 #49

Merged
merged 4 commits into from
Dec 19, 2024
Merged

fix sh l=0 #49

merged 4 commits into from
Dec 19, 2024

Conversation

mariogeiger
Copy link
Collaborator

@mariogeiger mariogeiger commented Dec 18, 2024

Since now cuequivariance_ops_torch.SymmetricTensorContraction supports STP of degree 0 we can simplify the code by removing the special case for degree 0 in cuet.SymmetricTensorProduct

import cuequivariance_ops_torch as ops
import torch

f = ops.SymmetricTensorContraction(
    [
        [0, 0],  # degree 0 (was not supported before)
        [0, 0, 1],  # degree 1
        [0, 0, 0, 2],  # degree 2
    ],
    [
        5.0,
        1.0,
        1.0,
    ],
    num_in_segments=1,
    num_couplings=1,
    num_out_segments=3,
    correlation=2,
    math_dtype=torch.float32,
).to(device="cuda")
f(
    torch.tensor([[[2.0]]], device="cuda"),  # input
    torch.tensor([[[2.0]]], device="cuda"),  # coupling
    torch.tensor([0], device="cuda", dtype=torch.int32),
)

@mariogeiger mariogeiger changed the title fix sh l=1 fix sh l=0 Dec 18, 2024
@mariogeiger mariogeiger requested a review from borisfom December 18, 2024 12:22
Copy link
Collaborator

@moradza moradza left a comment

Choose a reason for hiding this comment

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

LGTM!

@mariogeiger mariogeiger merged commit 88e6596 into main Dec 19, 2024
10 checks passed
@mariogeiger mariogeiger deleted the fix-sh-l=0 branch January 13, 2025 22:50
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.

2 participants