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

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

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
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Clean up some of the parser implementation ie. use in_angle_brackets

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
@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.05%. Comparing base (5eab358) to head (3c1ef8c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3122      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.01%     
==========================================
  Files         438      439       +1     
  Lines       54952    55108     +156     
  Branches     8536     8565      +29     
==========================================
+ Hits        49491    49629     +138     
- Misses       4071     4081      +10     
- Partials     1390     1398       +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?

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