You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have been using the matfreq2dlr routine as it has been very useful for my research. There is an issue with being able to resize the array containing the imaginary frequency Green's function data after calling matfreq2dlr because the routine internally reshapes the array, causing an error in Julia v1.10 and before.
This happens as a result of a Julia issue JuliaLang/julia#33143.
Here is how I reproduce the issue
using Lehmann
β =100.0# inverse temperature
Euv =1.0# ultraviolt energy cutoff of the Green's function
rtol =1e-8# accuracy of the representation
isFermi =false
symmetry =:none# :ph if particle-hole symmetric, :pha is antisymmetric, :none if there is no symmetry
dlr =DLRGrid(Euv, β, rtol, isFermi, symmetry) #initialize the DLR parameters and basis
Nωn =10000
ngrid =collect(-Nωn:Nωn) # create a set of Matsubara-frequency points
Gn = Sample.SemiCircle(dlr, :n, ngrid) # Use semicircle spectral density to generate the sample Green's function in ωn
spectral_from_Gω =matfreq2dlr(dlr, Gn, ngrid)
resize!(Gn, 2length(ngrid))
This is the error
ERROR: cannot resize array with shared data
Stacktrace:
[1] _growend!
@ ./array.jl:1072 [inlined]
[2] push!(a::Vector{Float64}, item::Float64)
@ Base ./array.jl:1119
[3] top-level scope
@ REPL[22]:1
Although for now this doesn't cause any issues in Julia v1.11, I will avoid resizing my arrays, and in the long term it would be handy if matfreq2dlr didn't reshape arrays internally so that their memory could be reused in Julia v1.10 (the lts).
The text was updated successfully, but these errors were encountered:
Hello,
I have been using the
matfreq2dlr
routine as it has been very useful for my research. There is an issue with being able to resize the array containing the imaginary frequency Green's function data after callingmatfreq2dlr
because the routine internally reshapes the array, causing an error in Julia v1.10 and before.This happens as a result of a Julia issue JuliaLang/julia#33143.
Here is how I reproduce the issue
This is the error
Although for now this doesn't cause any issues in Julia v1.11, I will avoid resizing my arrays, and in the long term it would be handy if
matfreq2dlr
didn't reshape arrays internally so that their memory could be reused in Julia v1.10 (the lts).The text was updated successfully, but these errors were encountered: