From 688c3a50c1a8c6fce05c341f4f93bb7f9a23dc3e Mon Sep 17 00:00:00 2001 From: Nick Mayhall Date: Wed, 31 Jan 2024 21:09:24 -0500 Subject: [PATCH] added the ability to do BST without the PT1 vector, just compressing FOIS --- src/bst.jl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/bst.jl b/src/bst.jl index 3fc71e3..1dbe21a 100644 --- a/src/bst.jl +++ b/src/bst.jl @@ -479,15 +479,24 @@ function block_sparse_tucker(input_vec::BSTstate{T,N,R}, cluster_ops, clustered_ @printf(" %5s %12.8f %12.8f\n", r, e0[r], abs(s2[r])) end flush(stdout) - + # - # Get First order wavefunction + # Get First order interacting space println() - @printf(" %-50s%10i\n", "Compute PT1 wavefunction. Reference space dim: ", length(ref_vec)) - - time = @elapsed @timeit to "FOIS" pt1_vec, e_pt2 = compute_pt1_wavefunction(ref_vec, cluster_ops, clustered_ham, nbody=nbody, thresh_foi=thresh_foi, verbose=verbose) + time = @elapsed alloc = @allocated @timeit to "FOIS" pt1_vec = build_compressed_1st_order_state(ref_vec, cluster_ops, clustered_ham, nbody=nbody, thresh=thresh_foi) + verbose < 1 || @printf(" %-50s%10.6f seconds %10.2e Gb\n", "Compute Compressed FOIS: ", time, alloc / 1e9) @printf(" %-50s%10.6f seconds\n", "Total time spent building FOIS: ", time) + if do_pt + # + # Get First order wavefunction + println() + @printf(" %-50s%10i\n", "Compute PT1 wavefunction. Reference space dim: ", length(ref_vec)) + + time = @elapsed @timeit to "PT1" pt1_vec, e_pt2 = compute_pt1_wavefunction(pt1_vec, ref_vec, cluster_ops, clustered_ham, H0=H0, verbose=verbose) + @printf(" %-50s%10.6f seconds\n", "Total time spent building PT1: ", time) + end + # # Compress FOIS norm1 = orth_dot(pt1_vec, pt1_vec)