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

[ITensors] [ENHANCEMENT] Sparse output for onehot #1333

Open
stuartthomas25 opened this issue Feb 9, 2024 · 1 comment
Open

[ITensors] [ENHANCEMENT] Sparse output for onehot #1333

stuartthomas25 opened this issue Feb 9, 2024 · 1 comment
Labels
enhancement New feature or request ITensors Issues or pull requests related to the `ITensors` package.

Comments

@stuartthomas25
Copy link

The onehot function currently outputs a dense tensor which is not very efficient to contract. Ideally, this function would output an ITensor with sparse storage.

It seems like there is not yet an NDTensor TensorStorage type which implements a sparse array though I see that there is movement in overhauling the TensorStorage system (#1250).

@stuartthomas25 stuartthomas25 added enhancement New feature or request ITensors Issues or pull requests related to the `ITensors` package. labels Feb 9, 2024
@mtfishman
Copy link
Member

mtfishman commented Feb 9, 2024

Yes, we are doing a complete rewrite of NDTensors which will replace the Tensor type and TensorStorage types. The new design will include a general elementwise SparseArrayDOK type (using a dictionary-of-keys format), a new BlockSparseArray type, a new DiagonalArray type, along with better support for array slicing of all of those types. With better support for slicing it would mitigate the need for onehot in the first place, since slicing is the main use case for it. The plan would be to base onehot on SparseArrayDOK or the OneElement type from FillArrays.jl and use slicing under the hood for tensor contraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ITensors Issues or pull requests related to the `ITensors` package.
Projects
None yet
Development

No branches or pull requests

2 participants