diff --git a/src/FermiCG.jl b/src/FermiCG.jl index 736ed61..7f3046c 100644 --- a/src/FermiCG.jl +++ b/src/FermiCG.jl @@ -72,6 +72,7 @@ include("tucker_form_sigma_block_expand.jl") include("tucker_outer.jl") include("tucker_pt.jl") include("bst.jl") +include("bst_helpers.jl") include("tpsci_inner.jl") include("tpsci_matvec_thread.jl") diff --git a/src/bst_helpers.jl b/src/bst_helpers.jl new file mode 100644 index 0000000..5115be0 --- /dev/null +++ b/src/bst_helpers.jl @@ -0,0 +1,43 @@ + + +""" + function bst_single_excitonic_basis(clusters, fspace::FockConfig{N}; R=1, Nk=2, T=Float64) where {N} +""" +function bst_single_excitonic_basis(clusters, fspace::FockConfig{N}, cluster_bases::Vector{ClusterBasis{A, T}}; R=1,number_of_single_excitations=4) where {N, T, A} + max_index = length(fspace.config) + ci_vector = BSTstate(clusters, fspace, cluster_bases, R=R) + dims = ones(Int, max_index) + configs = [] + for i in 2:number_of_single_excitations + for indices in combinations(1:max_index, 1) + config = [in(k, indices) ? (i:i) : (1:1) for k in 1:max_index] + push!(configs, tuple(config...)) + end + end + for config in configs + ci_vector[FermiCG.FockConfig(init_fspace)][FermiCG.TuckerConfig(config)] = + FermiCG.Tucker(tuple([zeros(Float64, dims...) for _ in 1:R]...)) + end + return ci_vector +end +""" + function bst_biexcitonic_basis(clusters, fspace::FockConfig{N}; R=1, Nk=2, T=Float64) where {N} +""" +function bst_biexcitonic_basis(clusters, fspace::FockConfig{N}, cluster_bases::Vector{ClusterBasis{A, T}}; R=1) where {N, T, A} + max_index = length(fspace.config) + ci_vector = BSTstate(clusters, fspace, cluster_bases, R=R) + configs = [] + for indices in combinations(1:max_index, 2) + config = [in(k, indices) ? (2:2) : (1:1) for k in 1:max_index] + push!(configs, tuple(config...)) + end + dims = ones(Int, max_index) + for config in configs + ci_vector[FermiCG.FockConfig(init_fspace)][FermiCG.TuckerConfig(config)] = + FermiCG.Tucker(tuple([zeros(Float64, dims...) for _ in 1:R]...)) + end + + return ci_vector +end + +