Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix kraus channels for fallbacks to super-operators#7537

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mhucka merged 5 commits intoquantumlib:mainfromdstrain115:kraus_protocol_fixes
Jul 25, 2025

Conversation

@dstrain115
Copy link
Collaborator

@dstrain115dstrain115 commentedJul 25, 2025
edited
Loading

  • There were a few issues with the new strategy to fall back to super-operator calculations using apply_channels.
  • First, the super_operator_to_kraus function is generally not precise or numerically stable enough to support an atol of 1e-10 so loosened this to 1e-6 and also allowed the ability to specify this as a parameter.
  • Next, some operators define decomposition, so cirq.kraus should try to decompose and get a unitary before falling back to using apply_channel.

Fixes:#7536

- There were a few issues with the new strategy to fall backto super-operator calculations using apply_channels.- First, the super_operator_to_kraus function is generally notprecise or numerically stable enough to support an atol of 1e-10so loosened this to 1e-6 and also allowed the ability to specifythis as a parameter.- Next, some operators define decomposition, so cirq.kraus shouldtry to decompose and get a unitary before falling back tousing apply_channel.
@dstrain115dstrain115 requested review froma team andvtomole ascode ownersJuly 25, 2025 18:05
@github-actionsgithub-actionsbot added the size: S10< lines changed <50 labelJul 25, 2025
Copy link
Contributor

@mhuckamhucka left a comment

Choose a reason for hiding this comment

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

LGTM with requests for some minor docstring adjustments.

default: Determines the fallback behavior when `val` doesn't have
a channel. If `default` is not set, a TypeError is raised. If
default is set to a value, that value is returned.
atol: If calculating kraus channels from channels, use this tolerance
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: kraus → Kraus



deftest_kraus_channel_with_has_unitary():
"""CZSWAP is a gate with no unitary but has a unitary."""
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is something wrong with this docstring ;-)

@dstrain115dstrain115 requested a review frommhuckaJuly 25, 2025 22:17
@codecov
Copy link

codecovbot commentedJul 25, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.53%. Comparing base (31df8ef) to head (2835273).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #7537      +/-   ##==========================================- Coverage   97.53%   97.53%   -0.01%==========================================  Files        1095     1095                Lines       99006    99014       +8     ==========================================+ Hits        96570    96576       +6- Misses       2436     2438       +2

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@mhuckamhucka left a comment

Choose a reason for hiding this comment

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

LGTM

@mhuckamhucka added this pull request to themerge queueJul 25, 2025
Merged via the queue intoquantumlib:main with commit6d10979Jul 25, 2025
35 checks passed
pavoljuhas pushed a commit that referenced this pull requestAug 14, 2025
- There were a few issues with the new strategy to fall back tosuper-operator calculations using apply_channels.- First, the super_operator_to_kraus function is generally not preciseor numerically stable enough to support an atol of 1e-10 so loosenedthis to 1e-6 and also allowed the ability to specify this as aparameter.- Next, some operators define decomposition, so cirq.kraus should try todecompose and get a unitary before falling back to using apply_channel.Fixes:#7536
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mhuckamhuckamhucka approved these changes

@vtomolevtomoleAwaiting requested review from vtomolevtomole is a code owner

@fdmalonefdmaloneAwaiting requested review from fdmalonefdmalone is a code owner automatically assigned from quantumlib/cirq-maintainers

Assignees

No one assigned

Labels

size: S10< lines changed <50

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Kraus channels of CZSWAP are broken

2 participants

@dstrain115@mhucka

[8]ページ先頭

©2009-2025 Movatter.jp