Skip to content

Commit

Permalink
Add Dicke states
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendesignolle committed Jan 16, 2025
1 parent 5d2bd16 commit fb60ee5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SD - Properly add measurements/states from https://gitlab.com/tqo/sqma/ (add gen
CG - In _dps_constraints! bypass new variables when n = 1, as then only PPT is needed (minor technical issue)
CG - GME detection with DPS
CG - Basic state discrimination stuff
CG - state_dicke
LP - seesaw with fixed state
MA - signalling and non-signalling bounds for Bell inequalities
MA - canonical representation of Bell inequalities
Expand Down
2 changes: 2 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ state_ghz_ket
state_ghz
state_w_ket
state_w
state_dicke_ket
state_dicke
white_noise
white_noise!
```
Expand Down
38 changes: 37 additions & 1 deletion src/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ state_supersinglet_ket(N::Integer = 3; kwargs...) = state_supersinglet_ket(Compl
export state_supersinglet_ket

"""
state_supersinglet([T=ComplexF64,] N::Integer = 3; v::Real = 1, coeff = 1/√d)
state_supersinglet([T=ComplexF64,] N::Integer = 3; v::Real = 1)
Produces the `N`-partite `N`-level singlet state with visibility `v`.
This state is invariant under simultaneous rotations on all parties: `(U⊗…⊗U)ρ(U⊗…⊗U)'=ρ`.
Expand All @@ -218,3 +218,39 @@ function state_supersinglet(::Type{T}, N::Integer = 3; v::Real = 1) where {T<:Nu
end
state_supersinglet(N::Integer = 3; kwargs...) = state_supersinglet(ComplexF64, N; kwargs...)
export state_supersinglet

"""
state_dicke_ket([T=ComplexF64,] k::Integer, N::Integer; coeff = 1/√Cᴺₖ)
Produces the ket of the `N`-partite Dicke state with `k` excitations.
Reference: Robert H. Dicke [doi:10.1103/PhysRev.93.99](https://doi.org/10.1103/PhysRev.93.99)
"""
function state_dicke_ket(::Type{T}, k::Integer, N::Integer; coeff = inv(_sqrt(T, binomial(N, k)))) where {T<:Number}
psi = zeros(T, 2^N)
ind = zeros(Int8, N)
@inbounds for i in eachindex(psi)
if sum(ind) == k
psi[i] = coeff
end
_update_odometer!(ind, 2)
end
return psi
end
state_dicke_ket(k::Integer, N::Integer; kwargs...) = state_dicke_ket(ComplexF64, k, N; kwargs...)
export state_dicke_ket

"""
state_dicke([T=ComplexF64,] k::Integer, N::Integer; v::Real = 1)
Produces the `N`-partite Dicke state with `k` excitations.
Reference: Robert H. Dicke [doi:10.1103/PhysRev.93.99](https://doi.org/10.1103/PhysRev.93.99)
"""
function state_dicke(::Type{T}, k::Integer, N::Integer; v::Real = 1) where {T<:Number}
rho = ketbra(state_dicke_ket(T, k, N; coeff = one(T)))
parent(rho) ./= binomial(N, k)
return white_noise!(rho, v)
end
state_dicke(k::Integer, N::Integer; kwargs...) = state_dicke(ComplexF64, k, N; kwargs...)
export state_dicke
3 changes: 3 additions & 0 deletions test/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
@test ketbra(ψ) state_w(T)
coeff = T.([1, 2, 2]) / 9
@test state_w_ket(T; coeff) == T.(ket(2, 8) + 2 * ket(3, 8) + 2 * ket(5, 8)) / 9
ψ = state_dicke_ket(T, 2, 3)
@test ψ == inv(sqrt(R(3))) * (ket(4, 8) + ket(6, 8) + ket(7, 8))
@test ketbra(ψ) state_dicke(T, 2, 3)
ψ = state_ghz_ket(T)
@test ψ == inv(sqrt(R(2))) * (ket(1, 8) + ket(8, 8))
@test ketbra(ψ) state_ghz(T)
Expand Down

0 comments on commit fb60ee5

Please sign in to comment.