Can sinter.Task tasks be saved in a file to be reused later on?
Quantum Computing SEArchived Mar 16, 2026✓ Full text saved
The idea is to have something similar to the save_resume_filepath argument in sinter.collect() but for the sinter.Task, i.e.: surface_code_tasks = [ sinter.Task( circuit = stim.Circuit.generated( "surface_code:rotated_memory_z", rounds=d * 3, distance=d, after_clifford_depolarization=noise, after_reset_flip_probability=noise, before_measure_flip_probability=noise, before_round_data_depolarization=noise, ), json_metadata={'d': d, 'r': d * 3, 'p': noise}, ) for d in [3, 5, 7] for noise in [0.008,
Full text archived locally
✦ AI Summary· Claude Sonnet
Can sinter.Task tasks be saved in a file to be reused later on?
Ask Question
Asked 5 months ago
Modified 7 days ago
Viewed 68 times
1
The idea is to have something similar to the save_resume_filepath argument in sinter.collect() but for the sinter.Task, i.e.:
surface_code_tasks = [
sinter.Task(
circuit = stim.Circuit.generated(
"surface_code:rotated_memory_z",
rounds=d * 3,
distance=d,
after_clifford_depolarization=noise,
after_reset_flip_probability=noise,
before_measure_flip_probability=noise,
before_round_data_depolarization=noise,
),
json_metadata={'d': d, 'r': d * 3, 'p': noise},
)
for d in [3, 5, 7]
for noise in [0.008, 0.009, 0.01, 0.011, 0.012]
]
with open("task_description.json", "w") as f:
json.dump(task, f)
I understand that surface_code_tasks is a list. From what I understand, to write it in a JSON format, it would have to be converted to a dict and then the last two lines of the snippet could be used.
Is there any method worth attempting ? Using hard coded JSON parsing or pickle (though it doesn't sound recommended ?
The reason why I am searching for this is because I am working on some code with a classmate who doesn't have a very powerful machine to run all these simulations, but needs them. We're already using that in sinter.collect() but the tasks take too long for him.
Thank you !
error-correctionstimsinter
Share
Improve this question
Follow
asked Oct 8, 2025 at 14:22
aidegare
132
2 bronze badges
Hi and welcome! The last part of your message seems to say that you want to avoid your friend the need to do "simulations". Building sinter.Task instances is not performing simulations, and so by saving the sinter.Task instances only, you will have to re-do simulations. Is that what you want? Also, if you want to save simulation results, save_resume_filepath is the way to go. –
Adrien Suau
Commented
Oct 8, 2025 at 17:37
1
Hello and thank you ! To clarify, my friend wants the code to add on the code himself and try things on his own. We are saving the simulations, but sinter.Task is what takes most of the computing time. From what I understand, sinter.Taskwraps the circuits we want to simulate, and which is then fed into sinter.collect. I am already saving the simulation results, but would like to save the wrapping of the circuits in the sinter.Task instance. In essence, save both the tasks and simulations. Does that clarify what I am looking for ? –
aidegare
Commented
Oct 9, 2025 at 14:34
Add a comment
1 Answer
Sorted by:
Highest score (default)
Date modified (newest first)
Date created (oldest first)
0
I believe to have found something worth the use for now, using pickle:
import pickle
surface_code_tasks = [
sinter.Task(
circuit = stim.Circuit.generated(
"surface_code:rotated_memory_z",
rounds=d * 3,
distance=d,
after_clifford_depolarization=noise,
after_reset_flip_probability=noise,
before_measure_flip_probability=noise,
before_round_data_depolarization=noise,
),
json_metadata={'d': d, 'r': d * 3, 'p': noise},
)
for d in [3, 5, 7]
for noise in [0.008, 0.009, 0.01, 0.011, 0.012]
]
with open('task_description.pkl', 'wb') as f:
pickle.dump(surface_code_tasks, f)
It did seem online that pickle was not the safest option, but this is not the goal here, so works for my problem :)
Share
Improve this answer
Follow
answered Oct 10, 2025 at 11:47
aidegare
132
2 bronze badges
Add a comment
Your Answer
Post Your Answer
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Ask question
Explore related questions
error-correctionstimsinter
See similar questions with these tags.
The Overflow Blog
Open source for awkward robots
Domain expertise still wanted: the latest trends in AI-assisted knowledge for...
Featured on Meta
Logo updates to Stack Overflow's visual identity
Related
2
Read/Write circuit to file in Stim
0
How can we know the expected value of data errors in Stim?
0
Can we get which error mechanisms acutually happens in Stim?
2
How do I write a stim diagram to a file?
0
Fault tolerance of turning off a stabilizer measurement for later rounds of error correction?
2
Can Stim tell what to measure to get a certain stabilizer group?
0
How can I reset a qubit with a given probability after applying a gate in STIM?
0
Can an asymmetric depolarizing noise channel be implemented in stim?
Hot Network Questions
proving that the extremal is independent of the coordinate system, can I swap differentials this way, since the derivative operator is linear?
How random is RandomInteger[{0,B}]?
In 1 Corinthians 7:8, does ἀγάμοις (agamois) refer to all unmarried people or specifically to widowers?
Grammaticality of "Nabila isn't using the mobile phone anymore (used to)"
Why is Trinity Necessary After Jesus' Death? Can't God Exist As One?
more hot questions
Question feed
By continuing to use this website, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. By exiting this window, default cookies will be accepted. To reject cookies, select an option from below.
Customize settings
Cookie Consent Preference Center
When you visit any of our websites, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences, or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and manage your preferences. Please note, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
Cookie Policy
Accept all cookies
Manage Consent Preferences
Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
Targeting Cookies
Targeting Cookies
These cookies are used to make advertising messages more relevant to you and may be set through our site by us or by our advertising partners. They may be used to build a profile of your interests and show you relevant advertising on our site or on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device.
Performance Cookies
Performance Cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
Functional Cookies
Functional Cookies
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
Cookie List
Clear
checkbox label label
Apply Cancel
Consent Leg.Interest
checkbox label label
checkbox label label
checkbox label label
Necessary cookies only Confirm My Choices