I am trying to learn how to multiply power(lmbd,2) with quad_form(z,A) in my objective.

I think this part gives error. Error is Problem does not follow DCP rules.

objective = cp.Minimize(cp.power(lmbd,2) * cp.quad_form(z, A)) - lmbd*cp.matmul(z.T, s))

constraint = [cp.sum(z) == 1, z >= 0]

Belows are my expressions:

lmbd = cp.Variable()

A = np.random.rand(d, d)

A = np.dot(A.transpose(),A)

z = cp.Variable(d)

s = np.random.randn(d)

Look forward your help, thank you!