I have an optimization problem with a semi-definiteness constraint: $$ N \preceq 0 $$ where the entries $N^{AB}$ of the matrix $N$ are defined through $$ N^{AB} = \sum_{i,j} x^i M_{ij}^{AB} x^j $$ The $x^i$ are my independent variables, whereas the $M_{ij}^{AB}$ are fixed and obey $M_{ij}^{AB}= M_{ij}^{BA}$ so $N$ is symmetric. The variable to optimize is a linear combination of the $x^i$.
When $N$ is a one-by-one matrix this is a simple quadratically constrained program. In this case the problem is convex if $M_{ij}$ is positive semidefinite, and the translation to a familiar semidefinite programming problem can be found, for example, in section 8.1 of these lecture notes.
When $N$ is of higher dimension the constraint is similar to a bilinear matrix inequality. In this tutorial it is simply mentioned that such inequalities do not carve out convex sets in general. However it seems to me that the problem can very well be convex for suitable $M^{AB}_{ij}$.
Question: can we think of constraints for $M^{AB}_{ij}$ so that the problem ends up being non-trivially convex? And what would then be the translation to a standard semidefinite programming problem?