Skip to content

Commit a4b41c5

Browse files
committed
Fix example
1 parent 6c7b1c7 commit a4b41c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/README.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ julia> Pkg.add("ITensorBase")
2020
# ## Examples
2121

2222
using ITensorBase: ITensorBase, ITensor, Index
23-
# TODO: This should be `TensorAlgebra.qr`.
2423
using LinearAlgebra: qr
25-
using NamedDimsArrays: NamedDimsArray, aligndims, dimnames, name, unname
24+
using NamedDimsArrays: aligndims, unname
2625
using Test: @test
2726
i = Index(2)
2827
j = Index(2)

src/ITensorBase.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const Tag = String
2525
const TagSet = Set{Tag}
2626

2727
tagset(tags::String) = Set(filter(!isempty, String.(strip.(split(tags, ",")))))
28+
tagset(tags::TagSet) = tags
2829

2930
function tagsstring(tags::TagSet)
3031
str = ""
@@ -80,7 +81,7 @@ struct Index{T,Value<:AbstractUnitRange{T}} <: AbstractNamedUnitRange{T,Value,In
8081
name::IndexName
8182
end
8283

83-
function Index(length::Int; tags, kwargs...)
84+
function Index(length::Int; tags=TagSet(), kwargs...)
8485
return Index(Base.OneTo(length), IndexName(; tags=tagset(tags), kwargs...))
8586
end
8687
function Index(length::Int, tags::String; kwargs...)

0 commit comments

Comments
 (0)