You have to do it following its definition. You are building some sub-block in a huge matrix, and the solver is telling you correctly that the big matrix is not invertible
Build and invert the matrix on a single space, then you can embed the single-space vectors in your product-space,
Joachim