Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More channel representation conversion tools #4553

Merged
merged 1 commit into from Oct 5, 2021

Conversation

viathor
Copy link
Collaborator

@viathor viathor commented Oct 5, 2021

After this PR one can convert between any two representations from among: Kraus, Choi and superoperator.

@viathor viathor requested review from cduck, vtomole and a team as code owners October 5, 2021 15:41
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Oct 5, 2021


def superoperator_to_choi(superoperator: np.ndarray) -> np.ndarray:
"""Returns the Choi matrix of a quantum channel specified via the superoperator matrix."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have documentation anywhere that defines what these representations are? If no: we should beef up these docstrings to give some context for the conversion.

In any case, it could be helpful to give a little note about how "involved" each conversion is. E.g. add a line: "Conversions between superoperator and choi representations only involve axes manipulation"

"Conversions to kraus require an eigendecomposition"

Copy link
Collaborator Author

@viathor viathor Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll send thorough updates to docstrings in a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #4554 (both definitions of the mathematical objects and the notes about complexity).

@viathor viathor merged commit 0d9eb4e into quantumlib:master Oct 5, 2021
@viathor viathor deleted the choi_and_superoperator branch October 5, 2021 18:28
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants