{"id":28416899,"url":"https://github.com/quantumlib/chromobius","last_synced_at":"2026-03-10T17:08:12.603Z","repository":{"id":212463202,"uuid":"705156480","full_name":"quantumlib/chromobius","owner":"quantumlib","description":"Open-source implementation of a \"Möbius decoder\" for color codes used in quantum error correction (QEC)","archived":false,"fork":false,"pushed_at":"2025-12-13T02:05:14.000Z","size":9131,"stargazers_count":25,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-05T06:26:39.052Z","etag":null,"topics":["algorithms","color-code","cpp","google-quantum","python","qec","qec-codes","quantum","quantum-computing","quantum-error-correction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quantumlib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-15T07:38:43.000Z","updated_at":"2025-12-26T04:14:32.000Z","dependencies_parsed_at":"2023-12-14T12:14:36.459Z","dependency_job_id":"e8e8b15c-584a-4990-a4a0-f1b3507f5b6f","html_url":"https://github.com/quantumlib/chromobius","commit_stats":null,"previous_names":["quantumlib/chromobius"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/quantumlib/chromobius","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantumlib%2Fchromobius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantumlib%2Fchromobius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantumlib%2Fchromobius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantumlib%2Fchromobius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quantumlib","download_url":"https://codeload.github.com/quantumlib/chromobius/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantumlib%2Fchromobius/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30343963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","color-code","cpp","google-quantum","python","qec","qec-codes","quantum","quantum-computing","quantum-error-correction"],"created_at":"2025-06-04T01:18:43.268Z","updated_at":"2026-03-10T17:08:12.593Z","avatar_url":"https://github.com/quantumlib.png","language":"Python","readme":"# Chromobius: color code decoder\n\nChromobius is an implementation of a [\"mobius decoder\"](https://arxiv.org/abs/2108.11395), which approximates the color code decoding problem as a minimum weight matching problem.\nChromobius uses [PyMatching](https://github.com/oscarhiggott/PyMatching/) to solve the minimum weight matching problem.\n\nSee the paper [\"New circuits and an open source decoder for the color code\"](https://arxiv.org/abs/2312.08813) for more details on how Chromobius works.\n\n## How to use Chromobius\n\nSee the [**getting started notebook**](doc/getting_started.ipynb).\n\nAlso see the [Python API reference](doc/chromobius_api_reference.md).\n\nProgrammers who want to edit and build Chromobius can check the [developer documentation](doc/developers.md).\n\n## Example Snippets\n\n### Decoding a shot with Chromobius\n\nFrom Python:\n\n```python\nimport stim\nimport chromobius\nimport numpy as np\n\ndef count_mistakes(circuit: stim.Circuit, shots: int) -\u003e int:\n    # Sample the circuit.\n    dets, actual_obs_flips = circuit.compile_detector_sampler().sample(\n        shots=shots,\n        separate_observables=True,\n        bit_packed=True,\n    )\n\n    # Decode with Chromobius.\n    decoder = chromobius.compile_decoder_for_dem(circuit.detector_error_model())\n    predicted_obs_flips = decoder.predict_obs_flips_from_dets_bit_packed(dets)\n\n    # Count mistakes.\n    return np.count_nonzero(np.any(predicted_obs_flips != actual_obs_flips, axis=1))\n```\n\nFrom the command line:\n\n```bash\n# Sample shots of detectors and observable flips.\nstim detect \\\n    --shots 100000 \\\n    --in \"example_circuit.stim\" \\\n    --out \"dets.b8\" \\\n    --out_format \"b8\" \\\n    --obs_out \"obs_actual.txt\" \\\n    --obs_out_format \"01\"\n\n# Extract a detector error model used to configure Chromobius.\nstim analyze_errors \\\n    --in \"example_circuit.stim\" \\\n    --fold_loops \\\n    --out \"dem.dem\"\n\n# Decode the shots.\nchromobius predict \\\n    --dem \"dem.dem\" \\\n    --in \"dets.b8\" \\\n    --in_format \"b8\" \\\n    --out \"obs_predicted.txt\" \\\n    --out_format \"01\"\n\n# Count the number of shots with a prediction mistake.\npaste obs_actual.txt obs_predicted.txt \\\n    | grep -Pv \"^([01]*)\\\\s*\\\\1$\" \\\n    | wc -l\n```\n\nFrom Python using sinter:\n\n```python\nimport sinter\nimport chromobius\nimport os\n\ntasks: list[sinter.Task] = ...\nstats: list[sinter.TaskStats] = sinter.collect(\n    decoders=[\"chromobius\"],\n    custom_decoders=chromobius.sinter_decoders(),\n    tasks=tasks,\n    num_workers=os.cpu_count(),\n    max_shots=100_000,\n    max_errors=100,\n)\n```\n\nFrom the command line using sinter:\n\n```bash\nsinter collect \\\n    --circuits \"example_circuit.stim\" \\\n    --decoders chromobius \\\n    --custom_decoders_module_function \"chromobius:sinter_decoders\" \\\n    --max_shots 100_000 \\\n    --max_errors 100\n    --processes auto \\\n    --save_resume_filepath \"stats.csv\" \\\n```\n\n## Disclaimer\n\nThis is not an officially supported Google product. This project is not\neligible for the [Google Open Source Software Vulnerability Rewards\nProgram](https://bughunters.google.com/open-source-security).\n\nCopyright 2025 Google LLC.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://quantumai.google\"\u003e\n    \u003cimg width=\"15%\" alt=\"Google Quantum AI\"\n         src=\"https://raw.githubusercontent.com/quantumlib/chromobius/refs/heads/main/assets/quantum-ai-vertical.svg\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Quantum error correction"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantumlib%2Fchromobius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantumlib%2Fchromobius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantumlib%2Fchromobius/lists"}