Skip to content

Commit

Permalink
Merge pull request #92 from hongyehu/main
Browse files Browse the repository at this point in the history
Add Rydberg atom chain quantum system
  • Loading branch information
aarontrowbridge authored May 13, 2024
2 parents f6009da + 19a44c6 commit 2ab6a41
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/quantum_system_templates/_quantum_system_templates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ module QuantumSystemTemplates
export TransmonSystem
export TransmonDipoleCoupling
export MultiTransmonSystem
export RydbergChainSystem

using ..QuantumUtils
using ..QuantumSystems

using LinearAlgebra

include("transmons.jl")
include("rydberg.jl")

end
91 changes: 91 additions & 0 deletions src/quantum_system_templates/rydberg.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
@doc raw"""
RydbergChainSystem(;
C::Float64=862690*2π,
distance::Float64=10.0, # μm
cutoff_order::Int=2, # 1 is nearest neighbor, 2 is next-nearest neighbor, etc.
local_detune::Bool=false, # If true, include one local detuning pattern.
) -> QuantumSystem
Returns a `QuantumSystem` object for the Rydberg atom chain in the spin basis
|g⟩ = |0⟩ = [1, 0], |r⟩ = |1⟩ = [0, 1].
```math
H = \sum_i 0.5*\Omega_i(t)\cos(\phi_i(t)) \sigma_i^x - 0.5*\Omega_i(t)\sin(\phi_i(t)) \sigma_i^y - \sum_i \Delta_i(t)n_i + \sum_{i<j} \frac{C}{|i-j|^6} n_i n_j
```
# Keyword Arguments
- `C`: The Rydberg interaction strength in MHz*μm^6.
- `distance`: The distance between atoms in μm.
- `cutoff_order`: Interaction range cutoff, 1 is nearest neighbor, 2 is next nearest neighbor.
- `local_detune`: If true, include one local detuning pattern.
"""
function generate_pattern(N::Int, i::Int)
# Create an array filled with 'I'
qubits = fill('I', N)
# Insert 'n' at position i and i+1, ensuring it doesn't exceed the array bounds
if i <= N && i+1 <= N
qubits[i] = 'n'
qubits[i+1] = 'n'
end
return join(qubits)
end
function generate_pattern_with_gap(N::Int, i::Int, gap::Int)
# Create an array filled with 'I'
qubits = fill('I', N)
# Insert 'n' at position i and i+gap+1, ensuring it doesn't exceed the array bounds
if i <= N && i+gap+1 <= N
qubits[i] = 'n'
qubits[i+gap+1] = 'n'
end
return join(qubits)
end
"""
Embed a character into a string at a specific position.
"""
function lift(x::Char,i::Int, N::Int)
qubits = fill('I', N)
qubits[i] = x
return join(qubits)
end

function RydbergChainSystem(;
N::Int=3, # number of atoms
C::Float64=862690*2π,
distance::Float64=10.0, # μm
cutoff_order::Int=1, # 1 is nearest neighbor, 2 is next-nearest neighbor, etc.
local_detune::Bool=false,
)
PAULIS = Dict("I" => [1 0; 0 1], "X" => [0 1; 1 0], "Y" => [0 -im; im 0], "Z" => [1 0; 0 -1], "n" => [0 0; 0 1])
if cutoff_order == 1
H_drift = sum([C*kron_from_dict(generate_pattern(N,i),PAULIS)/(distance^6) for i in 1:N-1])
elseif cutoff_order == 2
H_drift = sum([C*kron_from_dict(generate_pattern(N,i),PAULIS)/(distance^6) for i in 1:N-1])
H_drift += sum([C*kron_from_dict(generate_pattern_with_gap(N,i,1),PAULIS)/((2*distance)^6) for i in 1:N-2])
else
error("Higher cutoff order not supported")
end
H_drives = Matrix{ComplexF64}[]
# Add global X drive
Hx = sum([0.5*kron_from_dict(lift('X',i,N), PAULIS) for i in 1:N])
push!(H_drives, Hx)
# Add global Y drive
Hy = sum([0.5*kron_from_dict(lift('Y',i,N), PAULIS) for i in 1:N])
push!(H_drives, Hy)
# Add global detuning
H_detune = -sum([kron_from_dict(lift('n',i,N), PAULIS) for i in 1:N])
push!(H_drives, H_detune)
params = Dict{Symbol, Any}(
:N => N,
:C => C,
:distance => distance,
:cutoff_order => cutoff_order,
:local_detune => local_detune,
)
return QuantumSystem(
H_drift,
H_drives;
constructor=RydbergChainSystem,
params=params,
)
end

0 comments on commit 2ab6a41

Please sign in to comment.