Skip to content

Commit f08c85a

Browse files
committed
Update
1 parent a167d84 commit f08c85a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/src/tutorials/getting_started/transitioning_from_matlab.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
# The purpose of this tutorial is to help new users to JuMP who have previously
2828
# used YALMIP or CVX by comparing and contrasting their different features.
2929

30+
# !!!tip
31+
# If you have not used Julia before, read the [Getting started with Julia](@ref)
32+
# tutorial.
33+
3034
# ## Namespaces
3135

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

269273
# ## Rosetta stone
270274

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

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

307311
function robustness_jump(d)
308312
rho = random_state_pure(d^2)
309-
id = LinearAlgebra.I(d^2)
310-
rhoT = partial_transpose(rho, 1, [d, d])
313+
id = LinearAlgebra.Hermitian(LinearAlgebra.I(d^2))
314+
rhoT = LinearAlgebra.Hermitian(partial_transpose(rho, 1, [d, d]))
311315
model = Model()
312316
@variable(model, λ)
313-
@constraint(
314-
model,
315-
PPT,
316-
LinearAlgebra.Hermitian(rhoT + λ * id) in HermitianPSDCone(),
317-
)
317+
@constraint(model, PPT, rhoT + λ * id in HermitianPSDCone())
318318
@objective(model, Min, λ)
319319
set_optimizer(model, Clarabel.Optimizer)
320320
set_attribute(model, "verbose", true)

0 commit comments

Comments
 (0)