paddle_quantum.channel.base
The source file of the basic class for the quantum channels.
- class paddle_quantum.channel.base.Channel(type_repr, representation=None, qubits_idx=None, num_qubits=None, check_legality=True, num_acted_qubits=None, backend=None, dtype=None, name_scope=None)
 Bases:
OperatorBasic class for quantum channels.
- Parameters:
 type_repr (str) – type of a representation. should be
'Choi','Kraus','Stinespring'.representation (Tensor | List[Tensor]) – the representation of this channel. Defaults to
Nonei.e. not specified.qubits_idx (Iterable[Iterable[int]] | Iterable[int] | int) – indices of the qubits on which this channel acts on. Defaults to
None. i.e. list(range(num_acted_qubits)).num_qubits (int) – total number of qubits. Defaults to
None.check_legality (bool) – whether check the completeness of the representation if provided. Defaults to
True.num_acted_qubits (int) – the number of qubits that this channel acts on. Defaults to
None.backend (Backend) – Backend on which the channel is executed. Defaults to
None.dtype (str) – Type of data. Defaults to
None.name_scope (str) – Prefix name used by the layer to name parameters. If prefix is “my_layer”, parameter name in MyLayer can be “my_layer_0.w_n”, where “w” is the parameter base name and “n” is an unique suffix auto-generated. If
None, prefix name will be snake cased class name. Defaults toNone.
- Raises:
 ValueError – Unsupported channel representation for
type_repr.NotImplementedError – The noisy channel can only run in density matrix mode.
TypeError – Unexpected data type for Channel representation.
Note
If
representationis given, thennum_acted_qubitswill be determined byrepresentation, no matternum_acted_qubitsisNoneor not.- property choi_repr: Tensor
 Choi representation of a channel
- Returns:
 a tensor with shape
 , where is the input/output dimension of this channel- Raises:
 ValueError – Need to specify the Choi representation in this Channel instance.
- property kraus_repr: List[Tensor]
 Kraus representation of a channel
- Returns:
 a list of tensors with shape
 , where is the input/output dimension of this channel- Raises:
 ValueError – Need to specify the Kraus representation in this Channel instance.
- property stinespring_repr: Tensor
 Stinespring representation of a channel
- Returns:
 a tensor with shape
 , where is the rank of this channel and is the input/output dimension of this channel- Raises:
 ValueError – Need to specify the Stinespring representation in this Channel instance.