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

[NDTensors] Create a new KeyOperations library #1328

Open
mtfishman opened this issue Feb 5, 2024 · 1 comment
Open

[NDTensors] Create a new KeyOperations library #1328

mtfishman opened this issue Feb 5, 2024 · 1 comment
Labels
enhancement New feature or request NDTensors Requires changes to the NDTensors.jl library.

Comments

@mtfishman
Copy link
Member

Create a new KeyOperations library that defines functions like:

  • keysort
  • keyunion
  • keyintersect
  • keysetdiff
  • keysymdiff

for dictionary-like objects, such as Base.NamedTuple, Base.Dict, and Dictionaries.Dictionary (which could be implemented in a package extension KeyOperationsDictionariesExt).

Some of this was already started as part of the Sectors library to help implement fusion of CategoryProducts that have named categories, though with names like sort_keys, union_keys, etc. (see https://github.com/ITensor/ITensors.jl/blob/v0.3.55/NDTensors/src/lib/Sectors/src/namedtuple_operations.jl).

Some related discussions in the Julia ecosystem:

@emstoudenmire

@mtfishman mtfishman added enhancement New feature or request NDTensors Requires changes to the NDTensors.jl library. labels Feb 5, 2024
@emstoudenmire
Copy link
Collaborator

Great – I was really interested to see how the named tuples in Julia can actually function as a very fast, heterogeneous dictionary. That makes them a very powerful datatype to have, but of course the interface could be nicer for using them in this way and more fleshed out. So this PR should help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request NDTensors Requires changes to the NDTensors.jl library.
Projects
None yet
Development

No branches or pull requests

2 participants