Modified spatial_sixj and guess wavefunction transformation because there were some bugs.