which in traditional form reads $2\text{Trace}(\sigma_i^{\dagger}\sigma_j) = \delta_{i,j}$. The ConjugateTranspose
is needed to insure that the resultinduced norm is always non-negative in the vector space of the complex numbers, as required for a unitary scalar product. This means that the coefficient of any particular product of Pauli matrices in the complete expression can be obtained by a projection using this scalar product. As a resultThis scalar product is really what answers the question: it pulls out the coefficients from the simplified operator expression in matrix form.
In this step, the computation first determines the expansion in the Pauli matrices, not the ladder operators. Then, I add a function ladderReduce
that substitutes the ladder operators $S_i^{\pm}$ for $\sigma_i^{x/y}$.