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

Sparse to dense conversion API #344

Open
3 of 5 tasks
mtfishman opened this issue May 4, 2020 · 2 comments
Open
3 of 5 tasks

Sparse to dense conversion API #344

mtfishman opened this issue May 4, 2020 · 2 comments
Assignees
Labels
api Issues related to the interface enhancement New feature or request qns QN related issue
Milestone

Comments

@mtfishman
Copy link
Member

mtfishman commented May 4, 2020

It would be good to think about the interface for converting from sparse ITensor types to Dense, or other less sparse types where it makes sense. It would be good to have the following operations, with some proposed names:

Convert to Dense:

  • Diag -> Dense (dense)
  • BlockSparse -> Dense (dense, removeqns) (dense is implemented but not removeqns)
  • DiagBlockSparse -> Dense (dense)

Convert to Diag:

  • DiagBlockSparse -> Diag (diag, removeqns)

Convert to BlockSparse:

  • DiagBlockSparse -> BlockSparse (denseblocks)

Right now, I believe all of the dense conversion functions are implemented (but none of the others are).

@mtfishman
Copy link
Member Author

Also on a related note, it would be nice to have a function that acts like removeqns but within NDTensors, perhaps called removeblocks. This would do the conversions:

  • BlockSparse -> Dense
  • DiagBlockSparse -> Diag

This will be useful for generic code, since then removeqns(::ITensor) can just call removeblocks(::Tensor).

@emstoudenmire
Copy link
Collaborator

I think these names and concepts are all great. It’s a good distinction to make that removing QNs doesn’t necessarily mean going all the way to dense storage, because there may be other kinds of sparsity involved like diagonal sparsity. If we find a good application (data science?) of general sparsity that will be another situation that can be composed with block sparsity too.

If we do need better names later, we can always make them synonyms for some of these (soft deprecation).

@mtfishman mtfishman self-assigned this Oct 8, 2020
@mtfishman mtfishman added api Issues related to the interface enhancement New feature or request qns QN related issue labels Oct 8, 2020
@mtfishman mtfishman added this to the v0.3 milestone Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the interface enhancement New feature or request qns QN related issue
Projects
None yet
Development

No branches or pull requests

2 participants