Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoine Levitt antoine-levitt

View GitHub Profile
View gist:9f1e451786529fcc7d0ffa6f030248ae
C_beg = 0.
C_end = -6.
opt_newton = PALC.NewtonPar(tol = 1e-8, verbose = true, maxIter = 20)
opts_br = ContinuationPar(dsmin = 0.001, dsmax = 0.05, ds = -0.01, pMax = C_beg, pMin = C_end,
detectBifurcation = 2, nev = 30, plotEveryNsteps = 10, newtonOptions = opt_newton,
maxSteps = 100, precisionStability = 1e-6, nInversion = 4, dsminBisection = 1e-7, maxBisectionSteps = 25)
ρ0 = zeros(prod(basis.fft_size))
View gist:6557f4246647868e597a30e1f78249a3
ERROR: LoadError: MethodError: no method matching getTangent!(::BorderedArray{Array{Float64,1},Float64}, ::BorderedArray{Array{Float64,1},Float64}, ::BorderedArray{Array{Float64,1},Int64}, ::PALCIterable{typeof(F),PseudoArcLengthContinuation.var"#175#177"{typeof(F)},Array{Float64,1},NamedTuple{(:C,),Tuple{Int64}},Setfield.PropertyLens{:C},Float64,DefaultLS,DefaultEig{typeof(real)},SecantPred,BorderingBLS{DefaultLS,Float64},PseudoArcLengthContinuation.var"#155#169"{PseudoArcLengthContinuation.var"#155#156#170"},PseudoArcLengthContinuation.var"#153#167",typeof(norm),PseudoArcLengthContinuation.DotTheta{PseudoArcLengthContinuation.var"#154#168"},PseudoArcLengthContinuation.var"#157#171",PseudoArcLengthContinuation.var"#158#172"{PseudoArcLengthContinuation.var"#158#159#173"},String}, ::Float64, ::Float64, ::SecantPred, ::Int64)
Closest candidates are:
getTangent!(::M, ::M, ::M, ::PALCIterable, ::Any, ::Any, ::Talgo, ::Any) where {T, vectype, M<:BorderedArray{vectype,T}, Talgo<:PseudoArcLengthContinuation.Abstra
View gist:5fa8eb3a1ce51087c0da857f36e0238f
using PseudoArcLengthContinuation, LinearAlgebra, Plots, PyPlot, Optim
const PALC = PseudoArcLengthContinuation
using ForwardDiff
function f(x, alpha)
[alpha*x[1] + x[1]^3 ]
end
function Jf(x, alpha)
Jf = zeros(1, 1)
Jf[1] = alpha+3x[1]^2
View gist:7907faca2d72238a452de537779efbb0
using PseudoArcLengthContinuation, LinearAlgebra, Plots, PyPlot, Optim
const PALC = PseudoArcLengthContinuation
# fonction à annuler
function f(x, alpha)
resu = zeros(1)
resu[1]= alpha*x[1] + x[1]^3
return resu
View test.jl
using StaticArrays
using PyPlot
using QuadGK
const latt = @SMatrix[1 0;
0 1]
const α = .1
f(r) = exp(-α*r^2)
fp(r) = -α * 2 * r * exp(-α*r^2)
Rmax = 100
View gist:18e80e5de607158f65ee4022967a8a6b
double free or corruption (fasttop)
signal (6): Aborted
in expression starting at /home/antoine/.julia/dev/DFTK/examples/silicon.jl:50
__libc_signal_restore_set at /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:80 [inlined]
raise at /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:48
abort at /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:79
__libc_message at /build/glibc-OTsEL5/glibc-2.27/libio/../sysdeps/posix/libc_fatal.c:181
malloc_printerr at /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:5350
_int_free at /build/glibc-OTsEL5/glibc-2.27/malloc/malloc.c:4230 [inlined]
View gist:41cc5480235d9d4c7e853354ccdb9a45
double free or corruption (out)
signal (6): Aborted
in expression starting at /home/antoine/.julia/dev/DFTK/examples/silicon.jl:50
in expression starting at /home/antoine/.julia/dev/DFTK/examples/silicon.jl:50
in expres11): Segmentation fault
in expression starting at /home/antoine/.julia/dev/DFTK/examples/silicon.jl:50
fftw_twiddle_awake at /home/antoine/.julia/artifacts/e40697527cebb56d421346210295905df6e421dc/lib/libfftw3.so (unknown line)
fftw_plan_awake at /home/antoine/.julia/artifacts/e40697527cebb56d421346210295905df6e421dc/lib/libfftw3.so (unknown line)
fftw_plan_awake at /home/antoine/.julia/artifacts/e40697527cebb56d421346210295905df6e421dc/lib/libfftw3.so (unknown line)
View gist:72916a06bbbe342a5648240c19d577ee
## 2D Gross-Pitaevskii equation, with magnetic field, and with
## multiple electrons (of course, it doesn't make physical sense, but
## why not)
## This is pretty WIP, and only serves as a very rough demo. Nothing
## has been checked properly, so do not use for any serious purposes.
using PyCall
using DFTK
using Printf
View gist:98a8b4a377ab1b8abd8eba7aa552a160
## 2D Gross-Pitaevskii equation, with magnetic field, and with
## multiple electrons (of course, it doesn't make physical sense, but
## why not)
## This is pretty WIP, and only serves as a very rough demo. Nothing
## has been checked properly, so do not use for any serious purposes.
using PyCall
using DFTK
using Printf
View bench.jl
using FFTW
n = 128
m = 5
X = randn(ComplexF64, n, n, n, m)
p = plan_fft!(X, (1, 2, 3))
Y = copy(X)
GC.gc()
GC.enable(false)