Skip to content

Bug in noncommonind #512

@mtfishman

Description

@mtfishman

The function noncommonind(A::ITensor, B::ITensor) for getting a single Index that is unique to A errors:

julia> i = Index(2, "i")
(dim=2|id=902|"i")

julia> A = randomITensor(i, i')
ITensor ord=2 (dim=2|id=902|"i") (dim=2|id=902|"i")'
NDTensors.Dense{Float64,Array{Float64,1}}

julia> B = randomITensor(i', i'')
ITensor ord=2 (dim=2|id=902|"i")' (dim=2|id=902|"i")''
NDTensors.Dense{Float64,Array{Float64,1}}

julia> noncommoninds(A, B)
IndexSet{2} (dim=2|id=902|"i") (dim=2|id=902|"i")'' 

julia> noncommonind(A, B)
ERROR: MethodError: no method matching getfirst(::Array{Index{Int64},1})
Closest candidates are:
  getfirst(::IndexSet) at /home/mfishman/.julia/packages/ITensors/ka3Bv/src/indexset.jl:742
[...]

Also, noncommoninds does not properly accept keyword arguments:

julia> noncommoninds(A, B; plev = 0)
ERROR: MethodError: no method matching symdiff(::IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, ::IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}; plev=0)
Closest candidates are:
  symdiff(::Any, ::Any...) at abstractset.jl:214 got unsupported keyword argument "plev"

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingindexsetIssues related to IndexSets.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions