Cascaded Cavities Example

This example demonstrates how to create and compose quantum systems using the SLH framework by building a cascaded cavity system.

Setup

First, we import the required packages:

using SLHQuantumSystems
using SecondQuantizedAlgebra

Creating the Hilbert Space and Operators

We start by defining a Fock space for our cavity and the associated operators:

Create a Hilbert space and operators

hilb = FockSpace(:cavity)

@qnumbers a::Destroy(hilb)
@cnumbers ω κ
(ω, κ)

Defining System Components

In the SLH framework, each system is characterized by three components:

  • S: Scattering matrix (direct input-output coupling)
  • L: Coupling vector (system-environment interaction)
  • H: System Hamiltonian (internal dynamics)

For a simple cavity, we define:

Define system components

H = ω * a' * a      # Harmonic oscillator Hamiltonian
L = [sqrt(κ) * a]   # Coupling to environment (decay)
S = [1]             # No direct scattering
1-element Vector{Int64}:
 1

Building the Cascaded System

Now we create two identical cavity systems and connect them in a cascade:

Create SLH systems

cavityA = SLH(:A, [:in], [:out], S, L, H)
cavityB = SLH(:B, [:in], [:out], S, L, H)
SLH{Vector{Int64}, Vector{SecondQuantizedAlgebra.QMul{Nothing}}, SecondQuantizedAlgebra.QMul{Nothing}}(:B, [:in], [:out], [1], SecondQuantizedAlgebra.QMul{Nothing}[sqrt(κ)*(a)], ω*(a′*a))

System Composition

We concatenate the systems in a chain configuration, then apply feedback to connect the output of cavity A to the input of cavity B:

sys = concatenate([cavityA, cavityB], :chain)
sys = feedbackreduce(sys, :A_out, :B_in)
SLH{Matrix{Float64}, Vector{SecondQuantizedAlgebra.QAdd}, SecondQuantizedAlgebra.QAdd}(:chain, [:A_in], [:B_out], [1.0;;], SecondQuantizedAlgebra.QAdd[(sqrt(B_κ)*(B_a)+sqrt(A_κ)*(A_a))], (A_ω*(A_a′*A_a)+B_ω*(B_a′*B_a)+(0.0 - 0.5im)*sqrt(A_κ)*conj(sqrt(B_κ))*(A_a*B_a′)+(-0.0 + 0.5im)*conj(sqrt(A_κ))*sqrt(B_κ)*(A_a′*B_a)))

Results

Let's examine the resulting system:

println("Combined system Hamiltonian:")
println(sys.H)

println("\nSystem operators:")
println(operators(sys))

println("\nSystem parameters:")
println(parameters(sys))
Combined system Hamiltonian:
(A_ω*(A_a′*A_a)+B_ω*(B_a′*B_a)+(0.0 - 0.5im)*sqrt(A_κ)*conj(sqrt(B_κ))*(A_a*B_a′)+(-0.0 + 0.5im)*conj(sqrt(A_κ))*sqrt(B_κ)*(A_a′*B_a))

System operators:
Set(SecondQuantizedAlgebra.QNumber[A_a, B_a′, A_a′, B_a])

System parameters:
Set(SymbolicUtils.Symbolic[B_κ, B_ω, A_κ, A_ω])

This page was generated using Literate.jl.