docs: def _apply_scratch_as_phase(args: Dict[str, Any]):
      """Takes scratch shards and applies them as exponentiated phase to state.
      """
      state = _state_shard(args)
      state *= np.exp(I_PI_OVER_2 * _scratch_shard(args))