docs: def _collapse_state(args: Dict[str, Any]):
      """Projects state shards onto the appropriate post measurement state.
  
      This function makes no assumptions about the interpretation of quantum
      theory.
  
      Args:
          args: The args from shard_num_args.
      """
      index = args['index']
      result = args['result']
      prob_one = args['prob_one']
  
      state = _state_shard(args)
      normalization = np.sqrt(prob_one if result else 1 - prob_one)
      state *= (_one_projector(args, index) * result +
                (1 - _one_projector(args, index)) * (1 - result))
      state /= normalization