paddle_quantum.channel.base
量子信道基类的功能实现。
- class Channel(backend=None, dtype=None, name_scope=None)
基类:
paddle_quantum.base.Operator量子信道的基类。
- 参数:
type_repr (str) – 表示的类型。合法的取值包括
'Choi','Kraus','Stinespring'。representation (Union[paddle.Tensor, List[paddle.Tensor]]) – 信道的表示,默认为
None,即未指定。qubits_idx (Union[Iterable[Iterable[int]], Iterable[int], int]) – 作用的量子比特的编号,默认为
None,表示 list(range(num_acted_qubits))。num_qubits (int) – 量子比特的总数,默认为
None。check_legality (bool) – 表示的完整性校验,默认为
True。num_acted_qubits (int) – 信道作用的量子比特的数量,默认为
None。backend (paddle_quantum.Backend, optional) – 执行信道的后端,默认为
None。dtype (str, optional) – 数据的类型, 默认为
None。name_scope (str, optional) – 为 Layer 内部参数命名而采用的名称前缀。如果前缀为 “my_layer”,在一个类名为MyLayer的Layer中, 参数名为 “my_layer_0.w_n”,其中 “w” 是参数的名称,”n” 为自动生成的具有唯一性的后缀。如果为
None, 前缀名将为小写的类名。默认为None。
备注
当
representation给定时,不管num_acted_qubits是否为None,num_acted_qubits将由representation自动确定。- property choi_repr
该信道的 Choi 表达式。
- 抛出:
ValueError – 需要指定此 Channel 实例的 Choi 表示。
- 返回:
一个形状为
的 Tensor,这里 为信道的输入/出维度。- 返回类型:
paddle.Tensor
- property kraus_repr
该信道的 Kraus 表达式。
- 抛出:
ValueError – 需要指定此 Channel 实例的 Kraus 表示。
- 返回:
一个形状为
的 Tensor,这里 为信道的输入/出维度。- 返回类型:
paddle.Tensor
- property stinespring_repr
该信道的 Stinespring 表达式。
- 抛出:
ValueError – 需要指定此 Channel 实例的 Stinespring 表示。
- 返回:
一个形状为
的 Tensor,这里 为信道的秩,且 为信道的输入/出维度。- 返回类型:
paddle.Tensor