"cvxpy" library: how to perform convex optimization for real and imaginary part of variable simultaneously - python

41 Views Asked by At

I have a set of variables in python. I wish to minimize total variation of real and imaginary part of my variables. Here is part of my code:

import cvxpy as cp
delta = 10

# Define the variables
s_L1 = cp.Variable(shape = (81,81))

# Define the objective function

objective = cp.tv(cp.real(s_L1)) + cp.tv(cp.imag(s_L1))
s_L1.shape

s_L1.shape
#type(s_L1)
Y = Y.reshape((2323,1))

constraints = [cp.norm(A@s_L1.reshape((81*81,1)) - Y,2) <= delta]

# Define the optimization problem
problem = cp.Problem(cp.Minimize(objective), constraints)

# Solve the optimization problem
problem.solve(verbose=True, solver=cp.SCS) 

As you can see in the above code, minimization problem is subject to vector form of my variables. As far as I know, "cvxpy" library solve the problem assuming real value for variables. "A" and "Y" are both complex values. the same must be applied to set of variables which have been defined. How can I consider real and imaginary part of variables simultaneously in this compressed sensing problem?

0

There are 0 best solutions below