Skip to content

Commit

Permalink
Further renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyT1994 committed Nov 3, 2024
1 parent 23c085f commit f0e8bf5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/abstractitensornetwork.jl
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,12 @@ function LinearAlgebra.factorize(tn::AbstractITensorNetwork, edge::Pair; kwargs.
end

# For ambiguity error; TODO: decide whether to use graph mutating methods when resulting graph is unchanged?
function orthogonalize_edge(tn::AbstractITensorNetwork, edge::AbstractEdge; kwargs...)
function orthogonalize_path(tn::AbstractITensorNetwork, edge::AbstractEdge; kwargs...)
return orthogonalize_path(tn, [edge]; kwargs...)
end

function orthogonalize_edge(tn::AbstractITensorNetwork, edge::Pair; kwargs...)
return orthogonalize_edge(tn, edgetype(tn)(edge); kwargs...)
function orthogonalize_path(tn::AbstractITensorNetwork, edge::Pair; kwargs...)
return orthogonalize_path(tn, edgetype(tn)(edge); kwargs...)
end

# For ambiguity error; TODO: decide whether to use graph mutating methods when resulting graph is unchanged?
Expand Down Expand Up @@ -620,13 +620,29 @@ end
# TODO: Rename `tree_orthogonalize`.
function ITensorMPS.orthogonalize::AbstractITensorNetwork, region::Vector)
spanning_tree_edges = post_order_dfs_edges_region(bfs_tree(ψ, first(region)), region)
return orthogonalize(ψ, spanning_tree_edges)
return orthogonalize_path(ψ, spanning_tree_edges)
end

function ITensorMPS.orthogonalize::AbstractITensorNetwork, region)
return orthogonalize(ψ, [region])
end

function ITensorMPS.orthogonalize::AbstractITensorNetwork, edges::Vector{<:AbstractEdge})
return orthogonalize(ψ, unique(vcat([src(e) for e in edges], [dst(e) for e in edges])))
end

function ITensorMPS.orthogonalize::AbstractITensorNetwork, edges::Vector{<:Pair})
return orthogonalize(ψ, edgetype(ψ).(edges))
end

function ITensorMPS.orthogonalize::AbstractITensorNetwork, edge::AbstractEdge)
return orthogonalize(ψ, [edge])
end

function ITensorMPS.orthogonalize::AbstractITensorNetwork, edge::Pair)
return orthogonalize(ψ, edgetype(ψ)(edge))
end

# TODO: decide whether to use graph mutating methods when resulting graph is unchanged?
function _truncate_edge(tn::AbstractITensorNetwork, edge::AbstractEdge; kwargs...)
tn = copy(tn)
Expand Down

0 comments on commit f0e8bf5

Please sign in to comment.