-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
stim.Circuit.{shortest,likeliest}_error_sat_problem
(#703)
## Summary Adds a generator that outputs a .wcnf file string in [WDIMACS format](http://www.maxhs.org/docs/wdimacs.html). Added a few tests as well. ## Demo for the surface code Here is a demo: **Step 1:** Generate the WCNF file ```python import stim c = stim.Circuit.generated( "surface_code:rotated_memory_z", distance=5, rounds=2, after_clifford_depolarization=0.001, ) wcnf = c.shortest_error_sat_problem() with open('d5problem.wcnf', 'w') as outfile: outfile.write(wcnf) ``` **Step 2:** Fetch a solver from the [2023 maxSAT competition](https://maxsat-evaluations.github.io/2023/) ```bash wget https://maxsat-evaluations.github.io/2023/mse23-solver-src/exact/CASHWMaxSAT-CorePlus.zip unzip CASHWMaxSAT-CorePlus.zip ``` **Step 3:** Run the solver on the produced file ```bash time ./CASHWMaxSAT-CorePlus/bin/cashwmaxsatcoreplus -bm -m d5problem.wcnf c Parsing MaxSAT file... c Using SCIP solver, version 8.0.3, https://www.scipopt.org c scip_time = 0.000000 c Starting SCIP solver in a separate thread (with time-limit = 0s) ... c Using COMiniSatPS SAT solver by Chanseok Oh (2016) o 5 c ============================[ Problem Statistics ]============================ c | Number of variables: 995 | c | Number of clauses: 4377 (incl. 5 soft in queue) | c =============================================================================== c Optimal solution: 5 c _______________________________________________________________________________ c c restarts : 881 c conflicts : 88351 (20350 /sec) c decisions : 257865 (0.00 % random) (59394 /sec) c propagations : 6079046 (1400176 /sec) c conflict literals : 4980307 (6.84 % deleted) c =======================[ UWrMaxSat resources usage ]=========================== c Memory used : 164.00 MB c CPU time : 4.34163 s c Wall clock time : 3 s c OptExp Enc: Srt/BDD/Add: 12 0 0 c _______________________________________________________________________________ v 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110010100001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000100010000010010000000000001 s OPTIMUM FOUND real 0m2.215s user 0m4.345s sys 0m0.051s ``` ## Verifying distances of several quasicyclic codes I ran this on some circuits from [this paper](https://arxiv.org/pdf/2308.07915.pdf), 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](https://github.com/quantumlib/Stim/files/14427119/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](https://arxiv.org/pdf/2308.07915.pdf). 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.
- Loading branch information
Showing
13 changed files
with
1,255 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.