Driven-dissipative toroidal Landau levels in cavity arrays – Introduction to the Julia language – Motivation



Driven-dissipative toroidal Landau levels in cavity arrays – Introduction to the Julia language – Motivation

0 0


trento-talk

Final talk in Trento

On Github berceanu / trento-talk

Driven-dissipative toroidal Landau levels in cavity arrays

Introduction to the Julia language

Motivation

  • ultracold gases: PRL 111, 185301 (2013), PRL 111, 185302 (2013)
  • classical circuits: arXiv:1309.0878 (2013)
  • classical pendula (two copies of HH model): arXiv:1503.06808
  • solid-state superlattices: Nature 497, 598 (2013), Nat Phys 10, 525 (2014)
  • silicon photonics: Nature Photonics 7, 1001 (2013)

Momentum space magnetism

  • model Hamiltonian

H=H0+12κ∑m,n[(m−m0)2+(n−n0)2]ˆa†m,nˆam,n

  • dual in momentum space

˜H=En(p)+κ2[i∇p+An(p)]2

Harper-Hofstadter model

H0=−J∑m,n(eiϕxm,nˆa†m+1,nˆam,n+eiϕym,nˆa†m,n+1ˆam,n)+h.c.

Harper-Hofstadter model

Harper-Hofstadter model

BW=maxp(E1(p))−minp(E1(p))

ΔE=⟨E2(p)⟩p−⟨E1(p)⟩p

Non Abelian correction

ϵn,β=En+(β+12)κ|Ωn|+δE

δE(p)=κ2∑n′≠n|An,n′(p)|2

ηzpe=4πακ(Eex−ϵ1,0)

Driving and dissipation

i∂tai,j(t)+iγai,j(t)−fi,je−iω0t=[ai,j(t),H]

Selection rules: δ–pump

Selection rules: Gaussian pump

Intermezzo: Hitting the edge

Homogeneous & random pumping

Experimental proposal

Experimental proposal

χβ(p)=N∑je−ipyjae−(px+jal2Ωn)2/2l2ΩnHβ(px/lΩn+jalΩn)

Julia

First contact

  • 2 language problem
  • vectorize everything, or else!
function mandel(z)
    c = z
    maxiter = 80
    for n = 1:maxiter
        if abs(z) > 2
            return n-1
        end
        z = z^2 + c
    end
    return maxiter
end
  • C-level performance

Multiple dispatch

  • traditional OO paradigm – dispatch based on one argument only
obj.foo(arg1, arg2, ..)
  • Julia – multiple dispatch
foo(obj, arg1, arg2, ..)
julia> methods(+)
# 139 methods for generic function "+":
+(x::Bool) at bool.jl:33
+(x::Bool,y::Bool) at bool.jl:36
+(y::FloatingPoint,x::Bool) at bool.jl:46
+(x::Int64,y::Int64) at int.jl:14
+(x::Int8,y::Int8) at int.jl:14
+(x::UInt8,y::UInt8) at int.jl:14
+(x::Int16,y::Int16) at int.jl:14
+(x::UInt16,y::UInt16) at int.jl:14
+(x::Int32,y::Int32) at int.jl:14
+(x::UInt32,y::UInt32) at int.jl:14
+(x::UInt64,y::UInt64) at int.jl:14
+(x::Int128,y::Int128) at int.jl:14

User-defined types

  • type declaration not mandatory
  • parametric types
type Wavefunction{T}
    c::Array{T, 2}
    x::Array{T, 2}
end
+{T}(psi1::Wavefunction{T}, psi2::Wavefunction{T}) =
                        Wavefunction{T}(psi1.c + psi2.c, psi1.x + psi2.x)
+{T}(psi::Wavefunction{T}, c::Float64) = Wavefunction{T}(psi.c .+ c, psi.x .+ c) 
*{T}(c::Number, psi::Wavefunction{T}) = Wavefunction{T}(c*psi.c, c*psi.x)
/{T}(psi1::Wavefunction{T}, psi2::Wavefunction{T}) =
                         Wavefunction{T}(psi1.c ./ psi2.c, psi1.x ./ psi2.x)
import Base.abs
abs(psi::Wavefunction{Complex{Float64}}) = Wavefunction{Float64}(abs(psi.c), abs(psi.x))
import Base.maximum
function maximum(psi::Wavefunction{Float64})
    maxc = maximum(psi.c)
    maxx = maximum(psi.x)
    return max(maxc, maxx)
end

Julia is..

  • free, open-source software (MIT license)
  • high level (Python, MATLAB)
  • homoiconic

Interactive computation with Jupyter

1
Driven-dissipative toroidal Landau levels in cavity arrays Introduction to the Julia language