From 92b0b4a2f062b234df2e089931363e49edbf7667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jofre=20Vall=C3=A8s?= Date: Wed, 13 Mar 2024 16:22:10 +0100 Subject: [PATCH] Replace explicit symbols for gensym(symbol) --- src/Ansatz/Chain.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ansatz/Chain.jl b/src/Ansatz/Chain.jl index b72c456..903f64b 100644 --- a/src/Ansatz/Chain.jl +++ b/src/Ansatz/Chain.jl @@ -315,12 +315,12 @@ function isleftcanonical(qtn::Chain, site; atol::Real = 1e-12) # we are at right-most site, we need to add an extra dummy dimension to the tensor if isnothing(right_ind) - tensor = Tensor(reshape(parent(tensor), size(tensor)..., 1), (inds(tensor)..., :dummy_ind)) - right_ind = :dummy_ind + right_ind = gensym(:dummy) + tensor = Tensor(reshape(parent(tensor), size(tensor)..., 1), (inds(tensor)..., right_ind)) end # TODO is replace(conj(A)...) copying too much? - contracted = contract(tensor, replace(conj(tensor), right_ind => :new_ind_name)) + contracted = contract(tensor, replace(conj(tensor), right_ind => gensym(:new_ind))) n = size(tensor, right_ind) identity_matrix = Matrix(I, n, n) @@ -333,12 +333,12 @@ function isrightcanonical(qtn::Chain, site; atol::Real = 1e-12) # we are at left-most site, we need to add an extra dummy dimension to the tensor if isnothing(left_ind) - tensor = Tensor(reshape(parent(tensor), 1, size(tensor)...), (:dummy_ind, inds(tensor)...)) - left_ind = :dummy_ind + left_ind = gensym(:dummy) + tensor = Tensor(reshape(parent(tensor), 1, size(tensor)...), (left_ind, inds(tensor)...)) end #TODO is replace(conj(A)...) copying too much? - contracted = contract(tensor, replace(conj(tensor), left_ind => :new_ind_name)) + contracted = contract(tensor, replace(conj(tensor), left_ind => gensym(:new_ind))) n = size(tensor, left_ind) identity_matrix = Matrix(I, n, n)