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

Support custom gate defintions in QASM parser#6917

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
dstrain115 merged 21 commits intoquantumlib:mainfromdaxfohl:qasm-custom-gates
Jan 17, 2025

Conversation

@daxfohl
Copy link
Collaborator

@daxfohldaxfohl commentedJan 4, 2025
edited
Loading

Resolves#3560

  • Tests verify parsed vs expected, for unparameterized, parameterized, and for broadcasted qregs.
  • They also useassert_qiskit_parsed_qasm_consistent_with_unitary to ensure consistency of parsed circuit (and sanity check that the provided QASM definition is actually valid).
  • Several tests for invalid gate definitions or invocations and verify similar error message for Cirq and qiskit parsers.
  • One odd instance where qiskit does not throw an error on an invalid QASM circuit, even though simulating it in qiskit fails; chalking it up to a qiskit bug.

@daxfohldaxfohl requested review froma team andvtomole ascode ownersJanuary 4, 2025 00:34
@CirqBotCirqBot added the size: L250< lines changed <1000 labelJan 4, 2025
@codecov
Copy link

codecovbot commentedJan 4, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base(0361a81) to head(d29c116).
Report is 248 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@##             main    #6917    +/-   ##========================================  Coverage   97.87%   97.87%            ========================================  Files        1084     1084              Lines       94420    94791   +371     ========================================+ Hits        92409    92780   +371  Misses       2011     2011

☔ 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.

@daxfohldaxfohl changed the titleAdd parser for qasm custom gatesSupport custom gate defintions in QASM parserJan 9, 2025
Copy link
Collaborator

@dstrain115dstrain115 left a comment

Choose a reason for hiding this comment

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

This is a really cool enhancement to qasm parsing!!!
Just some doc comments, and then I think we are good to go.

@dstrain115dstrain115 added this pull request to themerge queueJan 17, 2025
Merged via the queue intoquantumlib:main with commit2b49589Jan 17, 2025
37 checks passed
@daxfohldaxfohl deleted the qasm-custom-gates branchJanuary 19, 2025 14:17
@daxfohldaxfohl added the BREAKING CHANGEFor pull requests that are important to mention in release notes. labelApr 18, 2025
@daxfohl
Copy link
CollaboratorAuthor

Adding BREAKING CHANGE because unit tests were changed. Very minor change that removes unexpected trailing spaces from QASM output. No effective change in the QASM logic itself.

BichengYing pushed a commit to BichengYing/Cirq that referenced this pull requestJun 20, 2025
Resolvesquantumlib#3560* Tests verify parsed vs expected, for unparameterized, parameterized,and for broadcasted qregs.* They also use `assert_qiskit_parsed_qasm_consistent_with_unitary` toensure consistency of parsed circuit (and sanity check that the providedQASM definition is actually valid).* Several tests for invalid gate definitions or invocations and verifysimilar error message for Cirq and qiskit parsers.* One odd instance where qiskit does not throw an error on an invalidQASM circuit, even though simulating it in qiskit fails; chalking it upto a qiskit bug.
github-merge-queuebot pushed a commit that referenced this pull requestAug 6, 2025
Since recent changes have added supports for multiple statements, updatethe description in the OpenQASM compatibility table accordingly.#6917: added "gate" support#6710: added "reset" support#4738: added "if" supportFixes:#7525
pavoljuhas pushed a commit that referenced this pull requestAug 14, 2025
Since recent changes have added supports for multiple statements, updatethe description in the OpenQASM compatibility table accordingly.#6917: added "gate" support#6710: added "reset" support#4738: added "if" supportFixes:#7525
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dstrain115dstrain115dstrain115 approved these changes

@vtomolevtomoleAwaiting requested review from vtomolevtomole is a code owner

Assignees

No one assigned

Labels

BREAKING CHANGEFor pull requests that are important to mention in release notes.size: L250< lines changed <1000

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support custom gate defintions in QASM parser

3 participants

@daxfohl@dstrain115@CirqBot

[8]ページ先頭

©2009-2025 Movatter.jp