Skip to content

Commit

Permalink
not a projection
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoms committed Aug 3, 2024
1 parent 7dd4248 commit 044b06a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/entanglement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function schmidt_number(
is_complex = (T <: Complex)
wrapper = is_complex ? LA.Hermitian : LA.Symmetric

Π = kron(LA.I(dims[1]), SA.sparse(state_ghz_ket(T, s, 2; coeff = 1)), LA.I(dims[2]))'
V = kron(LA.I(dims[1]), SA.sparse(state_ghz_ket(T, s, 2; coeff = 1)), LA.I(dims[2]))
lifted_dims = [dims[1] * s, dims[2] * s] # with the ancilla spaces A'B'...

model = JuMP.GenericModel{_solver_type(T)}()
Expand All @@ -173,7 +173,7 @@ function schmidt_number(
noisy_state = wrapper* ρ + (1 - λ) * LA.I(size(ρ, 1)) / size(ρ, 1))
JuMP.@objective(model, Max, λ)

_dps_constraints!(model, noisy_state, lifted_dims, n; ppt, is_complex, projection = Π)
_dps_constraints!(model, noisy_state, lifted_dims, n; ppt, is_complex, isometry = V)
JuMP.@constraint(model, LA.tr(model[:reduced]) == s)

JuMP.set_optimizer(model, solver)
Expand Down Expand Up @@ -249,7 +249,7 @@ function _dps_constraints!(
n::Integer;
ppt::Bool = true,
is_complex::Bool = true,
projection::AbstractMatrix = LA.I(size(ρ, 1))
isometry::AbstractMatrix = LA.I(size(ρ, 1))
) where {T}
LA.ishermitian(ρ) || throw(ArgumentError("State must be Hermitian"))

Expand All @@ -272,7 +272,7 @@ function _dps_constraints!(
lifted = wrapper(V * s * V')
JuMP.@expression(model, reduced, partial_trace(lifted, 3:n+1, ext_dims))

JuMP.@constraint(model, witness_constraint, ρ == wrapper(projection * reduced * projection'))
JuMP.@constraint(model, witness_constraint, ρ == wrapper(isometry' * reduced * isometry))

if ppt
for i in 2:n+1
Expand Down

0 comments on commit 044b06a

Please sign in to comment.