Error using cvx/times (line 262) Disciplined convex programming error: Invalid quadratic form(s): not a square

lambda(s).*act2(f,s,q) is indefinite, hence not convex. See FAQ: Why doesn’t CVX accept my problem? [READ THIS FIRST] .

I will leave it to others to determine whether there is a convex and DCP-compliant reformulation for the problem the OP is trying to solve. I presume there may be some constraints not shown, since for instance, A1 is declared, but its use not shown in the code.