| # Standard Forms of SDP SDP > Conic problems | LMIs | Standard Forms | Applications A semidefinite program (SDP) is a problem of minimizing a linear function over an LMI constraint. Standard inequality form Standard conic form CVX syntax ## Standard Inequality Form In standard inequality form, an SDP is written as where are given symmetric matrix, , and is a vector variable. The above problem generalizes the LP in inequality form:
| An SDP in two variables: subjec to: , where , and are the two symmetric matrices
## Standard Conic Form Recall that we can define the scalar product between two matrices as If are both square, and symmetric, then the scalar product is simply the trace of the product. In standard conic form, an SDP is written as where and are given symmetric matrices, and is the matrix variable. The above generalizes the standard conic form for LP, which can be written as Just as in LP, the standard inequality and standard conic forms are equivalent, in the sense that we can always convert one into the other, possibly at the expense of introducing new variables and constraints. ## CVX syntax In CVX, a constraint , when is a symmetric matrix variable, is encoded with the `semidefinite` assignment. It is important to let CVX know is symmetric, when declaring it as a variable. CVX syntax
    cvx_begin
    	variables X(n,n) symmetric;
    	minimize( trace(C*X) )
    	subject to
    		for i = 1:m,
    			trace(A{i}*X == b(i);
    		end
    		X == semidefinite(n);
    cvx_end