def __init__(self, data, input_dims=None, output_dims=None):
<EOL>if isinstance(data, (list, tuple, np.ndarray)):<EOL><INDENT>if isinstance(data, np.ndarray) or np.array(data).ndim == <NUM_LIT:2>:<EOL><INDENT>kraus = ([np.array(data, dtype=complex)], None)<EOL>shape = kraus[<NUM_LIT:0>][<NUM_LIT:0>].shape<EOL><DEDENT>elif isinstance(data, list) and len(data) > <NUM_LIT:0>:<EOL><INDENT>kraus = [np.array(data[<NUM_LIT:0>], dtype=complex)]<EOL>shape = kraus[<NUM_LIT:0>].shape<EOL>for i in data[<NUM_LIT:1>:]:<EOL><INDENT>op = np.array(i, dtype=complex)<EOL>if op.shape != shape:<EOL><INDENT>raise QiskitError(<EOL>"<STR_LIT>")<EOL><DEDENT>kraus.append(op)<EOL><DEDENT>kraus = (kraus, None)<EOL><DEDENT>elif isinstance(data,<EOL>tuple) and len(data) == <NUM_LIT:2> and len(data[<NUM_LIT:0>]) > <NUM_LIT:0>:<EOL><INDENT>kraus_left = [np.array(data[<NUM_LIT:0>][<NUM_LIT:0>], dtype=complex)]<EOL>shape = kraus_left[<NUM_LIT:0>].shape<EOL>for i in data[<NUM_LIT:0>][<NUM_LIT:1>:]:<EOL><INDENT>op = np.array(i, dtype=complex)<EOL>if op.shape != shape:<EOL><INDENT>raise QiskitError(<EOL>"<STR_LIT>")<EOL><DEDENT>kraus_left.append(op)<EOL><DEDENT>if data[<NUM_LIT:1>] is None:<EOL><INDENT>kraus = (kraus_left, None)<EOL><DEDENT>else:<EOL><INDENT>kraus_right = []<EOL>for i in data[<NUM_LIT:1>]:<EOL><INDENT>op = np.array(i, dtype=complex)<EOL>if op.shape != shape:<EOL><INDENT>raise QiskitError(<EOL>"<STR_LIT>")<EOL><DEDENT>kraus_right.append(op)<EOL><DEDENT>kraus = (kraus_left, kraus_right)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise QiskitError("<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if isinstance(data, (QuantumCircuit, Instruction)):<EOL><INDENT>data = SuperOp._instruction_to_superop(data)<EOL><DEDENT>else:<EOL><INDENT>data = self._init_transformer(data)<EOL><DEDENT>input_dim, output_dim = data.dim<EOL>kraus = _to_kraus(data.rep, data._data, input_dim, output_dim)<EOL>if input_dims is None:<EOL><INDENT>input_dims = data.input_dims()<EOL><DEDENT>if output_dims is None:<EOL><INDENT>output_dims = data.output_dims()<EOL><DEDENT><DEDENT>output_dim, input_dim = kraus[<NUM_LIT:0>][<NUM_LIT:0>].shape<EOL>input_dims = self._automatic_dims(input_dims, input_dim)<EOL>output_dims = self._automatic_dims(output_dims, output_dim)<EOL>if kraus[<NUM_LIT:1>] is None or np.allclose(kraus[<NUM_LIT:0>], kraus[<NUM_LIT:1>]):<EOL><INDENT>super().__init__('<STR_LIT>', (kraus[<NUM_LIT:0>], None), input_dims,<EOL>output_dims)<EOL><DEDENT>else:<EOL><INDENT>super().__init__('<STR_LIT>', kraus, input_dims, output_dims)<EOL><DEDENT>
Initialize a quantum channel Kraus operator.

        Args:
            data (QuantumCircuit or
                  Instruction or
                  BaseOperator or
                  matrix): data to initialize superoperator.
            input_dims (tuple): the input subsystem dimensions.
                                [Default: None]
            output_dims (tuple): the output subsystem dimensions.
                                 [Default: None]

        Raises:
            QiskitError: if input data cannot be initialized as a
            a list of Kraus matrices.

        Additional Information
        ----------------------
        If the input or output dimensions are None, they will be
        automatically determined from the input data. If the input data is
        a list of Numpy arrays of shape (2**N, 2**N) qubit systems will be used. If
        the input does not correspond to an N-qubit channel, it will assign a
        single subsystem with dimension specifed by the shape of the input.