Fix issue #8262 : OuterProduct for scaled bras/kets in physics.quantum

Attempt to generalize the OuterProduct function in the physics.quantum module to address issue #8262