Simulate a Stern-Gerlach apparatus: given an input state, a measurement axis, and a selection (up or down), return the output state and probability.