In [1]:
using PyPlot

In [2]:
# matplotlib parameters
matplotlib["rcParams"][:update](["axes.labelsize" => 22,
                                 "axes.titlesize" => 20,
                                 "font.size" => 18,
                                 "legend.fontsize" => 14,
                                 "axes.linewidth" => 1.5,
                                 "font.family" => "serif",
                                 "font.serif" => "Computer Modern Roman",
                                 "xtick.labelsize" => 20,
                                 "xtick.major.size" => 5.5,
                                 "xtick.major.width" => 1.5,
                                 "ytick.labelsize" => 20,
                                 "ytick.major.size" => 5.5,
                                 "ytick.major.width" => 1.5,
                                 "text.usetex" => true,
                                 "figure.autolayout" => true])

In [3]:
import BP

In [4]:
exdef = BP.ExactStates(100, :symmetric, 45, 1/11, 0.02);

In [5]:
#full plot range, both in x and y
const xm = [-div(exdef.N-1,2):div(exdef.N-1,2)];

In [6]:
k = linspace(-π, π, 200);

In [7]:
β=0;

In [8]:
state = BP.getstate(exdef, β+1);

In [9]:
f, ax = plt.subplots(figsize=(10, 4))

ax[:axvline](x = exdef.νs[β+1], color="black", ls="dashed", linewidth="3")

for ω in exdef.νs
    ax[:axvline](x = ω, color="orange")
end 

ax[:set_xlim](exdef.νs[1] - 0.03, exdef.νs[end] + 0.03)

plt.close(f)



In [10]:
f, ax = plt.subplots(figsize=(5, 5))
img = ax[:imshow](abs2(state), origin="upper", ColorMap("gist_heat_r"), interpolation="none",
                 extent=[xm[1], xm[end], xm[1], xm[end]],
                 vmin=0, vmax=0.02)

ax[:set_ylabel](L"$n$", labelpad=-10)
ax[:set_xlabel](L"$m$", labelpad=-6)
    
cbaxes = f[:add_axes]([0.25, 0.03, 0.65, 0.015])
cbar = f[:colorbar](img, cax=cbaxes, orientation="horizontal")
cbar[:set_ticks]([0, 0.02])
cbar[:set_ticklabels]([L"$0$", L"$0.02$"])
cbar[:set_label](L"$|\psi_{m,n}|^2$", rotation=0, labelpad=-5, y=0.5)
cbar[:solids][:set_edgecolor]("face")

plt.close(f)



In [11]:
extrema(abs2(state))


Out[11]:
(4.438850663806998e-38,0.09713818841198457)

In [12]:
f, ax = plt.subplots(figsize=(5, 5))

img = ax[:imshow](abs2(fftshift(fft(state))),
            origin="upper", ColorMap("gist_heat_r"), interpolation="none",
            extent=[-π, π, -π, π],
            vmin=0, vmax=10)

ax[:set_xticks]([-π,0,π])
ax[:set_yticks]([-π,0,π])

ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

ax[:set_xlabel](L"$p_x$", labelpad=-4)
ax[:set_ylabel](L"$p_y$", labelpad=-10)

cbaxes = f[:add_axes]([0.25, 0.03, 0.65, 0.015])
cbar = f[:colorbar](img, cax=cbaxes, orientation="horizontal")
cbar[:set_ticks]([0, 10])
cbar[:set_label](L"$|\psi_{p_x,p_y}|^2$", rotation=0, labelpad=-5, y=0.5)
cbar[:solids][:set_edgecolor]("face")


plt.close(f)



In [13]:
extrema(abs2(fft(state)))


Out[13]:
(1.679266551537706e-22,41.16625918773767)

In [14]:
βs = [9, 20, 30, 38, 59, 99];

In [15]:
f, ax = plt.subplots(figsize=(10, 4))

for β in βs
    ax[:axvline](x = exdef.νs[β+1], color="black", ls="dashed", linewidth="3")
end

for ω in exdef.νs
    ax[:axvline](x = ω, color="orange")
end 

ax[:set_xlim](exdef.νs[1] - 0.03, exdef.νs[end] + 0.03)

ax[:set_xlabel](L"$\omega [J]$")
ax[:set_ylabel](L"$\sum_{m,n} |\psi_{m,n}|^2$ [a.u.]")

#f[:savefig]("../figures/sym_ring_spect.svg", transparent=true, pad_inches=0.0, bbox_inches="tight")

plt.close(f)



In [16]:
fig, axes = plt.subplots(2,div(length(βs),2), figsize=(10, 7.3))
for i = 1:div(length(βs),2) #loop over columns
    # top row
    ax = axes[1,i]
    img = ax[:imshow](abs2(BP.myfft2(BP.getstate(exdef, βs[i]+1), k,k)), origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
        
    ax[:set_xticklabels]([])

    ax[:set_xticks]([-π,0,π])
    ax[:set_yticks]([-π,0,π])

    if i == 1 #leftmost panel
        ax[:set_ylabel](L"$p_y$")
        ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
    else
        ax[:set_yticklabels]([])
    end
    
    #bottom row
    ax = axes[2,i]
    ax[:imshow](abs2(BP.myfft2(BP.getstate(exdef, βs[i+div(length(βs),2)]+1), k,k)), origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)

    ax[:set_xlabel](L"$p_x$")
    ax[:set_xticks]([-π,0,π])
    ax[:set_yticks]([-π,0,π])
    ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
    if i == 1 # leftmost panel
        ax[:set_ylabel](L"$p_y$")
        ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
    else
        ax[:set_yticklabels]([])
    end

end 

#rect [left, bottom, width, height]

#cbaxes = fig[:add_axes]([1., 0.3, 0.015, 0.38])
#cbar = fig[:colorbar](img, cax=cbaxes, orientation="vertical")
#cbar[:set_ticks]([0, 10])
#cbar[:set_label](L"$|\psi_{p_x,p_y}|^2$", labelpad=-15, y=0.55)
#cbar[:solids][:set_edgecolor]("face")


fig[:savefig]("../figures/sym_ring.pdf", transparent=true, pad_inches=0.0, bbox_inches="tight")
plt.close(fig)



In [17]:
βs


Out[17]:
6-element Array{Int64,1}:
  9
 20
 30
 38
 59
 99

In [18]:
#zoom in
const st = indmin(abs(k .+ π))
const en = indmin(abs(k .+ 3π/4));

In [19]:
f, axes = plt.subplots(2,figsize=(8, 3))

for i=1:2
    ax=axes[i]
    img = ax[:imshow](abs2(BP.myfft2(BP.getstate(exdef, βs[i]+1), k,k))[st:en,1:end], origin="upper", ColorMap("gist_heat_r"), interpolation="none",
                      extent=[-π, π, 3π/4, π],
                      vmin=0, vmax=10)


ax[:set_xlabel](L"$p_x$")
ax[:set_xticks]([-π,0,π])
ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

ax[:set_ylabel](L"$p_y$")
ax[:set_yticks]([3π/4,π])
ax[:set_yticklabels]([L"$3\frac{\pi}{4}$",L"$\pi$"])
end

plt.close(f)



In [20]:
half = indmin(abs(k));

In [21]:
f, ax = plt.subplots(figsize=(8, 3))

ax[:plot](k[half:end], vec(abs2(BP.myfft2(BP.getstate(exdef, βs[1]+1), k,k))[1,half:end]), color="black", label=L"$\beta = 30$")
ax[:plot](k[half:end], vec(abs2(BP.myfft2(BP.getstate(exdef, βs[2]+1), k,k))[1,half:end]), color="black", ls="dashed", label=L"$\beta = 38$")


ax[:set_xlabel](L"$p_x$")
ax[:set_xticks]([0,π/2,π])
ax[:set_xlim]([0,π])
ax[:set_xticklabels]([L"$0$",L"$\pi/2$",L"$\pi$"])

ax[:legend](loc="upper right")

ax[:set_ylabel](L"$|\psi_{p_x,\pi}|^2$")

#f[:savefig]("../figures/fringe_slice.svg", transparent=true, pad_inches=0.0, bbox_inches="tight")

plt.close(f)


Moving the trap


In [22]:
#β = βs[1]
β = 4


Out[22]:
4

In [23]:
statesm0 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 0.0, 0.0);
statesm1 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 2.0, 0.0);
statesm2 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 5.5, 0.0);

In [24]:
statesm3 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 0.0, 2.0);
statesm4 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 0.0, 5.5);
statesm5 = BP.ExactStates(100, :landau, 45, 1/11, 0.02, 11.0, 11.0);

In [ ]:


In [25]:
statem0 = BP.getstate(statesm0, β+1);
statem1 = BP.getstate(statesm1, β+1);
statem2 = BP.getstate(statesm2, β+1);

In [26]:
statem3 = BP.getstate(statesm3, β+1);
statem4 = BP.getstate(statesm4, β+1);
statem5 = BP.getstate(statesm5, β+1);

In [27]:
s0 = abs2(BP.myfft2(statem0, k,k))
s1 = abs2(BP.myfft2(statem1, k,k))
s2 = abs2(BP.myfft2(statem2, k,k));

In [28]:
s3 = abs2(BP.myfft2(statem3, k,k))
s4 = abs2(BP.myfft2(statem4, k,k))
s5 = abs2(BP.myfft2(statem5, k,k));

In [29]:
fig, axes = plt.subplots(2,3, figsize=(10, 7.3))

img = axes[1,1][:imshow](s0, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[1,2][:imshow](s1, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[1,3][:imshow](s2, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)

axes[2,1][:imshow](s3, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[2,2][:imshow](s4, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[2,3][:imshow](s5, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)


for (i,ax) in enumerate(axes) #loop over columns
    ax[:set_xlabel](L"$p_x$")
    ax[:set_xticks]([-π,0,π])
    ax[:set_yticks]([-π,0,π])

    ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

    if i == 1 #leftmost panel
        ax[:set_ylabel](L"$p_y$")
        ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
    else
        ax[:set_yticklabels]([])
    end
end 

#axes[1][:plot](k, -π*ones(200))
#axes[2][:plot](k, -1.5*ones(200))
#axes[3][:plot](k, -0.3*ones(200))

#rect [left, bottom, width, height]

#cbaxes = fig[:add_axes]([1., 0.3, 0.015, 0.38])
#cbar = fig[:colorbar](img, cax=cbaxes, orientation="vertical")
#cbar[:set_ticks]([0, 10])
#cbar[:set_label](L"$|\psi_{p_x,p_y}|^2$", labelpad=-15, y=0.55)
#cbar[:solids][:set_edgecolor]("face")


fig[:savefig]("../figures/fringe_trap.pdf", transparent=true, pad_inches=0.0, bbox_inches="tight")
plt.close(fig)



In [41]:
fig, axes = plt.subplots(1,4, figsize=(10, 5))

img = axes[1][:imshow](s0, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[2][:imshow](s1, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)
axes[3][:imshow](s2, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)

axes[4][:imshow](s5, origin="upper", ColorMap("gist_heat_r"), interpolation="none",
    extent=[-π, π, -π, π], vmin=0, vmax=10)


for (i,ax) in enumerate(axes) #loop over columns
    ax[:set_xlabel](L"$p_x$")
    ax[:set_xticks]([-π,0,π])
    ax[:set_yticks]([-π,0,π])

    ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

    if i == 1 #leftmost panel
        ax[:set_ylabel](L"$p_y$")
        ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
    else
        ax[:set_yticklabels]([])
    end
end 

#axes[1][:plot](k, -π*ones(200))
#axes[2][:plot](k, -1.5*ones(200))
#axes[3][:plot](k, -0.3*ones(200))

#rect [left, bottom, width, height]

#cbaxes = fig[:add_axes]([1., 0.3, 0.015, 0.38])
#cbar = fig[:colorbar](img, cax=cbaxes, orientation="vertical")
#cbar[:set_ticks]([0, 10])
#cbar[:set_label](L"$|\psi_{p_x,p_y}|^2$", labelpad=-15, y=0.55)
#cbar[:solids][:set_edgecolor]("face")


fig[:savefig]("../figures/fringe_trap.pdf", transparent=true, pad_inches=0.0, bbox_inches="tight")
plt.close(fig)


Further investigation


In [30]:
#phase of w.f. in mom space

In [31]:
exdef = BP.ExactStates(100, :symmetric, 45, 1/11, 0.02);

In [32]:
β=1;

In [33]:
state = BP.getstate(exdef, β+1);

In [34]:
f, ax = plt.subplots(figsize=(5, 5))

img = ax[:imshow](angle(fftshift(fft(state))),
            origin="upper", ColorMap("gist_heat_r"), interpolation="none",
            extent=[-π, π, -π, π],
            vmin=-π, vmax=π)

ax[:set_xticks]([-π,0,π])
ax[:set_yticks]([-π,0,π])

ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

ax[:set_xlabel](L"$p_x$", labelpad=-4)
ax[:set_ylabel](L"$p_y$", labelpad=-10)

cbaxes = f[:add_axes]([0.25, 0.03, 0.65, 0.015])
cbar = f[:colorbar](img, cax=cbaxes, orientation="horizontal")
cbar[:set_ticks]([-π, π])
cbar[:set_ticklabels]([L"$-\pi$", L"$\pi$"])
cbar[:set_label](L"$\arg(\psi_{m,n})$", rotation=0, labelpad=-5, y=0.5)
cbar[:solids][:set_edgecolor]("face")


plt.close(f)



In [35]:
#exp(im*m*ϕ)
ψ(m::Int, x::Float64, y::Float64) = ((x + im*y)/sqrt(x^2 + y^2))^m


Out[35]:
ψ (generic function with 1 method)

In [36]:
function vortex(m::Int, xv::Array{Float64,1}, yv::Array{Float64,1})
    Ψ = Array(Complex{Float64}, length(yv), length(xv))
    for (j,x) in enumerate(xv), (i,y) in enumerate(yv)
        Ψ[i,j] = ψ(m, x, y)
    end
    Ψ
end


Out[36]:
vortex (generic function with 1 method)

In [37]:
Ψ = vortex(3, linspace(-π, π, 200), linspace(-π, π, 200));

In [38]:
f, ax = plt.subplots(figsize=(5, 5))

img = ax[:imshow](angle(Ψ),
            origin="upper", ColorMap("gist_heat_r"), interpolation="none",
            extent=[-π, π, -π, π],
            vmin=-π, vmax=π)

ax[:set_xticks]([-π,0,π])
ax[:set_yticks]([-π,0,π])

ax[:set_xticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])
ax[:set_yticklabels]([L"$-\pi$",L"$0$",L"$\pi$"])

ax[:set_xlabel](L"$p_x$", labelpad=-4)
ax[:set_ylabel](L"$p_y$", labelpad=-10)

cbaxes = f[:add_axes]([0.25, 0.03, 0.65, 0.015])
cbar = f[:colorbar](img, cax=cbaxes, orientation="horizontal")
cbar[:set_ticks]([-π, π])
cbar[:set_ticklabels]([L"$-\pi$", L"$\pi$"])
cbar[:set_label](L"$\arg(\Psi_{m,n})$", rotation=0, labelpad=-5, y=0.5)
cbar[:solids][:set_edgecolor]("face")


plt.close(f)