-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve stimcirq serialization #7192
Improve stimcirq serialization #7192
Conversation
dstrain115
commented
Mar 27, 2025
- After some testing, the serialization for stimcirq was a bit subpar. Serializing the json was rather bulky.
- This splits the stimcirq serialization and deserialization into its own file, so its more encapsulated.
- This also serializes each operation directly, rather than jamming the whole json into the gate.
- For a typical QEC surface code circuit, this reduces the size of the proto by about 25%.
- After some testing, the serialization for stimcirq was a bit subpar. Serializing the json was rather bulky. - This splits the stimcirq serialization and deserialization into its own file, so its more encapsulated. - This also serializes each operation directly, rather than jamming the whole json into the gate. - For a typical QEC surface code circuit, this reduces the size of the proto by about 25%.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7192 +/- ##
==========================================
- Coverage 98.15% 98.14% -0.01%
==========================================
Files 1100 1104 +4
Lines 96253 96352 +99
==========================================
+ Hits 94473 94564 +91
- Misses 1780 1788 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Could I get a review on this, so I can start testing the new proto serialization? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add unit tests to stimcirq_serializer
?
@@ -0,0 +1,101 @@ | |||
# Copyright 2019 The Cirq Developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,99 @@ | |||
# Copyright 2019 The Cirq Developers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…_stimcirq_serialization
@NoureldinYosri The round trip test is in circuit_serializer_test, but I added a test in stimcirq_serializer_test as well. |