Skip to main content
2 of 2
General cleanup
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

Splitting list of sums into a sum of lists

I want to split a list of sums into a sum of lists For example, I'd like to turn

{{x + y + z}, {x}, {y}, {z}} 

into

x{{1}, {1}, {0}, {0}} +y{{1}, {0}, {1}, {0}} + z{{1}, {0}, {0}, {1}}

as you would when turning a vector with a sum inside it into a sum of vectors.

I've looked all over for documentation for this kind of thing, but I couldn't find anything :(. It would be even further helpful if someone could tell me how to put these three vectors into a single list, I know I can append them, I'm just not sure how to do it when they're being multiplied by something.