Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 9 additions & 0 deletions .github/scripts/fix-timestamps
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

# This script fixes the timestamps of all files in the current git repository

git ls-tree -r --name-only HEAD | while read filename; do
unixtime=$(git log -1 --format="%at" -- "${filename}")
touchtime=$(date -d @$unixtime +'%Y%m%d%H%M.%S')
touch -t ${touchtime} "${filename}"
done
8 changes: 2 additions & 6 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
with:
precompile: true
- uses: cardinalby/export-env-action@v2
with:
envFile: '_environment'
expand: 'true'
- name: Fix Timestamps
run: bash .github/scripts/fix-timestamps
- name: Quarto Render
uses: quarto-dev/quarto-actions/render@v2
with:
to: html
- name: Deploy PR Preview
uses: rossjrw/[email protected]
with:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # either one of the following three cases
- cron: '0 0 * * 0' # weekly (every Sunday)

push:
branches: main
branches: [main]

jobs:
build:
Expand All @@ -26,10 +26,8 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
with:
precompile: true
- uses: cardinalby/export-env-action@v2
with:
envFile: '_environment'
expand: 'true'
- name: Fix Timestamps
run: bash .github/scripts/fix-timestamps
- name: Quarto Render
uses: quarto-dev/quarto-actions/render@v2
with:
Expand Down
8 changes: 6 additions & 2 deletions HierarchicalEOM.jl/SIAM.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Single-impurity Anderson model"
author: Yi-Te Huang
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

## Introduction
Expand All @@ -27,6 +29,8 @@ Now, we need to build the system Hamiltonian and initial state with the package
```{julia}
using HierarchicalEOM # this automatically loads `QuantumToolbox`
using CairoMakie # for plotting results

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -88,7 +92,7 @@ dos = DensityOfStates(M_odd, ados_s, d_up, ωlist)
plot the results

```{julia}
fig = Figure(size = (500, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = L"\omega")
lines!(ax, ωlist, dos)

Expand Down
14 changes: 9 additions & 5 deletions HierarchicalEOM.jl/cavityQED.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Cavity QED system"
author: Shen-Liang Yang, Yi-Te Huang
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

## Introduction
Expand Down Expand Up @@ -41,6 +43,8 @@ Now, we need to build the system Hamiltonian and initial state with the package
```{julia}
using HierarchicalEOM # this automatically loads `QuantumToolbox`
using CairoMakie # for plotting results

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -96,7 +100,7 @@ Ct = correlation_function(Bath, tlist_test);
Ct2 = correlation_function(Bath_test, tlist_test)

# plot
fig = Figure(size = (500, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = L"t", ylabel = L"C(t)")
lines!(ax, tlist_test, real(Ct2), label = L"$N=1000$ (real part)", linestyle = :solid)
lines!(ax, tlist_test, real(Ct), label = L"$N=20$ (real part)", linestyle = :dash)
Expand Down Expand Up @@ -154,7 +158,7 @@ np_steady_H = expect(a' * a, steady_H)
plot results

```{julia}
fig = Figure(size = (600, 350))
fig = Figure()

ax1 = Axis(fig[1, 1], xlabel = L"t")
lines!(ax1, t_list, σz_evo_H, label = L"\langle \sigma_z \rangle", linestyle = :solid)
Expand All @@ -176,7 +180,7 @@ fig
psd_H = PowerSpectrum(M_Heom, steady_H, a, ω_list)

# plot
fig = Figure(size = (500, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = L"\omega")
lines!(ax, ω_list, psd_H)

Expand Down Expand Up @@ -223,7 +227,7 @@ np_steady_M = expect(a' * a, steady_M);
plot results

```{julia}
fig = Figure(size = (600, 350))
fig = Figure()

ax1 = Axis(fig[1, 1], xlabel = L"t")
lines!(ax1, t_list, σz_evo_M, label = L"\langle \sigma_z \rangle", linestyle = :solid)
Expand Down
10 changes: 7 additions & 3 deletions HierarchicalEOM.jl/dynamical_decoupling.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Driven systems and dynamical decoupling"
author: Yi-Te Huang
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

Inspirations taken from an example in QuTiP-BoFiN article [@QuTiP-BoFiN2023].
Expand Down Expand Up @@ -37,6 +39,8 @@ Now, we need to build the system Hamiltonian and initial state with the package
```{julia}
using HierarchicalEOM # this automatically loads `QuantumToolbox`
using CairoMakie # for plotting results

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -91,7 +95,7 @@ fastTuple = (V = amp_fast, Δ = delay)
slowTuple = (V = amp_slow, Δ = delay)

# plot
fig = Figure(size = (600, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = L"t")
lines!(ax, tlist, [pulse(fastTuple, t) for t in tlist], label = "Fast Pulse", linestyle = :solid)
lines!(ax, tlist, [pulse(slowTuple, t) for t in tlist], label = "Slow Pulse", linestyle = :dash)
Expand Down Expand Up @@ -152,7 +156,7 @@ slowPulseSol = HEOMsolve(M, ψ0, tlist; e_ops = [ρ01], H_t = H_D, params = slow
## Plot the coherence

```{julia}
fig = Figure(size = (600, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = L"t", ylabel = L"\rho_{01}")
lines!(ax, tlist, real(fastPulseSol.expect[1, :]), label = "Fast Pulse", linestyle = :solid)
lines!(ax, tlist, real(slowPulseSol.expect[1, :]), label = "Slow Pulse", linestyle = :dot)
Expand Down
8 changes: 6 additions & 2 deletions HierarchicalEOM.jl/electronic_current.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Electronic Current"
author: Yi-Te Huang
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

Inspirations taken from [qutip documentation](https://qutip.org/documentation.html).
Expand All @@ -28,6 +30,8 @@ Now, we need to build the system Hamiltonian and initial state with the package
```{julia}
using HierarchicalEOM # this automatically loads `QuantumToolbox`
using CairoMakie # for plotting results

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -149,7 +153,7 @@ end
plot the result

```{julia}
fig = Figure(size = (500, 350))
fig = Figure()
ax = Axis(fig[1, 1], xlabel = "time", ylabel = "Current")
lines!(ax, tlist, Ie_L, label = "Bath L", color = :blue, linestyle = :solid)
lines!(ax, tlist, Ie_R, label = "Bath R", color = :red, linestyle = :solid)
Expand Down
23 changes: 14 additions & 9 deletions QuantumToolbox.jl/time_evolution/Dicke.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "The Dicke Model"
author: Li-Xun Cai
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

Inspirations taken from [this QuTiP tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/lectures/Lecture-3A-Dicke-model.ipynb) by J. R. Johansson.
Expand Down Expand Up @@ -48,6 +50,8 @@ This formulation reduces complexity, as it allows us to work on a collective bas
```{julia}
using QuantumToolbox
using CairoMakie

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -105,7 +109,7 @@ Jzvec = expect(Jz0, ψGs);
```

```{julia}
fig = Figure(size = (800, 300))
fig = Figure(size=(900, 350))
axn = Axis(
fig[1,1],
xlabel = "interaction strength",
Expand All @@ -119,7 +123,7 @@ axJz = Axis(
ylims!(-N0/2, N0/2)
lines!(axn, gs, real(nvec))
lines!(axJz, gs, real(Jzvec))
display(fig);
fig
```
The expectation value of photon number and $\hat{J}_z$ showed a sudden increment around $g_c$.

Expand All @@ -140,11 +144,12 @@ for (hpos, idx) in enumerate(cases)

# plot fock distribution
_, ax2 = plot_fock_distribution(ρcav, location = fig[2,hpos])

ax2.xticks = (0:2:size(ρcav,1)-1, string.(0:2:size(ρcav,1)-1))

if hpos != 1
ax.xlabelvisible, ax.ylabelvisible, ax2.ylabelvisible = fill(false, 3)
ax.xticksvisible, ax.yticksvisible, ax2.yticksvisible = fill(false, 3)
ax2.yticks = (0:0.5:1, ["" for i in 0:0.5:1])
hideydecorations!(ax, ticks=false)
hideydecorations!(ax2, ticks=false)
if hpos == 5 # Add colorbar with the last returned heatmap (_hm)
Colorbar(fig[1,6], hm)
end
Expand All @@ -158,7 +163,7 @@ lines!(ax3, gs, real(nvec), color=:teal)
ax3.xlabelsize, ax3.ylabelsize = 20, 20
vlines!(ax3, gs[cases], color=:orange, linestyle = :dash, linewidth = 4)

display(fig);
fig
```
As $g$ increases, the cavity ground state's wigner function plot looks more coherent than a thermal state.

Expand All @@ -174,7 +179,7 @@ end;
```

```{julia}
fig = Figure(size=(800, 400))
fig = Figure(size=(900, 400))
ax = Axis(fig[1,1])
ax.xlabel = "coupling strength"
ax.ylabel = "mutual entropy"
Expand All @@ -184,7 +189,7 @@ for (idx, slist) in enumerate(slists)
end

Legend(fig[1,2], ax, label = "number of atoms")
display(fig);
fig
```
We further consult mutual entropy between the cavity and the spins as a measure of their correlation; the result showed that as the number of atoms $N$ increases, the peak of mutual entropy moves closer to $g_c$.

Expand Down
14 changes: 9 additions & 5 deletions QuantumToolbox.jl/time_evolution/adiabatic.qmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
title: "Adiabatic sweep (with `QuantumObjectEvolution`)"
author: Li-Xun Cai
date: 2025-05-22 # last update (keep this comment as a reminder)
date: last-modified

engine: julia
---

Inspirations taken from [the QuTiP tutorial](https://nbviewer.org/urls/qutip.org/qutip-tutorials/tutorials-v5/lectures/Lecture-8-Adiabatic-quantum-computing.ipynb) by J. R. Johansson.
Expand Down Expand Up @@ -40,6 +42,8 @@ where the parameter $T$ determines how slow the Hamiltonian changes in time.
```{julia}
using QuantumToolbox
using CairoMakie

CairoMakie.activate!(type = "svg")
```

```{julia}
Expand Down Expand Up @@ -104,15 +108,15 @@ end
```

```{julia}
fig = Figure(size=(800, 400))
fig = Figure(size=(900, 400))
ax = Axis(fig[1,1], xticks = (0:0.25:1, ["$(t)T" for t in 0:0.25:1]))

for idx in 1:20 # only check for the lowest 20 eigenvalues
color = (idx == 1) ? :magenta : (:gray,0.5)
lines!(ax, range(0,1,length(tlist)), eigs[:,idx], label = string(idx), color = color)
end

display(fig)
fig
```

The plot shows that the gap is nonvanishing and thus validates the evolution. So we proceed to check the expectation value dynamics of the final Hamiltonian and the fidelity dynamics to the truthful ground state throughout the evolution.
Expand All @@ -127,7 +131,7 @@ end;
```

```{julia}
fig = Figure(size=(800, 400))
fig = Figure(size=(900, 400))
axs = Axis.([fig[1,1], fig[1,2]])
axs[1].title = L"\langle H_f \rangle"
axs[1].xticks = (0:0.25:1, ["$(t)T" for t in 0:0.25:1])
Expand All @@ -143,7 +147,7 @@ end

Legend(fig[1,3], axs[1], L"T")

display(fig)
fig
```
As the plot showed, the fidelity between the prepared final state and the truthful ground state reaches 1 as the total evolution time $T$ increases, showcasing the requirement of the adiabatic theorem that the change has to be gradual.

Expand Down
Loading