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

Implement a Scalar type? #13

Open
Jakob-Unfried opened this issue Nov 17, 2024 · 0 comments
Open

Implement a Scalar type? #13

Jakob-Unfried opened this issue Nov 17, 2024 · 0 comments

Comments

@Jakob-Unfried
Copy link
Member

Jakob-Unfried commented Nov 17, 2024

Strategy

class Scalar(SymmetricTensor):
    # a tensor with no legs, i.e.~a scalar
    codomain = []
    domain = []
    ...

Reasoning

  • Should be able to deal with backend-specific scalars (e.g. numpy scalar, torch scalar).
    In particular, should be able to have the scalars on GPU, so we dont need to sync hardware just to do e.g.
    S = S / tensors.norm(S)
  • Packaging scalars in a tensor class allows a consistent and backend-agnostic interface (e.g. dont need to import torch to do conj)
@Jakob-Unfried Jakob-Unfried self-assigned this Nov 17, 2024
@Jakob-Unfried Jakob-Unfried changed the title how to handle scalars? e.g. 0D torch tensors? Implement a Scalar type? Nov 17, 2024
@Jakob-Unfried Jakob-Unfried removed their assignment Dec 16, 2024
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

No branches or pull requests

2 participants