<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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))