Skip to content

Commit 7769294

Browse files
committed
More missing functionality
1 parent e62dcb4 commit 7769294

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

src/ITensors.jl

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
module ITensors
22

33
using TensorAlgebra: contract
4-
using ITensorBase: ITensor, Index, addtags, tags
4+
using ITensorBase: ITensor, Index, addtags, prime, tags
5+
6+
# Quirks, decide where or if to define.
7+
using ITensorBase: dag, dim, hasqns, inds, itensor
8+
59
include("SiteTypes/SiteTypes.jl")
610
using .SiteTypes: SiteTypes
711
include("LazyApply/LazyApply.jl")
812
using .LazyApply: LazyApply
913
include("Ops/Ops.jl")
1014
using .Ops: Ops
1115

12-
# Quirks, decide where or if to define.
13-
using ITensorBase: dag, dim, hasqns
14-
1516
# TODO: Used in `ITensorMPS.jl`, define in `BackendSelection.jl`.
1617
struct Algorithm{algname} end
1718
macro Algorithm_str(algname)
1819
return :(Algorithm{$(Expr(:quote, Symbol(algname)))})
1920
end
2021

2122
# TODO: Used in `ITensorMPS.jl`, decide where or if to define it.
23+
# Maybe define in `TensorAlgebra.jl`.
2224
function outer end
2325

2426
# TODO: Used in `ITensorMPS.jl`, decide where or if to define it.
@@ -27,34 +29,37 @@ struct Apply{Args}
2729
end
2830

2931
# TODO: Used in `ITensorMPS.jl`, decide where or if to define it.
32+
# Probably define in `ITensorBase.jl` as a shorthand for
33+
# constructing a set of tags.
3034
macro ts_str(tags) end
3135

3236
# TODO: Used in `ITensorMPS.jl`, decide where or if to define it.
3337
struct OneITensor end
3438

3539
# TODO: Used in `ITensorMPS.jl`, define in `ITensorBase.jl`.
36-
# function addtags end
37-
function addtags! end
3840
function commonind end
3941
function commoninds end
4042
function noprime end
41-
function noprime! end
42-
function prime end
43-
function prime! end
4443
function removetags end
45-
function removetags! end
4644
function replaceprime end
47-
function replaceprime! end
4845
function replacetags end
49-
function replacetags! end
5046
function setprime end
51-
function setprime! end
5247
function settags end
53-
function settags! end
5448
function sim end
5549
function swapprime end
56-
function swapprime! end
5750
function uniqueind end
5851
function uniqueinds end
5952

53+
# TODO: Delete these in-place versions, only define
54+
# them in `ITensorMPS.jl`.
55+
function addtags! end
56+
function noprime! end
57+
function prime! end
58+
function removetags! end
59+
function replaceprime! end
60+
function replacetags! end
61+
function setprime! end
62+
function settags! end
63+
function swapprime! end
64+
6065
end

src/SiteTypes/sitetype.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ end
194194

195195
_sitetypes(i::Index) = _sitetypes(tags(i))
196196

197+
function commontags(i::Index...)
198+
return union(tags.(i)...)
199+
end
200+
197201
"""
198202
op(opname::String, s::Index; kwargs...)
199203

0 commit comments

Comments
 (0)