@@ -197,13 +197,7 @@ is_solved_and_feasible(model)
197197# of your variables after optimization is done, with the function call `value(x)`
198198# to obtain the value of variable `x`.
199199
200- value .(m[1 ][1 , 1 ])
201-
202- # A subtlety is that, unlike YALMIP, the function `value` is only defined for
203- # scalars. For vectors and matrices you need to use Julia broadcasting:
204- # `value.(v)`.
205-
206- value .(m[1 ])
200+ value (x)
207201
208202# There is also a specialized function for extracting the value of the objective,
209203# `objective_value(model)`, which is useful if your objective doesn't have a
@@ -365,18 +359,18 @@ function random_state_pure(d)
365359end
366360
367361function robustness_jump (d)
368- rho = random_state_pure (d^ 2 )
362+ ρ = random_state_pure (d^ 2 )
369363 id = LinearAlgebra. Hermitian (LinearAlgebra. I (d^ 2 ))
370- rhoT = LinearAlgebra. Hermitian (partial_transpose (rho , 1 , [d, d]))
364+ ρᵀ = LinearAlgebra. Hermitian (partial_transpose (ρ , 1 , [d, d]))
371365 model = Model (Clarabel. Optimizer)
372366 set_attribute (model, " verbose" , false )
373367 @variable (model, λ)
374- @constraint (model, PPT, rhoT + λ * id in HermitianPSDCone ())
368+ @constraint (model, PPT, ρᵀ + λ * id in HermitianPSDCone ())
375369 @objective (model, Min, λ)
376370 optimize! (model)
377371 assert_is_solved_and_feasible (model; allow_almost = true )
378- WT = dual (PPT)
379- return value (λ), real ( LinearAlgebra. dot (WT, rhoT) )
372+ Wᵀ = dual (PPT)
373+ return value (λ), LinearAlgebra. dot (Wᵀ, ρᵀ )
380374end
381375
382376robustness_jump (3 )
0 commit comments