qiskit/quantum_info/operators/channel/superop.py
def _evolve(self, state, qargs=None):
        """Evolve a quantum state by the QuantumChannel.

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

        Returns:
            DensityMatrix: the output quantum state as a density matrix.

        Raises:
            QiskitError: if the operator dimension does not match the
            specified QuantumState subsystem dimensions.
        """
        state = self._format_state(state, density_matrix=True)
        if qargs is None:
            if state.shape[0] != self._input_dim:
                raise QiskitError(
                    "QuantumChannel input dimension is not equal to state dimension."
                )
            shape_in = self._input_dim * self._input_dim
            shape_out = (self._output_dim, self._output_dim)
            # Return evolved density matrix
            return np.reshape(
                np.dot(self._data, np.reshape(state, shape_in, order='F')),
                shape_out,
                order='F')
        # Subsystem evolution
        return self._evolve_subsystem(state, qargs)
def _evolve(self, state, qargs=None):
        """Evolve a quantum state by the QuantumChannel.

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

        Returns:
            DensityMatrix: the output quantum state as a density matrix.

        Raises:
            QiskitError: if the operator dimension does not match the
            specified QuantumState subsystem dimensions.
        """
        state = self._format_state(state, density_matrix=True)
        if qargs is None:
            if state.shape[0] != self._input_dim:
                raise QiskitError(
                    "QuantumChannel input dimension is not equal to state dimension."
                )
            shape_in = self._input_dim * self._input_dim
            shape_out = (self._output_dim, self._output_dim)
            # Return evolved density matrix
            return np.reshape(
                np.dot(self._data, np.reshape(state, shape_in, order='F')),
                shape_out,
                order='F')
        # Subsystem evolution
        return self._evolve_subsystem(state, qargs)
def _evolve ( self , state , qargs = None ) : state = self . _format_state ( state , density_matrix = True ) if qargs is None : if state . shape [ 0 ] != self . _input_dim : raise QiskitError ( "QuantumChannel input dimension is not equal to state dimension." ) shape_in = self . _input_dim * self . _input_dim shape_out = ( self . _output_dim , self . _output_dim ) # Return evolved density matrix return np . reshape ( np . dot ( self . _data , np . reshape ( state , shape_in , order = 'F' ) ) , shape_out , order = 'F' ) # Subsystem evolution return self . _evolve_subsystem ( state , qargs )
Evolve a quantum state by the QuantumChannel.

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

        Returns:
            DensityMatrix: the output quantum state as a density matrix.

        Raises:
            QiskitError: if the operator dimension does not match the
            specified QuantumState subsystem dimensions.
Evolve a quantum state by the QuantumChannel .