From c1b477a1b2b796617c4e345a7296a8d429d7a067 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Sun, 26 Feb 2023 18:36:05 -0500 Subject: Update to v0.4 feature: compute the 2-point correlation function in easyeq. feature: compute the Fourier transform of the 2-point correlation function in anyeq and easyeq. feature: compute the local maximum of the 2-point correlation function and its Fourier transform. feature: compute the compressibility for anyeq. feature: allow for linear spacing of rho's. feature: print the scattering length. change: ux and uk now return real numbers. fix: error in the computation of the momentum distribution: wrong definition of delta functions. fix: various minor bugs. optimization: assign explicit types to variables. --- src/simpleq-Kv.jl | 68 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 8 deletions(-) (limited to 'src/simpleq-Kv.jl') diff --git a/src/simpleq-Kv.jl b/src/simpleq-Kv.jl index 8789656..5a6579c 100644 --- a/src/simpleq-Kv.jl +++ b/src/simpleq-Kv.jl @@ -1,4 +1,4 @@ -## Copyright 2021 Ian Jauslin +## Copyright 2021-2023 Ian Jauslin ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. @@ -13,12 +13,27 @@ ## limitations under the License. # Compute Kv=(-\Delta+v+4e(1-\rho u*))^{-1}v -function anyeq_Kv(minlrho,nlrho,taus,P,N,J,rho,a0,v,maxiter,tolerance,xmin,xmax,nx) +function anyeq_Kv( + minlrho::Float64, + nlrho::Int64, + taus::Array{Float64,1}, + P::Int64, + N::Int64, + J::Int64, + rho::Float64, + a0::Float64, + v::Function, + maxiter::Int64, + tolerance::Float64, + xmin::Float64, + xmax::Float64, + nx::Int64 +) # init vectors (weights,T,k,V,V0,A,Upsilon,Upsilon0)=anyeq_init(taus,P,N,J,v) # compute initial guess from medeq - rhos=Array{Float64}(undef,nlrho) + rhos=Array{Float64,1}(undef,nlrho) for j in 0:nlrho-1 rhos[j+1]=(nlrho==1 ? rho : 10^(minlrho+(log10(rho)-minlrho)/(nlrho-1)*j)) end @@ -44,7 +59,17 @@ function anyeq_Kv(minlrho,nlrho,taus,P,N,J,rho,a0,v,maxiter,tolerance,xmin,xmax, end # Compute the condensate fraction for simpleq using Kv -function simpleq_Kv_condensate_fraction(rhos,taus,P,N,J,a0,v,maxiter,tolerance) +function simpleq_Kv_condensate_fraction( + rhos::Array{Float64,1}, + taus::Array{Float64,1}, + P::Int64, + N::Int64, + J::Int64, + a0::Float64, + v::Function, + maxiter::Int64, + tolerance::Float64 +) # init vectors (weights,T,k,V,V0,A,Upsilon,Upsilon0)=anyeq_init(taus,P,N,J,v) @@ -67,19 +92,35 @@ function simpleq_Kv_condensate_fraction(rhos,taus,P,N,J,a0,v,maxiter,tolerance) end # Compute the two-point correlation function for simpleq using Kv -function simpleq_Kv_2pt(minlrho,nlrho,taus,P,N,J,rho,a0,v,maxiter,tolerance,xmin,xmax,nx) +function simpleq_Kv_2pt( + minlrho::Float64, + nlrho::Int64, + taus::Array{Float64,1}, + P::Int64, + N::Int64, + J::Int64, + rho::Float64, + a0::Float64, + v::Function, + maxiter::Int64, + tolerance::Float64, + xmin::Float64, + xmax::Float64, + nx::Int64 +) # init vectors (weights,T,k,V,V0,A,Upsilon,Upsilon0)=anyeq_init(taus,P,N,J,v) # compute initial guess from medeq - rhos=Array{Float64}(undef,nlrho) + rhos=Array{Float64,1}(undef,nlrho) for j in 0:nlrho-1 rhos[j+1]=(nlrho==1 ? rho : 10^(minlrho+(log10(rho)-minlrho)/(nlrho-1)*j)) end u0s=anyeq_init_medeq(rhos,N,J,k,a0,v,maxiter,tolerance) u0=u0s[nlrho] - (u,E,error)=anyeq_hatu(u0,P,N,J,rho,a0,weights,k,taus,V,V0,A,nothing,Upsilon,Upsilon0,v,maxiter,tolerance,Anyeq_approx(0.,0.,1.,0.,0.,0.,0.,0.,0.,0.,0.)) + Abar=Array{Float64,5}(undef,0,0,0,0,0) + (u,E,error)=anyeq_hatu(u0,P,N,J,rho,a0,weights,k,taus,V,V0,A,Abar,Upsilon,Upsilon0,v,maxiter,tolerance,Anyeq_approx(0.,0.,1.,0.,0.,0.,0.,0.,0.,0.,0.)) # Kv in Fourier space Kvk=simpleq_Kv_Kvk(u,V,E,rho,Upsilon,k,taus,weights,N,J) @@ -103,7 +144,18 @@ function simpleq_Kv_2pt(minlrho,nlrho,taus,P,N,J,rho,a0,v,maxiter,tolerance,xmin end # Kv -function simpleq_Kv_Kvk(u,V,E,rho,Upsilon,k,taus,weights,N,J) +function simpleq_Kv_Kvk( + u::Array{Float64,1}, + V::Array{Float64,1}, + E::Float64, + rho::Float64, + Upsilon::Array{Array{Float64,1},1}, + k::Array{Float64,1}, + taus::Array{Float64,1}, + weights::Tuple{Array{Float64,1},Array{Float64,1}}, + N::Int64, + J::Int64 +) # (-Delta+v+4e(1-\rho u*)) in Fourier space M=Array{Float64,2}(undef,N*J,N*J) for zetapp in 0:J-1 -- cgit v1.2.3-70-g09d2