code: def modelparams_to_state(self, modelparams):
          
          if modelparams.ndim == 1:
              qobj = qt.Qobj(
                  np.tensordot(modelparams, self.data, 1),
                  dims=[self.dims, self.dims]
              )
              if self.superrep is not None:
                  qobj.superrep = self.superrep
              return qobj
          else:
              return list(map(self.modelparams_to_state, modelparams))
docs: Converts one or more vectors of model parameters into
          QuTiP-represented states.
  
          :param np.ndarray modelparams: Array of shape
              ``(basis.dim ** 2, )`` or
              ``(n_states, basis.dim ** 2)`` containing
              states represented as model parameter vectors in this
              basis.
          :rtype: :class:`~qutip.Qobj` or `list` of :class:`~qutip.Qobj`
              instances.
          :return: The given states represented as :class:`~qutip.Qobj`
              instances.