Interaction Picture Scattering with a Quantum Pulse

In this example, we study the scattering of a Fock state $| n = 20 \rangle$ on a two-level system, using the interaction picture introduced in Christiansen et al., Phys. Rev. A 107, 013706 (2023). We start by loading the packages and specifying the model.

using QuantumInputOutput
using QuantumOptics
using SecondQuantizedAlgebra
using SymbolicUtils
using Plots
using LaTeXStrings
# symbolic Hilbert space
hu = FockSpace(:u)
hs = NLevelSpace(:s, 2)
hv = FockSpace(:v)
h = hu ⊗ hs ⊗ hv

# symbolic operators
au_sym = Destroy(h, :a_u, 1)
av_sym = Destroy(h, :a_v, 3)
σ12_sym = Transition(h, :σ, 1, 2, 2)

# symbolic parameters
gu, γ, gv = rnumbers("gu γ gv")

# cascade the SLH elements
G_u = SLH(1, gu' * au_sym, 0)
G_s = SLH(1, sqrt(γ) * σ12_sym, 0)
G_v = SLH(1, gv' * av_sym, 0)
G_cas = ▷(G_u, G_s, G_v)
H = get_hamiltonian(G_cas)

\[-0.5 i gv \sqrt{\gamma} {\sigma}^{{12}} a_v^\dagger + 0.5 i gv \sqrt{\gamma} {\sigma}^{{21}} a_{v} -0.5 i gu \sqrt{\gamma} a_{u} {\sigma}^{{21}} -0.5 i gu gv a_{u} a_v^\dagger + 0.5 i gu gv a_u^\dagger a_{v} + 0.5 i gu \sqrt{\gamma} a_u^\dagger {\sigma}^{{12}}\]

L = get_lindblad(G_cas)[1]

\[gv a_{v} + \sqrt{\gamma} {\sigma}^{{12}} + gu a_{u}\]

Usually we deal with the above derived Hamiltonian and Lindblad. In this example, however, we transform the system into the interaction picture of the virtual cavity-cavity interaction Hamiltonian $H_{uv}$.

H_uv = get_hamiltonian(▷(G_u, G_v))

\[-0.5 i gu gv a_{u} a_v^\dagger + 0.5 i gu gv a_u^\dagger a_{v}\]

To do so, we first subtract $H_{uv}$ from $H$ and then replace the virtual cavity operators $a_v$ and $a_u$ as described in the Theory section.

H_int_sym_ = simplify(H - H_uv)

# symbolic coefficient matrix $M(t)$
M(i, j) = cnumber("M_{$(i)$(j)}")
a0_ls = [au_sym, av_sym]
la = length(a0_ls)
a_int_ls = [sum(M(i, j)*a0_ls[j] for j = 1:la) for i = 1:la]

# substitute interaction picture operators
int_dict = Dict([a0_ls; adjoint.(a0_ls)] .=> [a_int_ls; adjoint.(a_int_ls)])
H_int_sym = simplify(substitute_operators(H_int_sym_, int_dict))

\[0.5 i gv \sqrt{\gamma} M_{{22}} {\sigma}^{{21}} a_{v} -0.5 i {M_{21}^{*}} gv \sqrt{\gamma} a_u^\dagger {\sigma}^{{12}} + 0.5 i {M_{11}^{*}} gu \sqrt{\gamma} a_u^\dagger {\sigma}^{{12}} -0.5 i gu {{M_{11}^{*}}^{*}} \sqrt{\gamma} a_{u} {\sigma}^{{21}} + 0.5 i gu \sqrt{\gamma} {M_{12}^{*}} {\sigma}^{{12}} a_v^\dagger + 0.5 i M_{{21}} gv \sqrt{\gamma} a_{u} {\sigma}^{{21}} -0.5 i {{M_{12}^{*}}^{*}} gu \sqrt{\gamma} {\sigma}^{{21}} a_{v} -0.5 i {M_{22}^{*}} gv \sqrt{\gamma} {\sigma}^{{12}} a_v^\dagger\]

L_int_sym = simplify(substitute_operators(L, int_dict))

\[M_{{21}} gv a_{u} + {{M_{12}^{*}}^{*}} gu a_{v} + \sqrt{\gamma} {\sigma}^{{12}} + gv M_{{22}} a_{v} + gu {{M_{11}^{*}}^{*}} a_{u}\]

The above Hamiltonian and Lindblad operator are the ones in the interaction picture of the virtual cavity interaction. We define the numerical parameters of the system, calculate the solution for the coefficient matrix $M(t)$ and solve the time evolution of the system.

# numerical parameters
γ_ = 1.0
n_photons = 20

τ = 1 / γ_
t_p = 4 / γ_
u(t) = 1 / (sqrt(τ) * π^(1/4)) * exp(-0.5 * ((t - t_p) / τ)^2)

T_end = 12.0
T = [0:0.005:1;] * T_end

# virtual-cavity couplings for input/output modes
gu_t = u_to_gu(u, T)
gv_t = v_to_gv(u, T) # identical output mode v(t) = u(t)

# interaction-picture coefficient matrix M(t) for u ↔ v
A_uv = interaction_picture_A_2modes(gu_t, gv_t)
M_t = interaction_picture_M(A_uv, T)

# constant and time-dependent parameters
dict_p = Dict(γ => γ_)
M_ls = [M(i, j) for i = 1:la for j = 1:la]
M_t_ls = [t -> M_t(t)[i, j] for i = 1:la for j = 1:la]
p_t_sym = [gu, gv, M_ls...]
p_t_num = [gu_t, gv_t, M_t_ls...]
dict_p_t = Dict(p_t_sym .=> p_t_num)
# numerical basis
bu = FockBasis(n_photons, n_photons-5)
ba = NLevelBasis(2)
bv = FockBasis(5)
b = bu ⊗ ba ⊗ bv

H_int_QO = translate_qo(H_int_sym, b; parameter = dict_p, time_parameter = dict_p_t)
L_QO = translate_qo(L_int_sym, b; parameter = dict_p, time_parameter = dict_p_t)

function input_output(t, ρ)
    Ht = H_int_QO(t)
    J = [L_QO(t)]
    return Ht, J, dagger.(J)
end
# time evolution
ψ0 = fockstate(bu, n_photons) ⊗ nlevelstate(ba, 1) ⊗ fockstate(bv, 0)
t, ρt = timeevolution.master_dynamic(T, ψ0, input_output)

# numerical operators
au = destroy(bu) ⊗ one(ba) ⊗ one(bv)
av = one(bu) ⊗ one(ba) ⊗ destroy(bv)
σee = one(bu) ⊗ transition(ba, 2, 2) ⊗ one(bv)

n_u = real.(expect(au' * au, ρt))
n_v = real.(expect(av' * av, ρt))
P_e = real.(expect(σee, ρt))

We can see that the mean photon number of the initial temporal mode $u$ is reduced by less than two photons. This allows us to significantly reduce the numerical Hilbert space dimension. If the interaction picture is not used, the input cavity $u$ completely empties and the output cavity almost completely fills again.

p1 = plot(T, n_u; label = L"\langle n_u \rangle")
plot!(
    p1;
    xlabel = "tγ",
    ylabel = "excitations",
    ylims = (17.8, 20.2),
    grid = true,
    legend = :best,
)

p2 = plot(T, P_e; label = L"\langle \sigma_{ee} \rangle")
plot!(p2, T, n_v; label = L"\langle n_v \rangle", ls = :dash)
plot!(
    p2;
    xlabel = "tγ",
    ylabel = "excitations",
    ylims = (0, 1),
    grid = true,
    legend = :best,
)

plot(p1, p2; layout = (2, 1), size = (560, 420))
Example block output

Package versions

These results were obtained using the following versions:

using InteractiveUtils
versioninfo()

using Pkg
Pkg.status(
    [
        "QuantumInputOutput",
        "QuantumOptics",
        "SecondQuantizedAlgebra",
        "SymbolicUtils",
        "Plots",
        "LaTeXStrings",
    ],
    mode = PKGMODE_MANIFEST,
)
Julia Version 1.12.5
Commit 5fe89b8ddc1 (2026-02-09 16:05 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 9V74 80-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver4)
  GC: Built with stock GC
Threads: 4 default, 1 interactive, 4 GC (on 4 virtual cores)
Environment:
  JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager
  JULIA_DEBUG = Documenter
  JULIA_NUM_THREADS = auto
Status `~/work/QuantumInputOutput.jl/QuantumInputOutput.jl/docs/Manifest.toml`
  [b964fa9f] LaTeXStrings v1.4.0
  [91a5bcdd] Plots v1.41.6
  [18f9eda6] QuantumInputOutput v0.1.0 `~/work/QuantumInputOutput.jl/QuantumInputOutput.jl`
  [6e0679c1] QuantumOptics v1.2.4
  [f7aa4685] SecondQuantizedAlgebra v0.4.4
 [d1185830] SymbolicUtils v3.32.0
Info Packages marked with  have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`

This page was generated using Literate.jl.