Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Kloss committed Jan 30, 2024
1 parent 976aa22 commit fefc66a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/treetensornetworks/projttns/abstractprojttn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Base.size(P::AbstractProjTTN)::Tuple{Int,Int}
return (d, d)
end

function position( P::AbstractProjTTN, psi::AbstractTTN, pos)
function position(P::AbstractProjTTN, psi::AbstractTTN, pos)
P = shift_position(P, pos)
P = invalidate_environments(P)
P = make_environments(P, psi)
Expand Down
6 changes: 2 additions & 4 deletions src/treetensornetworks/projttns/projttn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,13 @@ function shift_position(P::ProjTTN, pos)
end

set_environments(p::ProjTTN, environments) = ProjTTN(pos(p), operator(p), environments)
set_environment(p::ProjTTN, edge, env)=set_environment!(copy(p),edge,env)
set_environment(p::ProjTTN, edge, env) = set_environment!(copy(p), edge, env)
function set_environment!(p::ProjTTN, edge, env)
set!(environments(p), edge, env)
return p
end

function make_environment(
P::ProjTTN, state::AbstractTTN, e::AbstractEdge
)
function make_environment(P::ProjTTN, state::AbstractTTN, e::AbstractEdge)
# invalidate environment for opposite edge direction if necessary
reverse(e) incident_edges(P) || (P = invalidate_environment(P, reverse(e)))
# do nothing if valid environment already present
Expand Down
4 changes: 1 addition & 3 deletions src/treetensornetworks/projttns/projttn_apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ function set_environment!(p::ProjTTNApply, edge, env)
return p
end

function make_environment(
P::ProjTTNApply, state::AbstractTTN, e::AbstractEdge
)
function make_environment(P::ProjTTNApply, state::AbstractTTN, e::AbstractEdge)
# invalidate environment for opposite edge direction if necessary
reverse(e) incident_edges(P) || (P = invalidate_environment(P, reverse(e)))
# do nothing if valid environment already present
Expand Down

0 comments on commit fefc66a

Please sign in to comment.