How can I express the following formula?

You show a mess, and I have no idea what’s what. You say qq is affine ,. but i don’t even know what qq is.

log_sum_exp is not a get out of non-convexity jail free card. The argument of log_sum_exp must be convex (or affine).

Your first step is to prove that this is a convex constraint.