Positive Semidefinite and Hermitian Matrix Variable in CVXR

99 Views Asked by At

How do I restrict a matrix variable to be both Positive Semidefinite and Hermitian in CVXR? When I try to add both attributes, I get an error saying that I can only have one attribute.

Here is what I tried:

theta <- Variable(rows = 3, cols = 3, PSD = TRUE, hermitian = TRUE)

Here is the error:

Error in .local(.Object, ...) :
  Cannot set more than one special attribute.
1

There are 1 best solutions below

1
Azhari On
theta <- Variable(rows = 3, cols = 3, PSD = TRUE)

This will create a matrix variable theta that is both positive semidefinite and Hermitian. CVXR will enforce both of these constraints automatically when the variable is marked as PSD.