QPanda3  0.1.0
Supported by OriginQ
Loading...
Searching...
No Matches
Kraus

Prev Tutorial: State Vector
Next Tutorial: Choi


Introduction

Kraus representation of a quantum channel.

For a quantum channel

\[ \mathcal{E}(\rho)=\sum_{i=0}^{K-1} A_{i} \rho A_{i}^{\dagger} \]

, the Kraus representation is given by a set of matrices

\[ \left[A_{0}, \ldots, A_{K-1}\right] \]

such that the evolution of a DensityMatrix \( \rho\) is given by

\[ \mathcal{E}(\rho)=\sum_{i=0}^{K-1} A_{i} \rho A_{i}^{\dagger} \]

A general operator map \(\mathcal{G}\) can also be written using the generalized Kraus representation which is given by two sets of matrices \( \left[A_{0}, \ldots, A_{K-1}\right] \) , \(\left[B_{0}, \ldots, B_{B-1}\right] \) such that

\[ \mathcal{G}(\rho)=\sum_{i=0}^{K-1} A_{i} \rho B_{i}^{\dagger} \]

Please refer: C.J. Wood, J.D. Biamonte, D.G. Cory, Tensor networks and graphical calculus for open quantum systems, Quant. Inf. Comp. 15, 0579-0811 (2015).arXiv:1111.6950 [quant-ph]

In QPanda3 Quantum Information

Constructing a Kraus object

Here is API doc

Default constructor

Generate a Kraus object without elements

Output

Kra1: {Kraus:
{Kraus_left:
}
,
{Kraus_right:
}
}

From 2D matrix array

Construct a Kraus object from the array of the 2-dimensional matrix of the operator list.

The left operator list of the generated Kraus object is constructed from the input matrix array, and the right operator list is empty

Output

Kra2: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

From 2 operator lists

Construct a Kraus object from the array of two operator lists in a 2-dimensional matrix

The left operator list of the generated Kraus object is constructed from the first input array

The right operator list of the generated Kraus object is constructed from the second input array

Output

Kra3: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

From 2D matrix

Construct Kraus objects from a 2-dimensional matrix of operators

The left operator list of the generated Kraus object is constructed from the input

The right operator list of the generated Kraus object is empty

Output

Kra4: {Kraus:
{Kraus_left:
{
{
{(0,0)},
}
{
{(1,0)},
}
}
,
{
{
{(1,0)},
}
{
{(0,0)},
}
}
}
,
{Kraus_right:
}
}

From Kraus

Generate another Kraus object from a Kraus object using the copy constructor

Output

Kra5: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

Output

Kra5: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

From Choi

Generate another Kraus object from a Choi object

Please refer to Choi

Output

Kra4: {Kraus:
{Kraus_left:
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1.41421,0)},
}
{
{(0,0)},{(0,0)},
}
}
,
{
{
{(0,0)},{(0,0)},
}
{
{(1.41421,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

From Chi

Generate another Kraus object from a Chi object

Please refer to Chi

Output

Kra4: {Kraus:
{Kraus_left:
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1.41421,0)},
}
{
{(0,0)},{(0,0)},
}
}
,
{
{
{(0,0)},{(0,0)},
}
{
{(1.41421,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

From SuperOp

Generate another Kraus object from a SuperOp object

Please refer to SuperOp

Output

Kra4: {Kraus:
{Kraus_left:
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1.41421,0)},
}
{
{(0,0)},{(0,0)},
}
}
,
{
{
{(0,0)},{(0,0)},
}
{
{(1.41421,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

From PTM

Generate another Kraus object from a PTM object

Please refer to PTM

Output

Kra4: {Kraus:
{Kraus_left:
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1.41421,0)},
}
{
{(0,0)},{(0,0)},
}
}
,
{
{
{(0,0)},{(0,0)},
}
{
{(1.41421,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

Obtain internal data

Input and output dim

Get the input dimension input_dim and output dimension output_dim corresponding to the Kraus object

The output dimension should be equal to the number of rows in the matrix

The input dimension should be equal to the number of columns in the matrix

Currently, the implementation requires that the matrix must be a square matrix, so the input and output dimensions should be equal

Here is API doc for Kraus.get_input_dim

Here is API doc for Kraus.get_output_dim

Output

Kra3: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}
input_dim: 2
output_dim: 2

Left operators

Get the list of left operators inside the Kraus object

The result is returned in the form of list[pyqpanda3.quantum_info.Matrix]

Here is API doc for Kraus.left

Output

{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}

Right operators

Get the list of right operators inside the Kraus object

The result is returned in the form of list[pyqpanda3.quantum_info.Matrix]

Here is API doc for Kraus.right

Output

{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}

Modify internal data

Clear internal data

Here is API doc for Kraus.clear

Output

Kra3: {Kraus:
{Kraus_left:
}
,
{Kraus_right:
}
}

Append Kraus

Append the internal data of another Kraus object to the end of the internal data of the current Kraus object

The matrix inside the other Kraus object should have the same shape as the current Kraus object's internal matrix

Here is API doc for Kraus.append

Output

Kra3: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
}
,
{Kraus_right:
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
,
{
{
{(0,0)},{(-0,-1)},
}
{
{(0,1)},{(0,0)},
}
}
,
{
{
{(1,0)},{(0,0)},
}
{
{(0,0)},{(-1,0)},
}
}
,
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

Add Matrix object to left

Add the data in the Matrix object to the end of the internal left operator list of the Kraus object

The Matrix object should have the same shape as the internal matrix of the current Kraus object

Here is API doc for Kraus.left_push_back

Output

Kra3: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

Add Matrix object to right

Add the data in the Matrix object to the end of the internal right operator list of the Kraus object

The Matrix object should have the same shape as the internal matrix of the current Kraus object

Here is API doc for Kraus.right_push_back

Output

Kra3: {Kraus:
{Kraus_left:
}
,
{Kraus_right:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

Append numpy.ndarray to left

Append the data from the numpy.ndarray object representing a two-dimensional array to the end of the internal left operator list within the Kraus object

The numpy.ndarray object representing a two-dimensional array should have the same shape as the internal matrix of the current Kraus object

Here is API doc for Kraus.left_push_back

Output

Kra3: {Kraus:
{Kraus_left:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
,
{Kraus_right:
}
}

Append numpy.ndarray to right

Append the data from the numpy.ndarray object representing a two-dimensional array to the end of the internal right operator list within the Kraus object

The numpy.ndarray object representing a two-dimensional array should have the same shape as the internal matrix of the current Kraus object

Here is API doc for Kraus.right_push_back

Output

Kra3: {Kraus:
{Kraus_left:
}
,
{Kraus_right:
{
{
{(0,0)},{(1,0)},
}
{
{(1,0)},{(0,0)},
}
}
}
}

Evolution of quantum states

Here is API doc for Kraus.evolve

DensityMatrix

Evolution of a DensityMatrix object, and the evolution result is returned as a DensityMatrix object

The dimension of the density matrix is obtained by the member method dim() and should be equal to the input dimension of the Kraus object

Please refer to DensityMatrix.

Output

res: {
{
{(1.49794,0)},{(0.192722,0.177724)},
}
{
{(0.192722,-0.177724)},{(1.50206,0)},
}
}

StateVector

Evolution of the StateVector object is performed, and the result is returned as a DensityMatrix object

The dimension of the StateVector object is obtained by the member method dim() and should be equal to the input dimension of the Kraus object

Please refer to DensityMatrix.

Please refer to StateVector

Output

res: {
{
{(0.5,0)},{(0.5,0)},
}
{
{(0.5,0)},{(2.5,0)},
}
}

Boolean function

Equal

Determine whether the internal data of two Kraus objects are equal

Here is API doc

Output

True