qiskit/quantum_info/operators/channel/choi.py
def _tensor_product(self, other, reverse=False):
        """Return the tensor product channel.

        Args:
            other (QuantumChannel): a quantum channel.
            reverse (bool): If False return self ⊗ other, if True return
                            if True return (other ⊗ self) [Default: False
        Returns:
            Choi: the tensor product channel as a Choi object.

        Raises:
            QiskitError: if other is not a QuantumChannel subclass.
        """
        # Convert other to Choi
        if not isinstance(other, Choi):
            other = Choi(other)

        if reverse:
            input_dims = self.input_dims() + other.input_dims()
            output_dims = self.output_dims() + other.output_dims()
            data = _bipartite_tensor(
                other.data,
                self._data,
                shape1=other._bipartite_shape,
                shape2=self._bipartite_shape)
        else:
            input_dims = other.input_dims() + self.input_dims()
            output_dims = other.output_dims() + self.output_dims()
            data = _bipartite_tensor(
                self._data,
                other.data,
                shape1=self._bipartite_shape,
                shape2=other._bipartite_shape)
        return Choi(data, input_dims, output_dims)
def _tensor_product(self, other, reverse=False):
        """Return the tensor product channel.

        Args:
            other (QuantumChannel): a quantum channel.
            reverse (bool): If False return self ⊗ other, if True return
                            if True return (other ⊗ self) [Default: False
        Returns:
            Choi: the tensor product channel as a Choi object.

        Raises:
            QiskitError: if other is not a QuantumChannel subclass.
        """
        # Convert other to Choi
        if not isinstance(other, Choi):
            other = Choi(other)

        if reverse:
            input_dims = self.input_dims() + other.input_dims()
            output_dims = self.output_dims() + other.output_dims()
            data = _bipartite_tensor(
                other.data,
                self._data,
                shape1=other._bipartite_shape,
                shape2=self._bipartite_shape)
        else:
            input_dims = other.input_dims() + self.input_dims()
            output_dims = other.output_dims() + self.output_dims()
            data = _bipartite_tensor(
                self._data,
                other.data,
                shape1=self._bipartite_shape,
                shape2=other._bipartite_shape)
        return Choi(data, input_dims, output_dims)
def _tensor_product ( self , other , reverse = False ) : # Convert other to Choi if not isinstance ( other , Choi ) : other = Choi ( other ) if reverse : input_dims = self . input_dims ( ) + other . input_dims ( ) output_dims = self . output_dims ( ) + other . output_dims ( ) data = _bipartite_tensor ( other . data , self . _data , shape1 = other . _bipartite_shape , shape2 = self . _bipartite_shape ) else : input_dims = other . input_dims ( ) + self . input_dims ( ) output_dims = other . output_dims ( ) + self . output_dims ( ) data = _bipartite_tensor ( self . _data , other . data , shape1 = self . _bipartite_shape , shape2 = other . _bipartite_shape ) return Choi ( data , input_dims , output_dims )
Return the tensor product channel.

        Args:
            other (QuantumChannel): a quantum channel.
            reverse (bool): If False return self ⊗ other, if True return
                            if True return (other ⊗ self) [Default: False
        Returns:
            Choi: the tensor product channel as a Choi object.

        Raises:
            QiskitError: if other is not a QuantumChannel subclass.
Return the tensor product channel .