Skip to content
Closed
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
10 changes: 1 addition & 9 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,7 @@ interaction_picture_M_2modes_equal
```

```@docs
interaction_picture_A_2modes
```

```@docs
interaction_picture_A_3modes
```

```@docs
interaction_picture_A_4modes
interaction_picture_A
```

## [Correlations](@id API: Correlations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ 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)
A_uv = interaction_picture_A(gu_t, gv_t)
M_t = interaction_picture_M(A_uv, T)

# constant and time-dependent parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/08-1_pulse-delay__simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ nothing # hide

````@example 08-1_pulse-delay__simple
# interaction-picture coefficient matrix M(t) for u ↔ d
A_ud = interaction_picture_A_2modes(gu_, gin_)
A_ud = interaction_picture_A(gu_, gin_)
M_t = interaction_picture_M(A_ud, T)

M_ls = [M(i, j) for i = 1:la for j = 1:la]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A(t) = \frac{1}{2}\begin{bmatrix}
\end{bmatrix}
```

The functions [`interaction_picture_A_2modes`](@ref), [`interaction_picture_A_3modes`](@ref), and [`interaction_picture_A_4modes`](@ref) build the coupling matrices for two, three and four modes. For two equal modes ($u(t) = v(t)$) the analytic solution of $M(t)$ is provided by [`interaction_picture_M_2modes_equal`](@ref).
The function [`interaction_picture_A`](@ref) builds the coupling matrix for any number of modes. For two equal modes ($u(t) = v(t)$) the analytic solution of $M(t)$ is provided by [`interaction_picture_M_2modes_equal`](@ref).

Using the interaction picture for scattering with a Fock state $| n=20 \rangle$ on a two-level system, is demonstrated in the example [Interaction Picture Scattering with a Quantum Pulse](examples/06-1_interaction-picture__PRA2023_107-013706_fig2.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ 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)
A_uv = interaction_picture_A(gu_t, gv_t)
M_t = interaction_picture_M(A_uv, T)

## constant and time-dependent parameters
Expand Down
2 changes: 1 addition & 1 deletion examples/08-1_pulse-delay__simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ nothing # hide
#

## interaction-picture coefficient matrix M(t) for u ↔ d
A_ud = interaction_picture_A_2modes(gu_, gin_)
A_ud = interaction_picture_A(gu_, gin_)
M_t = interaction_picture_M(A_ud, T)

M_ls = [M(i, j) for i = 1:la for j = 1:la]
Expand Down
4 changes: 1 addition & 3 deletions src/QuantumInputOutput.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export SLH, # SLH.jl
two_time_corr_matrix,
interaction_picture_M, # interaction picture
interaction_picture_M_2modes_equal,
interaction_picture_A_2modes,
interaction_picture_A_3modes,
interaction_picture_A_4modes,
interaction_picture_A,
substitute_operators

include("SLH.jl")
Expand Down
98 changes: 32 additions & 66 deletions src/interaction_picture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,88 +61,54 @@ end
_as_time_function(x) = x isa Function ? x : (_ -> x)

"""
interaction_picture_A_2modes(g1, g2)
interaction_picture_A(gs)
interaction_picture_A(g1, g2, gs...)

Coefficient matrix `A(t)` for two virtual modes `(1, 2)`,
Coefficient matrix `A(t)` for `N` interacting modes with couplings `gs = [g_1, …, g_N]`.
All couplings may be time-dependent functions or constants.

The anti-Hermitian matrix has entries

```math
A(t) = \\frac{1}{2}
\\begin{bmatrix}
0 & g_1(t) g_2^*(t) \\\\
-g_1^*(t) g_2(t) & 0
\\end{bmatrix}
A_{ij}(t) = \\tfrac{1}{2}\\,g_i(t)\\,g_j^*(t), \\quad i < j,
\\qquad A_{ji} = -A_{ij}^*,
\\qquad A_{ii} = 0.
```

All couplings may be time-dependent or constant.
"""
function interaction_picture_A_2modes(g1, g2)
g1f = _as_time_function(g1)
g2f = _as_time_function(g2)
A(t) = 0.5 * [
0 g1f(t) * conj(g2f(t));
-conj(g1f(t)) * g2f(t) 0
]
return A
end
interaction_picture_A_2modes(g_ls) = interaction_picture_A_2modes(g_ls...)

"""
interaction_picture_A_3modes(g1, g2, g3)

Coefficient matrix `A(t)` for three interacting modes ordered as `(1, 2, 3)`
For two modes this gives

```math
A(t) = \\frac{1}{2}
\\begin{bmatrix}
0 & g_1(t) g_2^*(t) & g_1(t) g_3^*(t) \\\\
-g_1^*(t) g_2(t) & 0 & g_2(t) g_3^*(t) \\\\
-g_1^*(t) g_3(t) & -g_2^*(t) g_3(t) & 0
\\end{bmatrix}
0 & g_1(t)\\, g_2^*(t) \\\\
-g_1^*(t)\\, g_2(t) & 0
\\end{bmatrix},
```

All couplings may be time-dependent or constant.
"""
function interaction_picture_A_3modes(g1, g2, g3)
g1f = _as_time_function(g1)
g2f = _as_time_function(g2)
g3f = _as_time_function(g3)
A(t) =
0.5 * [
0 conj(g2f(t)) * g1f(t) g1f(t) * conj(g3f(t));
-g2f(t) * conj(g1f(t)) 0 g2f(t) * conj(g3f(t));
-conj(g1f(t)) * g3f(t) -conj(g2f(t)) * g3f(t) 0
]
return A
end

"""
interaction_picture_A_4modes(g1, g2, g3, g4)

Coefficient matrix `A(t)` for four interacting modes ordered as `(1, 2, 3, 4)`
and for three modes

```math
A(t) = \\frac{1}{2}
\\begin{bmatrix}
0 & g_1(t) g_2^*(t) & g_1(t) g_3^*(t) & g_1(t) g_4^*(t) \\\\
-g_1^*(t) g_2(t) & 0 & g_2(t) g_3^*(t) & g_2(t) g_4^*(t) \\\\
-g_1^*(t) g_3(t) & -g_2^*(t) g_3(t) & 0 & g_3(t) g_4^*(t) \\\\
-g_1^*(t) g_4(t) & -g_2^*(t) g_4(t) & -g_3^*(t) g_4(t) & 0
\\end{bmatrix}
0 & g_1(t)\\, g_2^*(t) & g_1(t)\\, g_3^*(t) \\\\
-g_1^*(t)\\, g_2(t) & 0 & g_2(t)\\, g_3^*(t) \\\\
-g_1^*(t)\\, g_3(t) & -g_2^*(t)\\, g_3(t) & 0
\\end{bmatrix}.
```

All couplings may be time-dependent or constant.
"""
function interaction_picture_A_4modes(g1, g2, g3, g4)
g1f = _as_time_function(g1)
g2f = _as_time_function(g2)
g3f = _as_time_function(g3)
g4f = _as_time_function(g4)
A(t) =
0.5 * [
0 g1f(t) * conj(g2f(t)) g1f(t) * conj(g3f(t)) g1f(t) * conj(g4f(t));
-conj(g1f(t)) * g2f(t) 0 g2f(t) * conj(g3f(t)) g2f(t) * conj(g4f(t));
-conj(g1f(t)) * g3f(t) -conj(g2f(t)) * g3f(t) 0 g3f(t) * conj(g4f(t));
-conj(g1f(t)) * g4f(t) -conj(g2f(t)) * g4f(t) -conj(g3f(t)) * g4f(t) 0
]
function interaction_picture_A(gs)
gfs = _as_time_function.(gs)
n = length(gfs)
function A(t)
g = [gf(t) for gf in gfs]
M = zeros(ComplexF64, n, n)
for i in 1:n, j in (i+1):n
M[i, j] = g[i] * conj(g[j])
M[j, i] = -conj(M[i, j])
end
return 0.5 * M
end
return A
end

interaction_picture_A(g1, g2, gs...) = interaction_picture_A([g1, g2, gs...])
2 changes: 1 addition & 1 deletion test/test_interaction_picture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ using Test
gv_t = v_to_gv(u, T)

# Interaction-picture coefficient matrices
A_uv = interaction_picture_A_2modes(gu_t, gv_t)
A_uv = interaction_picture_A(gu_t, gv_t)
M_num = interaction_picture_M(A_uv, T)
M_ana = interaction_picture_M_2modes_equal(u, T)

Expand Down
Loading