-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add stim.Circuit.{shortest,likeliest}_error_sat_problem
#703
Conversation
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.
Looks like you need to run the regen_docs.sh
script in the dev/
directory. It expects you to build and install the stim dev wheel before doing so (see the developer docs; this is easy to do with bazel).
Thanks, ran this and addressed all the comments. |
Note: the bug in |
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.
Getting closer!
Hi @Strilanc , Oscar had an idea that I like for the interface and I was wondering what you thought. The idea is to split into two python functions: minimum_cardinality_undetectable_logical_error_problem_as_maxsat_string(format)
approximately_most_probable_undetectable_logical_error_problem_as_maxsat_string(quantization_factor, format) The idea would be to to ignore probabilities entirely in the first method and do a "best effort" approximation in the second method. "Best effort" means negation complementation and rounding to zero where it's the closest available integer. WDYT |
I think these are close enough that they might as well be the same method with a flag of some kind. Also those names are too long. If I was naming it I'd say |
I am happy to make either 2 methods with somewhat shorter names, as you suggest, or to keep it 1 method with a flag. Which solution do you prefer? |
Go with the two name solution. |
…rror_sat_problem(dem, quantization, format)
…test error case for probability 0 errors
@Strilanc despite running this:
I don't see any updates to the docs. Yet, the CI job |
Thanks for the advice!
which resulted in a """ inside a multiline string that itself used """. I replaced these with ''' and also added a check to BTW -- it seems like some of the code in a recent commit to main was not formatted with this command you shared:
you might consider running it on your branch. |
Because CI doesn't enforce that the code is formatted, it often drifts a bit over time. |
shortest_undetectable_logical_error_wcnf
stim.Circuit.{shortest,likeliest}_error_sat_problem
Cross-reference: This PR came up as an example to answer this question on QCSE. |
Summary
Adds a generator that outputs a .wcnf file string in WDIMACS format.
Added a few tests as well.
Demo for the surface code
Here is a demo:
Step 1: Generate the WCNF file
Step 2: Fetch a solver from the 2023 maxSAT competition
Step 3: Run the solver on the produced file
Verifying distances of several quasicyclic codes
I ran this on some circuits from this paper, with help from @oscarhiggott to generate the circuits.
The log file is attached below:
n72_n90_n103_quasicyclic_codes_have_expected_distances_6_8_8.txt
So far, it has proven that the n=72, n=29, and n=103 circuits have the expected distance reported in the paper.
I am still running solvers on the n=144 and n=288 cases. My computer got rebooted so I had to start over. I am cautiously optimistic that the solvers will finish within a few weeks.