Skip to content

Commit

Permalink
Create optics.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell04-wq authored May 31, 2024
1 parent eb0e22f commit 035423a
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/quantum_system_templates/optics.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@doc raw"""
Returns a `QuantumSystem` object for a quantum optics qubit, with the Hamiltonian
"""

using QuantumOptics


function OpticsSystem(;
N_cutoff::Int=10,
ωc::Float64=0.1,
ωa::Float64=0.1.
Ω::Float64=1.,
ωd::Float64=0.1,
ϵ::Float64=1.,
drives::Bool=true,
)
# Bases
b_fock = FockBasis(N_cutoff)
b_spin = SpinBasis(1//2)
b = b_fock b_spin
a = destroy(b_fock)
at = create(b_fock)
n = number(b_fock)

# Operators
sm = sigmam(b_spin)
sp = sigmap(b_spin)
sz = sigmaz(b_spin)

# Hamiltonian
Hatom = ωa*sz/2
Hfield = ωc*n
Hint = Ω*(atsm + asp)
H_drift = one(b_fock)Hatom + Hfieldone(b_spin) + Hint

if drives
H_drives = ϵ * a' + ϵ * a;
else
H_drives = Matrix{ComplexF64}[]
end

params = Dict{Symbol, Any}(
:N_cutoff => N_cutoff,
:ωc => ωc,
:ωa => ωa,
=> Ω,
:ωd => ωd,
=> ϵ,
)

return QuantumSystem(
H_drift,
H_drives;
constructor=OpticSystem,
params=params,
)
end

0 comments on commit 035423a

Please sign in to comment.