{"id":15544940,"url":"https://github.com/fwcd/swift-quantum","last_synced_at":"2026-01-07T14:35:09.960Z","repository":{"id":248723018,"uuid":"829511771","full_name":"fwcd/swift-quantum","owner":"fwcd","description":"Quantum computing simulation library for Swift","archived":false,"fork":false,"pushed_at":"2024-09-17T20:12:46.000Z","size":90,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-02T12:41:16.503Z","etag":null,"topics":["quantum-computing","swift"],"latest_commit_sha":null,"homepage":"https://fwcd.github.io/swift-quantum/documentation/quantum","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-07-16T15:20:15.000Z","updated_at":"2024-09-17T00:45:49.000Z","dependencies_parsed_at":"2024-07-16T19:20:49.556Z","dependency_job_id":"a46f1349-acea-4965-b979-2ca8c0b64183","html_url":"https://github.com/fwcd/swift-quantum","commit_stats":null,"previous_names":["fwcd/swift-quantum"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fswift-quantum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fswift-quantum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fswift-quantum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fswift-quantum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/swift-quantum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246122244,"owners_count":20726822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["quantum-computing","swift"],"created_at":"2024-10-02T12:40:51.778Z","updated_at":"2026-01-07T14:35:09.915Z","avatar_url":"https://github.com/fwcd.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Quantum\n\n[![Build](https://github.com/fwcd/swift-quantum/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/swift-quantum/actions/workflows/build.yml)\n[![Docs](https://github.com/fwcd/swift-quantum/actions/workflows/docs.yml/badge.svg)](https://fwcd.github.io/swift-quantum/documentation/quantum)\n\nA library for simulating quantum computations in Swift.\n\nThe library is split into two modules:\n\n- `Quantum`, the main library\n- `QuantumBuilder`, an ergonomic (result builder-based) DSL for expressing quantum compuations\n\n`QuantumBuilder` re-exports `Quantum`, so you only have to import one of the two, depending on what you need.\n\n## Example\n\nA simple coin flip that outputs `true` or `false` with equal probability can be implemented as follows:\n\n```swift\nimport QuantumBuilder\n\nlet program = QuantumProgram {\n    Hadamard()\n    Measure()\n}\n\nfor _ in 0..\u003c8 {\n    print(try program.measuredState(for: [false]))\n}\n```\n\nTo try this example, run\n\n```sh\nswift run CoinFlip\n```\n\nAn example output would be:\n\n```\n[true]\n[true]\n[true]\n[false]\n[false]\n[true]\n[false]\n[true]\n```\n\nMore examples can be found under [`Snippets`](Snippets).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fswift-quantum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Fswift-quantum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fswift-quantum/lists"}