Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20 remove typos from bose dimer example #22

Merged
merged 3 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KadanoffBaym"
uuid = "82532805-809c-4ef0-842b-4b00c5e9be5f"
authors = ["Francisco Meirinhos, Tim Bode"]
version = "1.3.1"
version = "1.3.2"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
12 changes: 6 additions & 6 deletions docs/src/examples/OpenBoseDimer.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,30 @@ Then we assign all of the parameters we need:
ω₂ = 0.0
J = pi / 4

γ = 1
λ = 1

N₁ = 1.
N₂ = 0.1

H = [ω₁ - 0.5im * ((N₁ + 1) + N₁ * γ) J; J ω₂ - 0.5im * ((N₂ + 1) + N₂ * γ)]
H = [ω₁ - 0.5im * λ * ((N₁ + 1) + N₁) J; J ω₂ - 0.5im * λ * ((N₂ + 1) + N₂)]
```
As the last step, we write down the equations of motion:
```julia
# Right-hand side for the "vertical" evolution
function fv!(out, _, _, _, t, t′)
out[1] = -1.0im * (H * GL[t, t′] + [[1.0im * N₁ * γ, 0] [0, 1.0im * N₂ * γ]] * GL[t, t′])
out[2] = -1.0im * (adjoint(H) * GG[t, t′] - 1.0im * [[(N₁ + 1), 0] [0, (N₂ + 1)]] * GG[t, t′])
out[1] = -1.0im * (H * GL[t, t′] + λ * [[1.0im * N₁, 0] [0, 1.0im * N₂]] * GL[t, t′])
out[2] = -1.0im * (adjoint(H) * GG[t, t′] - 1.0im * λ * [[(N₁ + 1), 0] [0, (N₂ + 1)]] * GG[t, t′])
end
```
Observe how we have converted the (anti-) time-ordered Green functions ``G^{T}, G^{\tilde{T}}`` into lesser and greater functions by explicitly using the fact that we are operating on the ``t>t'`` triangle of the two-time grid ``(t, t')``. By combining `fv!` with its adjoint [as before](@ref TightBinding), we also obtain the "diagonal" equations as
```julia
# Right-hand side for the "diagonal" evolution
function fd!(out, _, _, _, t, t′)
out[1] = (-1.0im * (H * GL[t, t] - GL[t, t] * adjoint(H)
+ 1.0im * γ * [[N₁ * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂) * (GL[2, 1, t, t] + GG[2, 1, t, t]) / 2] [(N₁ + N₂) * (GL[1, 2, t, t] + GG[1, 2, t, t]) / 2, N₂ * (GL[2, 2, t, t] + GG[2, 2, t, t])]])
+ 1.0im * λ * [[N₁ * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂) * (GL[2, 1, t, t] + GG[2, 1, t, t]) / 2] [(N₁ + N₂) * (GL[1, 2, t, t] + GG[1, 2, t, t]) / 2, N₂ * (GL[2, 2, t, t] + GG[2, 2, t, t])]])
)
out[2] = (-1.0im * (adjoint(H) * GG[t, t] - GG[t, t] * H
- 1.0im * [[(N₁ + 1) * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂ + 2) * (GG[2, 1, t, t] + GL[2, 1, t, t]) / 2] [(N₁ + N₂ + 2) * (GG[1, 2, t, t] + GL[1, 2, t, t]) / 2, (N₂ + 1) * (GL[2, 2, t, t] + GG[2, 2, t, t])]])
- 1.0im * λ * [[(N₁ + 1) * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂ + 2) * (GG[2, 1, t, t] + GL[2, 1, t, t]) / 2] [(N₁ + N₂ + 2) * (GG[1, 2, t, t] + GL[1, 2, t, t]) / 2, (N₂ + 1) * (GL[2, 2, t, t] + GG[2, 2, t, t])]])
)
end
```
Expand Down
34 changes: 21 additions & 13 deletions examples/bosonic-dimer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"using LinearAlgebra\n",
"\n",
"using PyPlot\n",
"PyPlot.plt.style.use(\"./paper.mplstyle\")\n",
"# PyPlot.plt.style.use(\"./paper.mplstyle\")\n",
"using LaTeXStrings"
]
},
Expand All @@ -45,7 +45,7 @@
"id": "ac99780f",
"metadata": {},
"source": [
"A nice example to illustrate how one can use `KadanoffBaym.jl` to study *open systems* is the Bose dimer. It consists of two bosonics modes $\\omega_{1,2}$ (you can imagine two single-mode cavities at different frequencies), which are coupled with strength $J$. Additionally, each mode is coupled to its own reservoir at inverse temperature $\\beta_{1,2}$, respectively. Such a system is described by the master equation\n",
"A nice example to illustrate how one can use `KadanoffBaym.jl` to study *open systems* is a Bose dimer. It consists of two bosonic modes $\\omega_{1,2}$ (you can imagine two single-mode cavities at different frequencies), which are coupled with strength $J$. Additionally, each mode is coupled to its own reservoir at inverse temperature $\\beta_{1,2}$, respectively. Such a system is described by the master equation\n",
"\n",
"\\begin{align*}\n",
"\t\\partial_{t} \\hat{\\rho}=-i\\left[\\hat{H} \\hat{\\rho}-\\hat{\\rho} \\hat{H}^{\n",
Expand Down Expand Up @@ -133,26 +133,26 @@
"ω₂ = 0.0\n",
"J = pi / 4\n",
"\n",
"γ = 1\n",
"λ = 1\n",
"\n",
"N₁ = 1.\n",
"N₂ = 0.1\n",
"\n",
"H = [ω₁ - 0.5im * ((N₁ + 1) + N₁ * γ) J; J ω₂ - 0.5im * ((N₂ + 1) + N₂ * γ)]\n",
"H = [ω₁ - 0.5im * λ * ((N₁ + 1) + N₁) J; J ω₂ - 0.5im * λ * ((N₂ + 1) + N₂)]\n",
"\n",
"# right-hand side for the \"vertical\" evolution\n",
"function fv!(out, _, _, _, t, t′)\n",
" out[1] = -1.0im * (H * GL[t, t′] + [[1.0im * N₁ * γ, 0] [0, 1.0im * N₂ * γ]] * GL[t, t′])\n",
" out[2] = -1.0im * (adjoint(H) * GG[t, t′] - 1.0im * [[(N₁ + 1), 0] [0, (N₂ + 1)]] * GG[t, t′])\n",
" out[1] = -1.0im * (H * GL[t, t′] + λ * [[1.0im * N₁, 0] [0, 1.0im * N₂]] * GL[t, t′])\n",
" out[2] = -1.0im * (adjoint(H) * GG[t, t′] - 1.0im * λ * [[(N₁ + 1), 0] [0, (N₂ + 1)]] * GG[t, t′])\n",
"end\n",
"\n",
"# right-hand side for the \"diagonal\" evolution\n",
"function fd!(out, _, _, _, t, t′)\n",
" out[1] = (-1.0im * (H * GL[t, t] - GL[t, t] * adjoint(H)\n",
" + 1.0im * γ * [[N₁ * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂) * (GL[2, 1, t, t] + GG[2, 1, t, t]) / 2] [(N₁ + N₂) * (GL[1, 2, t, t] + GG[1, 2, t, t]) / 2, N₂ * (GL[2, 2, t, t] + GG[2, 2, t, t])]])\n",
" + 1.0im * λ * [[N₁ * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂) * (GL[2, 1, t, t] + GG[2, 1, t, t]) / 2] [(N₁ + N₂) * (GL[1, 2, t, t] + GG[1, 2, t, t]) / 2, N₂ * (GL[2, 2, t, t] + GG[2, 2, t, t])]])\n",
" )\n",
" out[2] = (-1.0im * (adjoint(H) * GG[t, t] - GG[t, t] * H\n",
" - 1.0im * [[(N₁ + 1) * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂ + 2) * (GG[2, 1, t, t] + GL[2, 1, t, t]) / 2] [(N₁ + N₂ + 2) * (GG[1, 2, t, t] + GL[1, 2, t, t]) / 2, (N₂ + 1) * (GL[2, 2, t, t] + GG[2, 2, t, t])]])\n",
" - 1.0im * λ * [[(N₁ + 1) * (GL[1, 1, t, t] + GG[1, 1, t, t]), (N₁ + N₂ + 2) * (GG[2, 1, t, t] + GL[2, 1, t, t]) / 2] [(N₁ + N₂ + 2) * (GG[1, 2, t, t] + GL[1, 2, t, t]) / 2, (N₂ + 1) * (GL[2, 2, t, t] + GG[2, 2, t, t])]])\n",
" )\n",
"end;"
]
Expand Down Expand Up @@ -303,7 +303,7 @@
" ax.set_xticks([-T/2, -T/4, 0, T/4, T/2])\n",
" ax.xaxis.set_tick_params(pad=xpad)\n",
" ax.yaxis.set_tick_params(pad=ypad)\n",
" ax.set_ylabel(L\"-\\textrm{Im}\\, A_{ii}(T, \\tau)_W\")\n",
"# ax.set_ylabel(L\"-\\textrm{Im}\\, A_{ii}(T, \\tau)_W\")\n",
" ax.legend(loc=\"best\", handlelength=1.4, frameon=false, borderpad=0, labelspacing=0.25)\n",
"\n",
" ax = subplot(122)\n",
Expand All @@ -314,7 +314,7 @@
" ax.set_xticks([-10, -5, 0, 5, 10])\n",
" ax.xaxis.set_tick_params(pad=xpad)\n",
" ax.yaxis.set_tick_params(pad=ypad)\n",
" ax.set_ylabel(L\"-\\textrm{Im}\\, A_{ii}(T, \\omega)_{\\tilde{W}}\", labelpad=16)\n",
"# ax.set_ylabel(L\"-\\textrm{Im}\\, A_{ii}(T, \\omega)_{\\tilde{W}}\", labelpad=16)\n",
" ax.yaxis.set_label_position(\"right\")\n",
" ax.yaxis.set_ticks_position(\"both\")\n",
"\n",
Expand All @@ -323,19 +323,27 @@
" fig\n",
"end;"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bfd6711a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.8.0",
"display_name": "Julia 1.9.4",
"language": "julia",
"name": "julia-1.8"
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.2"
"version": "1.9.4"
}
},
"nbformat": 4,
Expand Down
Loading