CVXPY Constraint reformulation

104 Views Asked by At

If $\sqrt{1 + x^{2}}$ can be written as cp.norm(cp.hstack([1, $x$]), 2) instead of cp.sqrt(1 + cp.square($x$)), what is the correct way of writing

\begin{equation} \sqrt{\gamma_{u}\sum_{j\in \mathcal{L}\backslash\lbrace l\rbrace}\left(h_{j,u}p_{j}\right)^{{2}} + \sigma_{u}^{{2}}}, \end{equation}

in CVXPY in order for it to follow the DCP rules? I had simply written it as cp.norm($\gamma_u$ * (cp.square($hp_{j1}$) + cp.square($hp_{j2}$) + ... + cp.square($hp_\mathcal{L}$)) + cp.square($\sigma_u$)). I was wondering if this is correct or I need to follow the conversion of stacticking as done in the example above to turn my equation into a vector?