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

stim.CompiledDemSampler.sample(return_errors=True) too slow when the error matrix is sparse #746

Open
fangzh-umich opened this issue Apr 10, 2024 · 1 comment

Comments

@fangzh-umich
Copy link

I think in many cases it can be useful to get a "ground truth" when sampling errors. From my understanding the intended way to do so with Stim is stim.CompiledDemSampler.sample(return_errors=True). However this can be much slower than return_errors=False when the error matrix is sparse:

image

Would it be possible to return a sparse representation of the errors without so much time overhead?

@Strilanc
Copy link
Collaborator

I was expecting adding bit_packed=True to the sample call to save 8x on the overhead here, but it doesn't. This suggests there's something wrong other than the size of the output. I'll look into it. My best guess is that it has to do with transposing the data when moving from the internal representation to the external result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants