From fefc66af91378ae8436cc2436c60edb7e524669b Mon Sep 17 00:00:00 2001 From: Benedikt Kloss Date: Tue, 30 Jan 2024 17:46:59 -0500 Subject: [PATCH] Format. --- src/treetensornetworks/projttns/abstractprojttn.jl | 2 +- src/treetensornetworks/projttns/projttn.jl | 6 ++---- src/treetensornetworks/projttns/projttn_apply.jl | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/treetensornetworks/projttns/abstractprojttn.jl b/src/treetensornetworks/projttns/abstractprojttn.jl index b67ca949..9ac91acf 100644 --- a/src/treetensornetworks/projttns/abstractprojttn.jl +++ b/src/treetensornetworks/projttns/abstractprojttn.jl @@ -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) diff --git a/src/treetensornetworks/projttns/projttn.jl b/src/treetensornetworks/projttns/projttn.jl index a7aa4404..725650b2 100644 --- a/src/treetensornetworks/projttns/projttn.jl +++ b/src/treetensornetworks/projttns/projttn.jl @@ -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 diff --git a/src/treetensornetworks/projttns/projttn_apply.jl b/src/treetensornetworks/projttns/projttn_apply.jl index 3f38d2a0..62b0215a 100644 --- a/src/treetensornetworks/projttns/projttn_apply.jl +++ b/src/treetensornetworks/projttns/projttn_apply.jl @@ -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