# Enforce a matrix to be positive semidefinite in JuMP

**URL:** <https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853>\
**Category:** Optimization (Mathematical)\
**Created:** [July 29, 2020, 2:46am UTC](https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853 "2020-07-29T02:46:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasoul](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Rasoul](https://discourse.julialang.org/u/Rasoul)\
**Post date:** [July 29, 2020, 2:46am UTC](https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853/1 "2020-07-29T02:46:23Z")

</div>

Hi All,

I want to enforce a square matrix in my code (i.e. W) to be positive semidefinite. I am using Gurobi solver. I have added the following constraint in my code to fulfill the task.

```julia
@constraint (model, W in PSDcone())

```

Following is the error that I have got after running the code.

ERROR: LoadError: Constraints of type MathOptInterface.VectorOfVariables-in-MathOptInterface.PositiveSemidefiniteConeSquare are not supported by the solver and there are no bridges that can reformulate it into supported constraints.

I will appreciate it if you help me to debug my code! Thanks in advance!

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [July 29, 2020, 9:34am UTC](https://discourse.julialang.org/t/enforce-a-matrix-to-be-positive-semidefinite-in-jump/43853/2 "2020-07-29T09:34:10Z")

</div>

Gurobi does not support PSD constraints, you should pick a solver from [this table](http://jump.dev/JuMP.jl/v0.21.3/installation/#Getting-Solvers-1) where there is SDP in the last column.
