apply_pulse function

Simulate an RF pulse on a single spin.