import cvxpy as cp
import numpy as np
p1 = cp.Variable()
p2 = cp.Variable()
p0 = 0.5
P = np.array([[p1, 1- p1],
[1 - p2, p2]])
x = np.array([[p0],
[1 - p0]])
y = P * x
c = np.sum(P*np.log2( P ),axis=0)
I have two questions. 1. Why am I getting the previous error? 2. Is it possible to have optimization variable in log2 term and still solve the optimization problem using cvxpy?