docs: def solve_sdr(prob, *args, **kwargs):
      """Solve the SDP relaxation.
      """
  
      # lifted variables and semidefinite constraint
      X = cvx.Semidef(prob.n + 1)
  
      W = prob.f0.homogeneous_form()
      rel_obj = cvx.Minimize(cvx.sum_entries(cvx.mul_elemwise(W, X)))
      rel_constr = [X[-1, -1] == 1]
  
      for f in prob.fs:
          W = f.homogeneous_form()
          lhs = cvx.sum_entries(cvx.mul_elemwise(W, X))
          if f.relop == '==':
              rel_constr.append(lhs == 0)
          else:
              rel_constr.append(lhs <= 0)
  
      rel_prob = cvx.Problem(rel_obj, rel_constr)
      rel_prob.solve(*args, **kwargs)
  
      if rel_prob.status not in [cvx.OPTIMAL, cvx.OPTIMAL_INACCURATE]:
          raise Exception("Relaxation problem status: %s" % rel_prob.status)
  
      return X.value, rel_prob.value