From 77fdf3708a087edcf49b7644d7c09c000fa34b4e Mon Sep 17 00:00:00 2001 From: Hong-Ye Hu Date: Tue, 7 May 2024 13:35:54 -0400 Subject: [PATCH 1/4] add rydberg quantumsystem --- .../_quantum_system_templates.jl | 2 + src/quantum_system_templates/rydberg.jl | 92 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/quantum_system_templates/rydberg.jl diff --git a/src/quantum_system_templates/_quantum_system_templates.jl b/src/quantum_system_templates/_quantum_system_templates.jl index 51694174..4cee2bd0 100644 --- a/src/quantum_system_templates/_quantum_system_templates.jl +++ b/src/quantum_system_templates/_quantum_system_templates.jl @@ -3,6 +3,7 @@ module QuantumSystemTemplates export TransmonSystem export TransmonDipoleCoupling export MultiTransmonSystem +export RydbergChainSystem using ..QuantumUtils using ..QuantumSystems @@ -10,5 +11,6 @@ using ..QuantumSystems using LinearAlgebra include("transmons.jl") +include("rydberg.jl") end diff --git a/src/quantum_system_templates/rydberg.jl b/src/quantum_system_templates/rydberg.jl new file mode 100644 index 00000000..98304e6d --- /dev/null +++ b/src/quantum_system_templates/rydberg.jl @@ -0,0 +1,92 @@ +using QuantumCollocation +@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 [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)/(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 \ No newline at end of file From 92f12ae516a43c9560e4fe133e8728c19ed86f02 Mon Sep 17 00:00:00 2001 From: Hong-Ye Hu Date: Tue, 7 May 2024 13:39:05 -0400 Subject: [PATCH 2/4] add comments --- src/quantum_system_templates/rydberg.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quantum_system_templates/rydberg.jl b/src/quantum_system_templates/rydberg.jl index 98304e6d..a9ef532b 100644 --- a/src/quantum_system_templates/rydberg.jl +++ b/src/quantum_system_templates/rydberg.jl @@ -24,7 +24,7 @@ H = \sum_i 0.5*\Omega_i(t)\cos(\phi_i(t)) \sigma_i^x - 0.5*\Omega_i(t)\sin(\phi_ function generate_pattern(N::Int, i::Int) # Create an array filled with 'I' qubits = fill('I', N) - # Insert 'Z' at position i and i+1, ensuring it doesn't exceed the array bounds + # 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' @@ -34,7 +34,7 @@ end function generate_pattern_with_gap(N::Int, i::Int, gap::Int) # Create an array filled with 'I' qubits = fill('I', N) - # Insert 'Z' at position i and i+gap+1, ensuring it doesn't exceed the array bounds + # 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' From f2d1b90637101fca6691c65873563716b14d6e98 Mon Sep 17 00:00:00 2001 From: Hong-Ye Hu Date: Tue, 7 May 2024 13:40:15 -0400 Subject: [PATCH 3/4] change a bug --- src/quantum_system_templates/rydberg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quantum_system_templates/rydberg.jl b/src/quantum_system_templates/rydberg.jl index a9ef532b..ad7ca3d1 100644 --- a/src/quantum_system_templates/rydberg.jl +++ b/src/quantum_system_templates/rydberg.jl @@ -62,7 +62,7 @@ function RydbergChainSystem(; 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)/(distance^6) for i in 1:N-2]) + 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 From 19a44c6e9b1cdd5ff1d30661e526a1430fceb94b Mon Sep 17 00:00:00 2001 From: Hong-Ye Hu Date: Tue, 7 May 2024 14:04:15 -0400 Subject: [PATCH 4/4] update --- src/quantum_system_templates/rydberg.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/quantum_system_templates/rydberg.jl b/src/quantum_system_templates/rydberg.jl index ad7ca3d1..70042e72 100644 --- a/src/quantum_system_templates/rydberg.jl +++ b/src/quantum_system_templates/rydberg.jl @@ -1,4 +1,3 @@ -using QuantumCollocation @doc raw""" RydbergChainSystem(; C::Float64=862690*2π,