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

dialects: (stim) Add parser for .stim formatted strings #3122

Merged
merged 40 commits into from
Nov 3, 2024

Conversation

kimxworrall
Copy link
Collaborator

Stim circuits are fomatted as detailed on this page:
https://github.com/quantumlib/Stim/blob/main/doc/file_format_stim_circuit.md

This pr adds a parser that can parse this format into stim dialect operations, and adds tests for the parsing of existing operations

kimxworrall and others added 30 commits August 15, 2024 14:33
Clean up some of the parser implementation ie. use in_angle_brackets

Co-authored-by: Sasha Lopoukhine <[email protected]>
@kimxworrall kimxworrall self-assigned this Aug 31, 2024
@kimxworrall kimxworrall added the dialects Changes on the dialects label Aug 31, 2024
Copy link

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.12%. Comparing base (bd9aaf7) to head (d7e2c44).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3122      +/-   ##
==========================================
- Coverage   90.13%   90.12%   -0.01%     
==========================================
  Files         452      453       +1     
  Lines       56953    57109     +156     
  Branches     5468     5490      +22     
==========================================
+ Hits        51333    51471     +138     
- Misses       4173     4183      +10     
- Partials     1447     1455       +8     

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

Base automatically changed from kim/stim/first-annotation-op to main October 2, 2024 14:13
@kimxworrall kimxworrall marked this pull request as ready for review October 2, 2024 14:13
INDENT = re.compile(r"[ \t]*")
SPACE = re.compile(r"[ \t]")
ARG = re.compile(r"\d+(\.\d+)?")
# PAULI = re.compile("|".join(re.re.escape(p.value) for p in PauliSpelling))
Copy link
Member

Choose a reason for hiding this comment

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

commented code, seems like these might be better merged together with the code that leverages them?

@superlopuh superlopuh merged commit c017c10 into main Nov 3, 2024
14 checks passed
@superlopuh superlopuh deleted the kim/stim/stim-printer-parser branch November 3, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants