code: def _init_state(self, initial_state: Union[int, np.ndarray]):
          
          state = np.reshape(
              sim.to_valid_state_vector(initial_state, self._num_qubits),
              (self._num_shards, self._shard_size))
          state_handle = mem_manager.SharedMemManager.create_array(
              state.view(dtype=np.float32))
          self._shared_mem_dict['state_handle'] = state_handle
docs: Initializes a the shard wavefunction and sets the initial state.