Skip to content

Instantly share code, notes, and snippets.

Avatar

Rodney Polkinghorne thisrod

  • Swinburne University of Technology
  • Melbourne
View GitHub Profile
View seven.jl
# Order parameter for a Bose-Einstein condensate with a lattice of
# seven vortices
using LinearAlgebra, BandedMatrices, Optim, Arpack
g = 10/sqrt(2); Ω=0.55*sqrt(2)
Nc = 116.24
h = 0.2/2^(1/4); N = 110
C = g*Nc/h^2 # Optim sets norm(ψ) = 1
View opbench.jl
# Single vortex relaxation benchmark
using LinearAlgebra, BandedMatrices, Optim
# The benchmark task is to find the least-energy solution of the
# static 2D Gross-Pitaevskii equation, with a harmonic potential V =
# x² + y², in a frame rotating with angular velocity Ω:
#
# -∇²ψ/2 + (V+g*abs2.(ψ)).*ψ - 1im*Ω*(y.*(ψ*∂')-x.*(∂*ψ)) = μ*ψ
#
@thisrod
thisrod / cluster.md
Last active Nov 8, 2019
How Julia threads might work on a cluster
View cluster.md

Here's a sequence of events.

The memoisation part would be useful locally, not just on a cluster. E.g. look up the order parameter that I prepared earlier, then compute the sound wave spectrum in an new way.

It would be useful to have a @cluster_loop macro, which memoised the result of doing 100 iterations, and skipped to there when you asked for 200. Maybe save the Fibonacci numbers of iterations as well as the final one.

  1. I run a test script, which goes something like this:
for n = 1:15
@thisrod
thisrod / seven.jl
Last active Oct 17, 2019
Gauss-Seidel script
View seven.jl
# Order parameter for a Bose-Einstein condensate with a lattice of
# seven vortices
using LinearAlgebra, BandedMatrices
C = 10; μ=25; Ω=2*0.55
h = 0.2; N = 100
a = 1.7
y = h/2*(1-N:2:N-1); x = y'; z = x .+ 1im*y