From 8b805dd7a0baa0c2159e4fad70c55029c20a0668 Mon Sep 17 00:00:00 2001 From: arnab82 Date: Thu, 20 Jun 2024 10:45:42 -0400 Subject: [PATCH] transform basis length problem in mutithreading solved --- src/tucker_pt.jl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tucker_pt.jl b/src/tucker_pt.jl index b9504a9..95fec3b 100644 --- a/src/tucker_pt.jl +++ b/src/tucker_pt.jl @@ -344,7 +344,11 @@ function form_1body_operator_diagonal!(sig::BSTstate{T,N,R}, Fdiag::BSTstate{T,N # # Rotate the original vector into this basis - transform_basis!(sig[fock][tconfig], rotations) + if length(rotations)==N + transform_basis!(sig[fock][tconfig], rotations) + else + continue + end end end @@ -1149,10 +1153,8 @@ function _pt2_job2(sig_fock, job, ket::BSTstate{T,N,R}, cluster_ops, clustered_h end end end - + curr_tuck = Vector{Any}() for (sig_tconfig, terms_to_process) in tconfigs_to_process - curr_tucker = [] - i=1 #curr_tuck=Tucker{T,N,R}() #initialization problem is there as in every iteration there is a new dimension of Tucker core and factor #if I don't want to store tucker in a list, though it is not affecting the time and memory allocations for (term, ket_fock, ket_tconfig) in terms_to_process @@ -1175,17 +1177,15 @@ function _pt2_job2(sig_fock, job, ket::BSTstate{T,N,R}, cluster_ops, clustered_h prescreen=thresh) #compress new addition sig_tuck = compress(sig_tuck, thresh=thresh) - push!(curr_tucker, sig_tuck) + # println(sig_tuck) - if i==1 - #curr_tuck = sig_tuck - curr_tuck = curr_tucker[i] + if length(curr_tuck) == 0 + curr_tuck = sig_tuck else - #curr_tuck=nonorth_add([curr_tuck, sig_tuck]) - curr_tuck=nonorth_add([curr_tuck, curr_tucker[i]]) + curr_tuck=nonorth_add([curr_tuck, sig_tuck]) + end ##curr_tuck=nonorth_add([curr_tuck, sig_tuck]) - i+=1 end if length(curr_tuck) == 0