\substack to add multiple lines as subscripts of a sum does not make them aligned on the equal / not equal symbol.
I found some answers to this problem, like phantom characters with
\hphantom or the
aligned environment; however, the former is not useful in my case, while the latter ruins the spacing, and I would rather not have to manually fix it.
Isn't there a package which simply aligns two rows using the ampersand symbol in a math environment, similarly to