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

Support Ellipsis in indices? #119

Open
yhtang opened this issue Dec 30, 2021 · 3 comments
Open

Support Ellipsis in indices? #119

yhtang opened this issue Dec 30, 2021 · 3 comments
Assignees
Labels

Comments

@yhtang
Copy link
Owner

yhtang commented Dec 30, 2021

Is your feature request related to a problem? Please describe.
Right now, users have to explicitly provide all the indices to perform Einstein operations. In cases where simple broadcasting is obvious, it might be more convenient to allow ellipsis indexing. numpy.einsum already supports this in the einspec strings.

Describe the solution you'd like

a = ff.tensor('a', 3, 2, 3, 4)
b = ff.tensor('b', 3, 2, 4, 6)
# current
i, j, k, r, s = ff.indices('i, j, k, r, s')
a[~i, ~j, k, r] * b[~i, ~j, r, s]
# proposed
i, j, k = ff.indices('i, j, k')
a[..., i, j] * b[..., j, k]
@yhtang yhtang added this to the V1.0 milestone Dec 30, 2021
@yhtang
Copy link
Owner Author

yhtang commented Dec 30, 2021

A possible approach to implement it would be to introduce a special value for the indices AST primitive, and then rewrite it using lhs&rhs information in the __call__ of the new index propagator.

@yhtang yhtang linked a pull request Jan 7, 2022 that will close this issue
@campsd campsd added the backlog label Jan 7, 2022
@campsd campsd removed this from the V1.0 milestone Jan 25, 2022
@yhtang yhtang added priority and removed backlog labels Feb 13, 2022
@campsd
Copy link
Collaborator

campsd commented Feb 18, 2022

Continued the discussion here @yhtang

@yhtang
Copy link
Owner Author

yhtang commented Mar 17, 2022

Per discussion with @campsd, it might be better to collect more usage scenarios before deciding on to what extent should this feature be supported.

@yhtang yhtang removed the wip Work in progress label Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants