Skip to content

Commit

Permalink
More missing functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Jan 12, 2025
1 parent e62dcb4 commit 7769294
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/ITensors.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
module ITensors

using TensorAlgebra: contract
using ITensorBase: ITensor, Index, addtags, tags
using ITensorBase: ITensor, Index, addtags, prime, tags

# Quirks, decide where or if to define.
using ITensorBase: dag, dim, hasqns, inds, itensor

include("SiteTypes/SiteTypes.jl")
using .SiteTypes: SiteTypes
include("LazyApply/LazyApply.jl")
using .LazyApply: LazyApply
include("Ops/Ops.jl")
using .Ops: Ops

# Quirks, decide where or if to define.
using ITensorBase: dag, dim, hasqns

# TODO: Used in `ITensorMPS.jl`, define in `BackendSelection.jl`.
struct Algorithm{algname} end
macro Algorithm_str(algname)
return :(Algorithm{$(Expr(:quote, Symbol(algname)))})
end

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

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

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

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

# TODO: Used in `ITensorMPS.jl`, define in `ITensorBase.jl`.
# function addtags end
function addtags! end
function commonind end
function commoninds end
function noprime end
function noprime! end
function prime end
function prime! end
function removetags end
function removetags! end
function replaceprime end
function replaceprime! end
function replacetags end
function replacetags! end
function setprime end
function setprime! end
function settags end
function settags! end
function sim end
function swapprime end
function swapprime! end
function uniqueind end
function uniqueinds end

# TODO: Delete these in-place versions, only define
# them in `ITensorMPS.jl`.
function addtags! end
function noprime! end
function prime! end
function removetags! end
function replaceprime! end
function replacetags! end
function setprime! end
function settags! end
function swapprime! end

end
4 changes: 4 additions & 0 deletions src/SiteTypes/sitetype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ end

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

function commontags(i::Index...)
return union(tags.(i)...)
end

"""
op(opname::String, s::Index; kwargs...)
Expand Down

0 comments on commit 7769294

Please sign in to comment.