quairkit.operator.channel.base

The source file of the basic class for the quantum channels.

class quairkit.operator.channel.base.Channel(type_repr, representation=None, system_idx=None, acted_system_dim=None, check_legality=True)

Basic class for quantum channels.

Parameters:
type_repr : str

type of a representation. should be 'choi', 'kraus', 'stinespring'.

representation : Tensor | None

the representation of this channel. Defaults to None i.e. not specified.

system_idx : Iterable[Iterable[int]] | Iterable[int] | int | None

indices of the system on which this channel acts on. Defaults to None. i.e. list(range(number of acted systems)).

acted_system_dim : List[int] | int | None

dimension of systems that this channel acts on. Can be a list of system dimensions or an int representing the dimension of all systems. Defaults to None.

check_legality : bool | None

whether check the completeness of the representation if provided. Defaults to True.

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

Assume the input dimension is the same as the output.

property dim : int

Dimension of the input/output system of this channel

property choi_repr : Tensor

Choi representation of a channel

Returns:

a tensor with shape \([d_\text{out}^2, d_\text{in}^2]\), where \(d_\text{in/out}\) 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 \([d_\text{out}, d_\text{in}]\), where \(d_\text{in/out}\) 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 \([r * d_\text{out}, d_\text{in}]\), where \(r\) is the rank of this channel and \(d_\text{in/out}\) is the input/output dimension of this channel

Raises:

ValueError – Need to specify the Stinespring representation in this Channel instance.