Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Mar 5, 2024
1 parent a167d84 commit f08c85a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/src/tutorials/getting_started/transitioning_from_matlab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
# The purpose of this tutorial is to help new users to JuMP who have previously
# used YALMIP or CVX by comparing and contrasting their different features.

# !!!tip
# If you have not used Julia before, read the [Getting started with Julia](@ref)
# tutorial.

# ## Namespaces

# Julia has namespaces, which MATLAB lacks. Therefore one needs to either use
Expand Down Expand Up @@ -268,9 +272,9 @@ objective_value(model)

# ## Rosetta stone

# To finish this tutorial, we show a complete example of the same optimization
# problem being solved with JuMP, YALMIP, and CVX. It is a semidefinite program
# that computes a lower bound on the random robustness of entanglement using the
# In this section, we show a complete example of the same optimization problem
# being solved with JuMP, YALMIP, and CVX. It is a semidefinite program that
# computes a lower bound on the random robustness of entanglement using the
# partial transposition criterion.

# The code is complete, apart from the function that does partial transposition.
Expand Down Expand Up @@ -306,15 +310,11 @@ end

function robustness_jump(d)
rho = random_state_pure(d^2)
id = LinearAlgebra.I(d^2)
rhoT = partial_transpose(rho, 1, [d, d])
id = LinearAlgebra.Hermitian(LinearAlgebra.I(d^2))
rhoT = LinearAlgebra.Hermitian(partial_transpose(rho, 1, [d, d]))
model = Model()
@variable(model, λ)
@constraint(
model,
PPT,
LinearAlgebra.Hermitian(rhoT + λ * id) in HermitianPSDCone(),
)
@constraint(model, PPT, rhoT + λ * id in HermitianPSDCone())
@objective(model, Min, λ)
set_optimizer(model, Clarabel.Optimizer)
set_attribute(model, "verbose", true)
Expand Down

0 comments on commit f08c85a

Please sign in to comment.