Skip to content

Commit 283a2b4

Browse files
committed
Fix state constructor, include definition of permute
1 parent 79ff014 commit 283a2b4

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/ITensors.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ using ITensorBase:
1010
commonind,
1111
commoninds,
1212
inds,
13+
noprime,
1314
plev,
1415
prime,
1516
tags,
1617
uniqueind,
1718
uniqueinds
1819

1920
# Quirks, decide where or if to define.
20-
using ITensorBase: dag, dim, factorize, hasqns, itensor, onehot
21+
using ITensorBase: OneITensor, dag, dim, factorize, hasqns, itensor, onehot, order, permute
2122

2223
include("SiteTypes/SiteTypes.jl")
2324
using .SiteTypes: SiteTypes
@@ -46,14 +47,10 @@ end
4647
# constructing a set of tags.
4748
macro ts_str(tags) end
4849

49-
# TODO: Used in `ITensorMPS.jl`, decide where or if to define it.
50-
struct OneITensor end
51-
5250
# TODO: Used in `ITensors.SiteTypes`, need to define.
5351
function product end
5452

5553
# TODO: Used in `ITensorMPS.jl`, define in `ITensorBase.jl`.
56-
function noprime end
5754
function removetags end
5855
function replaceprime end
5956
function replacetags end

src/SiteTypes/sitetype.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,14 @@ function state(s::Index, name::AbstractString; kwargs...)::ITensor
609609
end
610610
end
611611

612-
# Try calling state!(::ITensor,::StateName"Name",::SiteType"Tag",s::Index;kwargs...)
613-
T = ITensor(s)
614-
for st in stypes
615-
state!(T, sname, st, s; kwargs...)
616-
!isempty(T) && return T
617-
end
612+
## TODO: Bring this back, it is broken right now.
613+
## `isempty` isn't the correct function, it should use `isallocated`.
614+
## # Try calling state!(::ITensor,::StateName"Name",::SiteType"Tag",s::Index;kwargs...)
615+
## T = ITensor(s)
616+
## for st in stypes
617+
## state!(T, sname, st, s; kwargs...)
618+
## !isempty(T) && return T
619+
## end
618620

619621
#
620622
# otherwise try calling a function of the form:

0 commit comments

Comments
 (0)