Superoperator Transformations#

Functions used to convert superoperators among their possible representations. For more in-depth theoretical description of the representations and transformations, we direct the reader to Wood, Biamonte, and Cory, Quant. Inf. Comp. 15, 0579-0811 (2015).

Vectorization#

qibo.quantum_info.vectorization(state, order='row', backend=None)[source]#

Returns state \(\rho\) in its Liouville representation \(|\rho)\).

If order="row", then:

\[|\rho) = \sum_{k, l} \, \rho_{kl} \, \ket{k} \otimes \ket{l} \, .\]

If order="column", then:

\[|\rho) = \sum_{k, l} \, \rho_{kl} \, \ket{l} \otimes \ket{k} \, .\]

If state is a 3-dimensional tensor, it is interpreted as a batch of states.

Parameters:
  • state (ArrayLike) – statevector, density matrix, an array of statevectors, or an array of density matrices.

  • order (str, optional) – If "row", vectorization is performed row-wise. If "column", vectorization is performed column-wise. If "system", a block-vectorization is performed. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Liouville representation of state.

Return type:

ArrayLike

Note

Due to numpy limitations on handling transposition of tensors, this function will not work when the number of qubits \(n\) is such that \(n > 16\).

Unvectorization#

qibo.quantum_info.unvectorization(state, order='row', backend=None)[source]#

Returns state \(\rho\) from its Liouville representation \(|\rho)\). This operation is the inverse function of vectorization(), i.e.

\[\begin{split}\begin{align} \rho &= \text{unvectorization}(|\rho)) \nonumber \\ &= \text{unvectorization}(\text{vectorization}(\rho)) \nonumber \end{align}\end{split}\]

If state has shape (N, k), it is interpreted as a batch of states.

Parameters:
  • state (_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) – quantum state or batch of states in the Liouville representation.

  • order (str, optional) – If "row", unvectorization is performed row-wise. If "column", unvectorization is performed column-wise. If "system", system-wise vectorization is performed. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Density matrix of state.

Return type:

ArrayLike

Note

Due to numpy limitations on handling transposition of tensors, this function will not work when the number of qubits \(n\) is such that \(n > 16\).

To Choi#

qibo.quantum_info.to_choi(channel, order='row', backend=None)[source]#

Converts quantum channel \(U\) to its Choi representation \(\Lambda\).

\[\Lambda = | U ) ( U | \, ,\]

where \(| \cdot )\) is the qibo.quantum_info.vectorization() operation.

Parameters:
  • channel (qibo.gates.channels.Channel or ArrayLike) – quantum channel.

  • order (str, optional) – If "row", vectorization is performed row-wise. If "column", vectorization is performed column-wise. If "system", a block-vectorization is performed. Default is "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

quantum channel in its Choi representation.

Return type:

ArrayLike

To Liouville#

qibo.quantum_info.to_liouville(channel, order='row', backend=None)[source]#

Converts quantum channel \(U\) to its Liouville representation \(\mathcal{E}\). It uses the Choi representation as an intermediate step.

Parameters:
  • channel (qibo.gates.channels.Channel or ArrayLike) – quantum channel.

  • order (str, optional) – If "row", vectorization is performed row-wise. If "column", vectorization is performed column-wise. If "system", a block-vectorization is performed. Default is "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

quantum channel in its Liouville representation.

Return type:

ArrayLike

To Pauli-Liouville#

qibo.quantum_info.to_pauli_liouville(channel, normalize=False, order='row', pauli_order='IXYZ', method=None, backend=None)[source]#
Converts quantum channel \(U\) to its Pauli-Liouville

representation \(\mathcal{E}\). It uses the Liouville representation as an intermediate step.

If method is None or "fht", the conversion from the computational basis to the Pauli basis is performed with a Fast Walsh-Hadamard transform. For an operator \(A = (a_{p, q})_{p, q = 0}^{2^{n} - 1}\), this computes the coefficients \(lpha_{r, s}\) of

\[A = \sum_{r, s = 0}^{2^{n} - 1} lpha_{r, s} P_{r, s},\]

where

\[P_{r, s} = igotimes_{j = 0}^{n - 1} i^{r_j \wedge s_j} X^{r_j} Z^{s_j},\]

using

\[lpha_{r, s} =\]
rac{(-i)^{|r \wedge s|}}{2^n}

sum_{q = 0}^{2^{n} - 1} a_{q oplus r, q} (H^{otimes n})_{q, s}.

Args:

channel (qibo.gates.channels.Channel or ArrayLike): quantum channel. normalize (bool, optional): If True superoperator is returned

in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

order (str, optional): If "row", vectorization is performed

row-wise. If "column", vectorization is performed column-wise. If "system", a block-vectorization is performed. Default is "row".

pauli_order (str, optional): corresponds to the order of 4 single-qubit

Pauli elements. Default is “IXYZ”.

method (str, optional): If None or "fht", uses the Fast

Walsh-Hadamard transform. If "standard", uses the dense Pauli basis-change matrix. Defaults to None.

backend (qibo.backends.abstract.Backend, optional): backend

to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

ArrayLike: quantum channel in its Pauli-Liouville representation.

Parameters:
Return type:

_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]

To Chi#

qibo.quantum_info.to_chi(channel, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts quantum channel \(U\) to its \(\chi\)-representation.

Parameters:
  • channel (qibo.gates.channels.Channel or ArrayLike) – quantum channel.

  • normalize (bool, optional) – If True superoperator is returned in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", vectorization is performed row-wise. If "column", vectorization is performed column-wise. If "system", a block-vectorization is performed. Default is "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Default is “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

quantum channel in its \(\chi\)-representation.

Return type:

ArrayLike

To Stinespring#

qibo.quantum_info.to_stinespring(channel, partition=None, nqubits=None, initial_state_env=None, backend=None)[source]#

Convert quantum channel \(U\) to its Stinespring representation \(U_{0}\).

It uses the Kraus representation as an intermediate step.

Parameters:
  • channel (qibo.gates.channels.Channel or ArrayLike) – quantum channel.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits channel acts on. If None, defaults to the number of qubits in channel. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses qibo.backends.GlobalBackend. Defaults to None.

  • partition (list[int] | tuple[int, ...] | None) –

Returns:

Quantum channel in its Stinespring representation \(U_{0}\).

Return type:

ArrayLike

Choi to Liouville#

qibo.quantum_info.choi_to_liouville(choi_super_op, order='row', backend=None)[source]#

Converts Choi representation \(\Lambda\) of quantum channel to its Liouville representation \(\mathcal{E}\).

If order="row", then:

\[\Lambda_{\alpha\beta, \, \gamma\delta} \mapsto \Lambda_{\alpha\gamma, \, \beta\delta} \equiv \mathcal{E}\]

If order="column", then:

\[\Lambda_{\alpha\beta, \, \gamma\delta} \mapsto \Lambda_{\delta\beta, \, \gamma\alpha} \equiv \mathcal{E}\]
Parameters:
  • choi_super_op (qibo.gates.channels.Channel or ArrayLike) – Choi representation of quantum channel.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Liouville representation of quantum channel.

Return type:

ArrayLike

Choi to Pauli-Liouville#

qibo.quantum_info.choi_to_pauli(choi_super_op, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Choi representation \(\Lambda\) of a quantum channel to its Pauli-Liouville representation.

Parameters:
  • choi_super_op (qibo.gates.channels.Channel or ArrayLike) – superoperator in the Choi representation.

  • normalize (bool, optional) – If True superoperator is returned in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", it assumes choi_super_op is in row-vectorization. If "column", it assumes column-vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

superoperator in the Pauli-Liouville representation.

Return type:

ArrayLike

Choi to Kraus#

qibo.quantum_info.superoperator_transformations.choi_to_kraus(choi_super_op, precision_tol=None, order='row', validate_cp=True, backend=None)[source]#

Converts Choi representation \(\Lambda\) of a quantum channel \(\mathcal{E}\) into Kraus operators \(\{ K_{\alpha} \}_{\alpha}\).

If \(\mathcal{E}\) is a completely positive (CP) map, then

\[\Lambda = \sum_{\alpha} \, \lambda_{\alpha}^{2} \, |\tilde{K}_{\alpha})(\tilde{K}_{\alpha}| \, .\]

where \(|\cdot)\) is the qibo.quantum_info.vectorization() operation.

This is the spectral decomposition of \(\Lambda\), Hence, the set \(\{\lambda_{\alpha}, \, \tilde{K}_{\alpha}\}_{\alpha}\) is found by diagonalization of \(\Lambda\). The Kraus operators \(\{K_{\alpha}\}_{\alpha}\) are defined as

\[K_{\alpha} = \lambda_{\alpha} \, \text{unvectorization}(|\tilde{K}_{\alpha})) \, .\]

If \(\mathcal{E}\) is not CP, then spectral composition is replaced by a singular value decomposition (SVD), i.e.

\[\Lambda = U \, S \, V^{\dagger} \, ,\]

where \(U\) is a \(d^{2} \times d^{2}\) unitary matrix, \(S\) is a \(d^{2} \times d^{2}\) positive diagonal matrix containing the singular values of \(\Lambda\), and \(V\) is a \(d^{2} \times d^{2}\) unitary matrix. The Kraus coefficients are replaced by the square root of the singular values, and \(U\) (\(V\)) determine the left-generalized (right-generalized) Kraus operators.

Parameters:
  • choi_super_op (qibo.gates.channels.Channel or ArrayLike) – Choi representation of a quantum channel.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

The set \(\{K_{\alpha}, \, \lambda_{\alpha} \}_{\alpha}\) of Kraus operators representing the quantum channel and their respective coefficients. If map is non-CP, then function returns the set \(\{ \{K_{L}, \, K_{R}\}_{\alpha}, \, \lambda_{\alpha} \}_{\alpha}\), with the left- and right-generalized Kraus operators as well as the square root of their corresponding singular values.

Return type:

tuple(ArrayLike, ArrayLike)

Note

Due to the spectral decomposition subroutine in this function, the resulting Kraus operators \(\{K_{\alpha}\}_{\alpha}\) might contain global phases. That implies these operators are not exactly equal to the “true” Kraus operators \(\{K_{\alpha}^{(\text{ideal})}\}_{\alpha}\). However, since these are global phases, the operators’ actions are the same, i.e.

\[K_{\alpha} \, \rho \, K_{\alpha}^{\dagger} = K_{\alpha}^{\text{(ideal)}} \, \rho \,\, (K_{\alpha}^{\text{(ideal)}})^{\dagger} \,\,\,\,\, , \,\, \forall \, \alpha\]

Note

User can set validate_cp=False in order to speed up execution by not checking if input map choi_super_op is completely positive (CP) and Hermitian. However, that may lead to erroneous outputs if choi_super_op is not guaranteed to be CP. We advise users to either set this flag carefully or leave it in its default setting (validate_cp=True).

Choi to Chi-matrix#

qibo.quantum_info.choi_to_chi(choi_super_op, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Choi representation \(\Lambda\) of quantum channel to its \(\chi\)-matrix representation.

\[\chi = \text{liouville_to_pauli}(\Lambda)\]
Parameters:
  • choi_super_op (qibo.gates.channels.Channel or ArrayLike) – Choi representation of a quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Chi-matrix representation of the quantum channel.

Return type:

ArrayLike

Choi to Stinespring#

qibo.quantum_info.choi_to_stinespring(choi_super_op, precision_tol=None, order='row', validate_cp=True, nqubits=None, initial_state_env=None, backend=None)[source]#

Converts Choi representation \(\Lambda\) of quantum channel to its Stinespring representation \(U_{0}\). It uses the Kraus representation as an intermediate step.

Parameters:
  • choi_super_op (qibo.gates.channels.Channel or ArrayLike) – Choi representation of a quantum channel.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits kraus_ops acts on. If None, defaults to the number of qubits in kraus_ops. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of quantum channel.

Return type:

ArrayLike

Kraus to Choi#

qibo.quantum_info.kraus_to_choi(kraus_ops, order='row', backend=None)[source]#

Converts Kraus representation \(\{K_{\alpha}\}_{\alpha}\) of quantum channel to its Choi representation \(\Lambda\).

\[\Lambda = \sum_{\alpha} \, |K_{\alpha})( K_{\alpha}|\]

where \(|K_{\alpha})\) is the vectorization of the Kraus operator \(K_{\alpha}\). For a definition of vectorization, see qibo.quantum_info.vectorization().

Parameters:
  • kraus_ops (list or qibo.gates.channels.Channel) – List of Kraus operators as pairs (qubits, Ak) where qubits refers the qubit ids that \(A_k\) acts on and \(A_k\) is the corresponding matrix as a ArrayLike.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of the Kraus channel.

Return type:

ArrayLike

Kraus to Liouville#

qibo.quantum_info.kraus_to_liouville(kraus_ops, order='row', backend=None)[source]#

Converts from Kraus representation \(\{K_{\alpha}\}_{\alpha}\) of quantum channel to its Liouville representation \(\mathcal{E}\). It uses the Choi representation as an intermediate step.

\[\mathcal{E} = \text{choi_to_liouville}(\text{kraus_to_choi} (\{K_{\alpha}\}_{\alpha}))\]
Parameters:
  • kraus_ops (list or qibo.gates.channels.Channel) – List of Kraus operators as pairs (qubits, Ak) where qubits refers the qubit ids that \(A_k\) acts on and \(A_k\) is the corresponding matrix as a ArrayLike.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Liouville representation of quantum channel.

Return type:

ArrayLike

Kraus to Pauli-Liouville#

qibo.quantum_info.kraus_to_pauli(kraus_ops, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Kraus representation \(\{K_{\alpha}\}_{\alpha}\) of a quantum channel to its Pauli-Liouville representation.

Parameters:
  • kraus_ops (list or qibo.gates.channels.Channel) – List of Kraus operators as pairs (qubits, Ak) where qubits refers the qubit ids that \(A_k\) acts on and \(A_k\) is the corresponding matrix as a ArrayLike.

  • normalize (bool, optional) – If True superoperator is returned in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", intermediate step for Choi representation is done in row-vectorization. If "column", step is done in column-vectorization. If "system", block-vectorization is performed. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

superoperator in the Pauli-Liouville representation.

Return type:

ArrayLike

Kraus to Chi-matrix#

qibo.quantum_info.kraus_to_chi(kraus_ops, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Convert Kraus representation \(\{K_{\alpha}\}_{\alpha}\) of quantum channel to its \(\chi\)-matrix representation.

\[\chi = \sum_{\alpha} \, |c_{\alpha})( c_{\alpha}|,\]

where \(|c_{\alpha}) \cong |K_{\alpha})\) in Pauli-Liouville basis, and \(| \cdot )\) is the qibo.quantum_info.vectorization() operation.

Parameters:
  • kraus_ops (list or qibo.gates.channels.Channel) – List of Kraus operators as pairs (qubits, Ak) where qubits refers the qubit ids that \(A_k\) acts on and \(A_k\) is the corresponding matrix as a ArrayLike.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements in the Pauli basis. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Chi-matrix representation of the Kraus channel.

Return type:

ArrayLike

Kraus to Stinespring#

qibo.quantum_info.kraus_to_stinespring(kraus_ops, nqubits=None, initial_state_env=None, backend=None)[source]#

Converts Kraus representation \(\{K_{\alpha}\}_{\alpha}\) of quantum channel to its Stinespring representation \(U_{0}\), i.e.

\[U_{0} = \sum_{\alpha} \, K_{\alpha} \otimes \ketbra{\alpha}{v_{0}} \, ,\]

where \(\ket{v_{0}}\) is the initial state of the environment (initial_state_env), \(D\) is the dimension of the environment’s Hilbert space, and \(\{\ket{\alpha} \, : \, \alpha = 0, 1, \cdots, D - 1 \}\) is an orthonormal basis for the environment’s space.

Parameters:
  • kraus_ops (list or qibo.gates.channels.Channel) – List of Kraus operators as pairs (qubits, Ak) where qubits refers the qubit ids that \(A_k\) acts on and \(A_k\) is the corresponding matrix as a ArrayLike.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits kraus_ops acts on. If None, defaults to the number of qubits in kraus_ops. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Stinespring representation (restricted unitary) of the Kraus channel.

Return type:

ArrayLike

Liouville to Choi#

qibo.quantum_info.liouville_to_choi(super_op, order='row', backend=None)[source]#

Converts Liouville representation of quantum channel \(\mathcal{E}\) to its Choi representation \(\Lambda\). Indexing \(\mathcal{E}\) as \(\mathcal{E}_{\alpha\beta, \, \gamma\delta} \,\,\), then

If order="row":

\[\Lambda = \sum_{k, l} \, \ketbra{k}{l} \otimes \mathcal{E}(\ketbra{k}{l}) \equiv \mathcal{E}_{\alpha\gamma, \, \beta\delta}\]

If order="column", then:

\[\Lambda = \sum_{k, l} \, \mathcal{E}(\ketbra{k}{l}) \otimes \ketbra{k}{l} \equiv \mathcal{E}_{\delta\beta, \, \gamma\alpha}\]
Parameters:
  • super_op (qibo.gates.channels.Channel or ArrayLike) – Liouville representation of quantum channel.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of quantum channel.

Return type:

ArrayLike

Liouville to Pauli-Liouville#

qibo.quantum_info.liouville_to_pauli(super_op, normalize=False, order='row', pauli_order='IXYZ', method=None, backend=None)[source]#

Converts Liouville representation \(\mathcal{E}\) of a quantum channel to its Pauli-Liouville representation.

If method is None or "fht", this function applies the Fast Walsh-Hadamard transform-based Pauli decomposition to the Liouville operator without explicitly constructing the dense Pauli basis-change matrix. Setting method="standard" recovers the dense matrix multiplication implementation.

Parameters:
  • super_op (qibo.gates.channels.Channel or ArrayLike) – superoperator in the Liouville representation._

  • normalize (bool, optional) – If True superoperator is returned in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", it assumes super_op is in row-vectorization. If "column", it assumes column-vectorization. If "system", it assumes block-vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements in the basis. Defaults to “IXYZ”.

  • method (str, optional) – If None or "fht", uses the Fast Walsh-Hadamard transform. If "standard", uses the dense Pauli basis-change matrix. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

superoperator in the Pauli-Liouville representation.

Return type:

ArrayLike

Liouville to Kraus#

qibo.quantum_info.liouville_to_kraus(super_op, precision_tol=None, order='row', backend=None)[source]#

Converts Liouville representation \(\mathcal{E}\) of a quantum channel to its Kraus representation \(\{K_{\alpha}\}_{\alpha}\). It uses the Choi representation as an intermediate step.

\[\{K_{\alpha}, \, \lambda_{\alpha}\}_{\alpha} = \text{choi_to_kraus}(\text{liouville_to_choi}(\mathcal{E}))\]
Parameters:
  • super_op (qibo.gates.channels.Channel or ArrayLike) – Liouville representation of quantum channel.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda < \text{precision_tol}\) is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Kraus operators of quantum channel and their respective coefficients.

Return type:

(ArrayLike, ArrayLike)

Note

Due to the spectral decomposition subroutine in this function, the resulting Kraus operators \(\{K_{\alpha}\}_{\alpha}\) might contain global phases. That implies these operators are not exactly equal to the “true” Kraus operators \(\{K_{\alpha}^{(\text{ideal})}\}_{\alpha}\). However, since these are global phases, the operators’ actions are the same, i.e.

\[K_{\alpha} \, \rho \, K_{\alpha}^{\dagger} = K_{\alpha}^{\text{(ideal)}} \, \rho \,\, (K_{\alpha}^{\text{(ideal)}})^{\dagger} \,\,\,\,\, , \,\, \forall \, \alpha\]

Liouville to Chi-matrix#

qibo.quantum_info.liouville_to_chi(super_op, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Liouville representation of quantum channel \(\mathcal{E}\) to its \(\chi\)-matrix representation. It uses the Choi representation as an intermediate step.

\[\chi = \text{liouville_to_pauli}(\text{liouville_to_choi}(\mathcal{E}))\]
Parameters:
  • super_op (qibo.gates.channels.Channel or ArrayLike) – Liouville representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements in the basis. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Chi-matrix representation of quantum channel.

Return type:

ArrayLike

Liouville to Stinespring#

qibo.quantum_info.liouville_to_stinespring(super_op, order='row', precision_tol=None, validate_cp=True, nqubits=None, initial_state_env=None, backend=None)[source]#

Converts Liouville representation \(\mathcal{E}\) of quantum channel to its Stinespring representation \(U_{0}\). It uses the Choi representation \(\Lambda\) as intermediate step.

Parameters:
  • super_op (qibo.gates.channels.Channel or ArrayLike) – Liouville representation of quantum channel.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits kraus_ops acts on. If None, defaults to the number of qubits in kraus_ops. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Stinespring representation of quantum channel.

Return type:

ArrayLike

Pauli-Liouville to Liouville#

qibo.quantum_info.pauli_to_liouville(pauli_op, normalize=False, order='row', pauli_order='IXYZ', method=None, backend=None)[source]#

Converts Pauli-Liouville representation of a quantum channel to its Liouville representation \(\mathcal{E}\).

If method is None or "fht", the inverse Pauli-basis transform is evaluated with the inverse Fast Walsh-Hadamard transform implied by Theorem 1. Setting method="standard" recovers the dense Pauli basis-change matrix implementation.

Parameters:
  • pauli_op (qibo.gates.channels.Channel or ArrayLike) – Pauli-Liouville representation of a quantum channel.

  • normalize (bool, optional) – If True assumes pauli_op is represented in the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", returns Liouville representation in row-vectorization. If "column", returns column-vectorized superoperator. If "system", superoperator will be in block-vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • method (str, optional) – If None or "fht", uses the Fast Walsh-Hadamard transform. If "standard", uses the dense Pauli basis-change matrix. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

superoperator in the Liouville representation.

Return type:

ArrayLike

Pauli-Liouville to Choi#

qibo.quantum_info.pauli_to_choi(pauli_op, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Pauli-Liouville representation of a quantum channel to its Choi representation \(\Lambda\).

Parameters:
  • pauli_op (qibo.gates.channels.Channel or ArrayLike) – superoperator in the Pauli-Liouville representation.

  • normalize (bool, optional) – If True assumes pauli_op is represented in the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", returns Choi representation in row-vectorization. If "column", returns column-vectorized superoperator. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of the superoperator.

Return type:

ArrayLike

Pauli-Liouville to Kraus#

qibo.quantum_info.pauli_to_kraus(pauli_op, normalize=False, order='row', pauli_order='IXYZ', precision_tol=None, backend=None)[source]#

Converts Pauli-Liouville representation of a quantum channel to its Kraus representation \(\{K_{\alpha}\}_{\alpha}\).

Parameters:
  • pauli_op (qibo.gates.channels.Channel or ArrayLike) – superoperator in the Pauli-Liouville representation.

  • normalize (bool, optional) – If True assumes pauli_op is represented in the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – vectorization order of the Liouville and Choi intermediate steps. If "row", row-vectorizationcis used for both representations. If "column", column-vectorization is used. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Kraus operators and their coefficients.

Return type:

(ArrayLike, ArrayLike)

Pauli-Liouville to Chi-matrix#

qibo.quantum_info.pauli_to_chi(pauli_op, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Pauli-Liouville representation of a quantum channel to its \(\chi\)-matrix representation.

Parameters:
  • pauli_op (qibo.gates.channels.Channel or ArrayLike) – superoperator in the Pauli-Liouville representation.

  • normalize (bool, optional) – If True assumes pauli_op is represented in the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", returns Choi representation in row-vectorization. If "column", returns column-vectorized superoperator. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Chi-matrix representation of the quantum channel.

Return type:

ArrayLike

Pauli-Liouville to Stinespring#

qibo.quantum_info.pauli_to_stinespring(pauli_op, normalize=False, order='row', pauli_order='IXYZ', precision_tol=None, validate_cp=True, nqubits=None, initial_state_env=None, backend=None)[source]#

Converts Pauli-Liouville representation \(\mathcal{E}_{P}\) of quantum channel to its Stinespring representation \(U_{0}\). It uses the Liouville representation \(\mathcal{E}\) as intermediate step.

Parameters:
  • pauli_op (qibo.gates.channels.Channel or ArrayLike) – Pauli-Liouville representation of a quantum channel.

  • normalize (bool, optional) – If True assumes pauli_op is represented in the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", returns Liouville representation in row-vectorization. If "column", returns column-vectorized superoperator. If "system", superoperator will be in block-vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits kraus_ops acts on. If None, defaults to the number of qubits in kraus_ops. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Stinestring representation of quantum channel.

Return type:

ArrayLike

Chi-matrix to Choi#

qibo.quantum_info.chi_to_choi(chi_matrix, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Convert the \(\chi\)-matrix representation of a quantum channel to its Choi representation \(\Lambda\).

\[\Lambda = \text{pauli_to_liouville}(\chi)\]
Parameters:
  • chi_matrix (qibo.gates.channels.Channel or ArrayLike) – Chi-matrix representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of quantum channel.

Return type:

ArrayLike

Chi-matrix to Liouville#

qibo.quantum_info.chi_to_liouville(chi_matrix, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts the \(\chi\)-matrix representation of a quantum channel to its Liouville representation \(\mathcal{E}\).

\[\mathcal{E} = \text{pauli_to_liouville}(\text{choi_to_liouville}(\chi))\]
Parameters:
  • chi_matrix (qibo.gates.channels.Channel or ArrayLike) – Chi-matrix representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Liouville representation of quantum channel.

Return type:

ArrayLike

Chi-matrix to Pauli-Liouville#

qibo.quantum_info.chi_to_pauli(chi_matrix, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Convert \(\chi\)-matrix representation of a quantum channel to its Pauli-Liouville representation \(\mathcal{E}_P\).

\[\mathcal{E}_P = \text{choi_to_pauli}(\text{chi_to_choi}(\chi))\]
Parameters:
  • chi_matrix (qibo.gates.channels.Channel or ArrayLike) – Chi-matrix representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

superoperator in the Pauli-Liouville representation.

Return type:

ArrayLike

Chi-matrix to Kraus#

qibo.quantum_info.chi_to_kraus(chi_matrix, normalize=False, precision_tol=None, order='row', pauli_order='IXYZ', validate_cp=True, backend=None)[source]#

Converts the \(\chi\)-matrix representation of a quantum channel to its Kraus representation \(\{K_{\alpha}\}_{\alpha}\).

\[\mathcal{E}_P = \text{choi_to_kraus}(\text{chi_to_choi}(\chi))\]
Parameters:
  • chi_matrix (qibo.gates.channels.Channel or ArrayLike) – Chi-matrix representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Kraus operators and their coefficients.

Return type:

(ArrayLike, ArrayLike)

Note

Due to the spectral decomposition subroutine in this function, the resulting Kraus operators \(\{K_{\alpha}\}_{\alpha}\) might contain global phases. That implies these operators are not exactly equal to the “true” Kraus operators \(\{K_{\alpha}^{(\text{ideal})}\}_{\alpha}\). However, since these are global phases, the operators’ actions are the same, i.e.

\[K_{\alpha} \, \rho \, K_{\alpha}^{\dagger} = K_{\alpha}^{\text{(ideal)}} \, \rho \,\, (K_{\alpha}^{\text{(ideal)}})^{\dagger} \,\,\,\,\, , \,\, \forall \, \alpha\]

Note

User can set validate_cp=False in order to speed up execution by not checking if the Choi representation obtained from the input chi_matrix is completely positive (CP) and Hermitian. However, that may lead to erroneous outputs if choi_super_op is not guaranteed to be CP. We advise users to either set this flag carefully or leave it in its default setting (validate_cp=True).

Chi-matrix to Stinespring#

qibo.quantum_info.chi_to_stinespring(chi_matrix, normalize=False, order='row', pauli_order='IXYZ', precision_tol=None, validate_cp=True, nqubits=None, initial_state_env=None, backend=None)[source]#

Converts \(\chi\)-representation of quantum channel to its Stinespring representation \(U_{0}\). It uses the Choi representation \(\Lambda\) as intermediate step.

Parameters:
  • chi_matrix (qibo.gates.channels.Channel or ArrayLike) – Chi-matrix representation of quantum channel.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • precision_tol (float, optional) – Precision tolerance for eigenvalues found in the spectral decomposition problem. Any eigenvalue \(\lambda <\) precision_tol is set to 0 (zero). If None, precision_tol defaults to qibo.config.PRECISION_TOL=1e-8. Defaults to None.

  • order – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • validate_cp (bool, optional) – If True, checks if choi_super_op is a completely positive map. If False, it assumes that choi_super_op is completely positive (and Hermitian). Defaults to True.

  • nqubits (int, optional) – total number of qubits in the system that is interacting with the environment. Must be equal or greater than the number of qubits kraus_ops acts on. If None, defaults to the number of qubits in kraus_ops. Defauts to None.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Stinespring representation of quantum channel.

Return type:

ArrayLike

Stinespring to Choi#

qibo.quantum_info.stinespring_to_choi(stinespring, dim_env, initial_state_env=None, nqubits=None, order='row', backend=None)[source]#

Converts Stinespring representation \(U_{0}\) of quantum channel to its Choi representation \(\Lambda\).

\[\Lambda = \text{kraus_to_choi}(\text{stinespring_to_kraus}(U_{0}))\]
Parameters:
  • stinespring (ArrayLike) – quantum channel in the Stinespring representation.

  • dim_env (int) – dimension of the Hilbert space of the environment.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • nqubits (int, optional) – number of qubits in the system. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Choi representation of quantum channel.

Return type:

ArrayLike

Stinespring to Liouville#

qibo.quantum_info.stinespring_to_liouville(stinespring, dim_env, initial_state_env=None, nqubits=None, order='row', backend=None)[source]#

Converts Stinespring representation \(U_{0}\) of quantum channel to its Liouville representation \(\mathcal{E}\) via Stinespring Dilation, i.e.

\[\mathcal{E} = \text{kraus_to_liouville}(\text{stinespring_to_kraus}(U_{0}))\]
Parameters:
  • stinespring (ArrayLike) – quantum channel in the Stinespring representation.

  • dim_env (int) – dimension of the Hilbert space of the environment.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • nqubits (int, optional) – number of qubits in the system. Defaults to None.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Liouville representation of quantum channel.

Return type:

ArrayLike

Stinespring to Pauli-Liouville#

qibo.quantum_info.stinespring_to_pauli(stinespring, dim_env, initial_state_env=None, nqubits=None, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Stinespring representation \(U_{0}\) of quantum channel to its Pauli-Liouville representation \(\mathcal{E}_{P}\) via Stinespring Dilation, i.e.

\[\mathcal{E}_{P} = \text{kraus_to_pauli}(\text{stinespring_to_kraus}(U_{0}))\]
Parameters:
  • stinespring (ArrayLike) – quantum channel in the Stinespring representation.

  • dim_env (int) – dimension of the Hilbert space of the environment.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • nqubits (int, optional) – number of qubits in the system. Defaults to None.

  • normalize (bool, optional) – If True superoperator is returned in the normalized Pauli basis. If False, it is returned in the unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", intermediate step for Choi representation is done in row-vectorization. If "column", step is done in column-vectorization. If "system", block-vectorization is performed. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Pauli-Liouville representation of quantum channel.

Return type:

ArrayLike

Stinespring to Kraus#

qibo.quantum_info.stinespring_to_kraus(stinespring, dim_env, initial_state_env=None, nqubits=None, backend=None)[source]#

Converts the Stinespring representation \(U_{0}\) of quantum channel to its Kraus representation \(\{K_{\alpha}\}_{\alpha}\), i.e.

\[K_{\alpha} := \bra{\alpha} \, U_{0} \, \ket{v_{0}} \, ,\]

where \(\ket{v_{0}}\) is the initial state of the environment (initial_state_env), \(D\) is the dimension of the environment’s Hilbert space, and \(\{\ket{\alpha} \, : \, \alpha = 0, 1, \cdots, D - 1 \}\) is an orthonormal basis for the environment’s Hilbert space. Note that \(\text{dim}(\ket{\alpha}) = \text{dim}(\ket{v_{0}}) = D\), while \(\text{dim}(U) = 2^{n} \, D\), where \(n\) is nqubits.

Parameters:
  • stinespring (ArrayLike) – quantum channel in the Stinespring representation.

  • dim_env (int) – dimension of the Hilbert space of the environment.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • nqubits (int, optional) – number of qubits in the system. Defaults to None.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

Kraus operators.

Return type:

ArrayLike

Stinespring to Chi-matrix#

qibo.quantum_info.stinespring_to_chi(stinespring, dim_env, initial_state_env=None, nqubits=None, normalize=False, order='row', pauli_order='IXYZ', backend=None)[source]#

Converts Stinespring representation \(U_{0}\) of quantum channel to its \(\chi\)-matrix representation via Stinespring Dilation, i.e.

\[\chi = \text{kraus_to_chi}(\text{stinespring_to_kraus}(U_{0}))\]
Parameters:
  • stinespring (ArrayLike) – quantum channel in the Stinespring representation.

  • dim_env (int) – dimension of the Hilbert space of the environment.

  • initial_state_env (ArrayLike, optional) – statevector representing the initial state of the enviroment. If None, it assumes the environment in its ground state. Defaults to None.

  • nqubits (int, optional) – number of qubits in the system. Defaults to None.

  • normalize (bool, optional) – If True assumes the normalized Pauli basis. If False, it assumes unnormalized Pauli basis. Defaults to False.

  • order (str, optional) – If "row", reshuffling is performed with respect to row-wise vectorization. If "column", reshuffling is performed with respect to column-wise vectorization. If "system", operator is converted to a representation based on row vectorization, reshuffled, and then converted back to its representation with respect to system-wise vectorization. Defaults to "row".

  • pauli_order (str, optional) – corresponds to the order of 4 single-qubit Pauli elements in the Pauli basis. Defaults to “IXYZ”.

  • backend (qibo.backends.abstract.Backend, optional) – backend to be used in the execution. If None, it uses the current backend. Defaults to None.

Returns:

\(\chi\)-representation of quantum channel.

Return type:

ArrayLike