utils

utils.CQMI(rhoABC, dim)
\[I(A:C|B) = I(A:B) + I(B:C) - H(B) - H(ABC)\]
Parameters:
  • rhoABC (numeric) – The density matrix of the tripartite state.

  • dim (numeric) – The dimensions of subsystems A, B and C.

Returns:

\(I(A:C|B)\) conditional mutual information.

Return type:

numeric

utils.KetBra(dim, i, j)

This function produces a matrix for |i><j|.

Parameters:
  • dim (numeric) – Dimension of the matrix.

  • i (numeric) – The index of ket.

  • j (numeric) – The index of bra.

Returns:

The matrix for |i><j|.

Return type:

numeric

utils.SwapGenerator(n, d)

Provide a left shift swap operator \(S\).

\[S(\ket{ijk}\bra{ijk}) = \ket{jki}\bra{ijk}\]
Parameters:
  • n (numeric) – The number of subsystems.

  • d (numeric) – The dimension of each subsystem.

Returns:

The unitary of the swap operator.

Return type:

mat (matrix)

utils.UnitaryChannel(unitary)

UnitaryChannel Provide the Choi matrix of a unitary channel.

\[J_{\mathcal{U}} = d\,(\mathbb{I}\otimes U)\,|\Phi_d\rangle\langle\Phi_d|\, (\mathbb{I}\otimes U^\dagger),\]

where \(|\Phi_d\rangle = \tfrac{1}{\sqrt{d}}\sum_{i=0}^{d-1} |i\rangle\otimes|i\rangle\) is the maximally entangled state and \(d\) is the input (and output) dimension.

Parameters:

unitary (numeric) – A \(d\times d\) unitary matrix \(U\). (Assumed unitary; no validation performed.)

Returns:

Choi matrix \(J_{\mathcal{U}} \in \mathbb{C}^{d^2 \times d^2}\) of the unitary channel \(\mathcal{U}(\cdot)=U(\cdot)U^\dagger\).

Return type:

numeric

Note

Uses the (unnormalized) Choi–Jamiołkowski representation consistent with the project convention (factor \(d\) included).