Skip to content

Instantly share code, notes, and snippets.

View thisrod's full-sized avatar

Rodney Polkinghorne thisrod

  • Pepperstone
  • Melbourne
View GitHub Profile
@thisrod
thisrod / seven.jl
Last active October 17, 2019 04:41
Gauss-Seidel script
# 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
@thisrod
thisrod / cluster.md
Last active November 8, 2019 00:26
How Julia threads might work on a cluster

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
# 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.*(∂*ψ)) = μ*ψ
#
# 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