def _evolve_subsystem(self, state, qargs):
mat = np.reshape(self.data, self._shape)<EOL>state_size = len(state)<EOL>state_dims = self._automatic_dims(None, state_size)<EOL>if self.input_dims() != len(qargs) * (<NUM_LIT:2>,):<EOL><INDENT>raise QiskitError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if state.ndim == <NUM_LIT:1>:<EOL><INDENT>tensor = np.reshape(state, state_dims)<EOL>indices = [len(state_dims) - <NUM_LIT:1> - qubit for qubit in qargs]<EOL>tensor = self._einsum_matmul(tensor, mat, indices)<EOL>return np.reshape(tensor, state_size)<EOL><DEDENT>tensor = np.reshape(state, <NUM_LIT:2> * state_dims)<EOL>indices = [len(state_dims) - <NUM_LIT:1> - qubit for qubit in qargs]<EOL>right_shift = len(state_dims)<EOL>tensor = self._einsum_matmul(tensor, mat, indices)<EOL>tensor = self._einsum_matmul(<EOL>tensor, np.conj(mat), indices, shift=right_shift)<EOL>return np.reshape(tensor, [state_size, state_size])<EOL>
Evolve a quantum state by the operator.

        Args:
            state (QuantumState): The input statevector or density matrix.
            qargs (list): a list of QuantumState subsystem positions to apply
                           the operator on.

        Returns:
            QuantumState: the output quantum state.

        Raises:
            QiskitError: if the operator dimension does not match the
            specified QuantumState subsystem dimensions.