Skip to content

Commit

Permalink
Improve docstring for operation_to_choi (#4143)
Browse files Browse the repository at this point in the history
  • Loading branch information
viathor committed May 28, 2021
1 parent 836bbda commit fec7710
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cirq-core/cirq/qis/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,22 @@ def kraus_to_choi(kraus_operators: Sequence[np.ndarray]) -> np.ndarray:


def operation_to_choi(operation: 'protocols.SupportsChannel') -> np.ndarray:
"""Returns the unique Choi matrix associated with a superoperator."""
r"""Returns the unique Choi matrix associated with a superoperator.
Choi matrix J(E) of a linear map E: L(H1) -> L(H2) which takes linear operators
on Hilbert space H1 to linear operators on Hilbert space H2 is defined as
$$
J(E) = (E \otimes I)(|\phi\rangle\langle\phi|)
$$
where $|\phi\rangle = \sum_i|i\rangle|i\rangle$ is the unnormalized maximally
entangled state and I: L(H1) -> L(H1) is the identity map. Note that J(E) is
a square matrix with d1*d2 rows and columns where d1 = dim H1 and d2 = dim H2.
Args:
operation: Quantum channel.
Returns:
Choi matrix corresponding to operation.
"""
return kraus_to_choi(protocols.channel(operation))

0 comments on commit fec7710

Please sign in to comment.