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] Add a debug check that sets of Index are unique #415

Open
mtfishman opened this issue Jun 4, 2020 · 0 comments
Open

[ITensors] Add a debug check that sets of Index are unique #415

mtfishman opened this issue Jun 4, 2020 · 0 comments
Assignees
Labels
error messages Issues related to improving error messages. indexset Issues related to IndexSets.
Milestone

Comments

@mtfishman
Copy link
Member

mtfishman commented Jun 4, 2020

Right now, this is allowed, even in debug mode:

julia> i = Index(2)
(dim=2|id=241)

julia> is = IndexSet(i, i)
IndexSet{2} (dim=2|id=241) (dim=2|id=241) 

julia> ENV["JULIA_DEBUG"] = "ITensors"
"ITensors"

julia> is = IndexSet(i, i)
IndexSet{2} (dim=2|id=241) (dim=2|id=241) 

This could be done in the IndexSet constructor, with the Julia function allunique, i.e. just add @debug allunique(data) || error("Indices must all be unique in IndexSet") here.

@mtfishman mtfishman self-assigned this Oct 8, 2020
@mtfishman mtfishman added error messages Issues related to improving error messages. indexset Issues related to IndexSets. labels Oct 8, 2020
@mtfishman mtfishman added this to the v0.3 milestone Oct 8, 2020
@mtfishman mtfishman reopened this Apr 29, 2024
@mtfishman mtfishman changed the title Add a debug check that all Indices in an IndexSet are unique [ITensors] Add a debug check that sets of Index are unique Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Issues related to improving error messages. indexset Issues related to IndexSets.
Projects
None yet
Development

No branches or pull requests

1 participant