Skip to content

Commit

Permalink
Add Horodecki state
Browse files Browse the repository at this point in the history
  • Loading branch information
Ye-Chao-Liu committed Jan 16, 2025
1 parent 54c6f1d commit 447c99a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ state_w_ket
state_w
state_dicke_ket
state_dicke
state_horodecki33
state_horodecki24
white_noise
white_noise!
```
Expand Down
55 changes: 55 additions & 0 deletions src/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,58 @@ function state_dicke(::Type{T}, k::Integer, N::Integer; v::Real = 1) where {T<:N
end
state_dicke(k::Integer, N::Integer; kwargs...) = state_dicke(ComplexF64, k, N; kwargs...)
export state_dicke

"""
state_horodecki33([T=ComplexF64,] a::Real)
Produces the 3 × 3 bipartite PPT-entangled Horodecki state with parameter `a`.
Reference: Paweł Horodecki, [arXiv:quant-ph/9703004](https://arxiv.org/abs/quant-ph/9703004)
"""
function state_horodecki33(::Type{T}, a::Real; v::Real = 1) where {T<:Number}
@assert 0 a 1 "Parameter `a` must be in [0, 1]"
x = (1 + a) / 2
y = sqrt(1 - a^2) / 2
rho = T[
a 0 0 0 a 0 0 0 a
0 a 0 0 0 0 0 0 0
0 0 a 0 0 0 0 0 0
0 0 0 a 0 0 0 0 0
a 0 0 0 a 0 0 0 a
0 0 0 0 0 a 0 0 0
0 0 0 0 0 0 x 0 y
0 0 0 0 0 0 0 a 0
a 0 0 0 a 0 y 0 x
]
rho ./= 8a + 1
return white_noise!(Hermitian(rho), v)
end
state_horodecki33(a::Real) = state_horodecki33(ComplexF64, a)
export state_horodecki33

"""
state_horodecki24([T=ComplexF64,] b::Real)
Produces the 2 × 4 bipartite PPT-entangled Horodecki state with parameter `b`.
Reference: Paweł Horodecki, [arXiv:quant-ph/9703004](https://arxiv.org/abs/quant-ph/9703004)
"""
function state_horodecki24(::Type{T}, b::Real; v::Real = 1) where {T<:Number}
@assert 0 b 1 "Parameter `b` must be in [0, 1]"
x = (1 + b) / 2
y = sqrt(1 - b^2) / 2
rho = T[
b 0 0 0 0 b 0 0
0 b 0 0 0 0 b 0
0 0 b 0 0 0 0 b
0 0 0 b 0 0 0 0
0 0 0 0 x 0 0 y
b 0 0 0 0 b 0 0
0 b 0 0 0 0 b 0
0 0 b 0 y 0 0 x
]
rho ./= 7b + 1
return white_noise!(Hermitian(rho), v)
end
state_horodecki24(b::Real) = state_horodecki24(ComplexF64, b)
export state_horodecki24
14 changes: 14 additions & 0 deletions test/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,19 @@
rho = state_supersinglet(T, 3)
@test U * rho * U' rho
@test kron(I(5),shift(5,3)*clock(5,2))*state_phiplus_ket(5) state_bell_ket(3,2,5)
rho = state_horodecki33(T, 1)
ref = Matrix{T}(I, 9, 9)
ref[1:4:9, 1:4:9] .= 1
ref ./= 9
@test rho ref
@test minimum(eigvals(partial_transpose(rho, 1))) 0
rho = state_horodecki24(T, 1)
ref = Matrix{T}(I, 8, 8)
ref[1:5:8, 1:5:8] .= 1
ref[2:5:8, 2:5:8] .= 1
ref[3:5:8, 3:5:8] .= 1
ref ./= 8
@test rho ref
@test minimum(eigvals(partial_transpose(rho, 1, [2, 4]))) 0
end
end

0 comments on commit 447c99a

Please sign in to comment.