{"id":21112836,"url":"https://github.com/teddy55codes/blochsphere","last_synced_at":"2025-10-24T08:05:58.053Z","repository":{"id":248440327,"uuid":"828683713","full_name":"Teddy55Codes/BlochSphere","owner":"Teddy55Codes","description":"Interactive bloch sphere implemented with Three.js","archived":false,"fork":false,"pushed_at":"2024-07-28T03:50:27.000Z","size":88,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-22T12:06:19.493Z","etag":null,"topics":["bloch-sphere","complex-numbers","quantum-computing","qubit","threejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/interactive-blochsphere","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Teddy55Codes.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-14T22:14:12.000Z","updated_at":"2025-01-12T00:34:21.000Z","dependencies_parsed_at":"2024-07-18T23:50:05.046Z","dependency_job_id":"076c2651-41bb-49ed-930c-bedab44d0a23","html_url":"https://github.com/Teddy55Codes/BlochSphere","commit_stats":null,"previous_names":["teddy55codes/blochsphere"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Teddy55Codes/BlochSphere","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FBlochSphere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FBlochSphere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FBlochSphere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FBlochSphere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Teddy55Codes","download_url":"https://codeload.github.com/Teddy55Codes/BlochSphere/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Teddy55Codes%2FBlochSphere/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261289421,"owners_count":23136070,"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":["bloch-sphere","complex-numbers","quantum-computing","qubit","threejs"],"created_at":"2024-11-20T01:34:08.340Z","updated_at":"2025-10-24T08:05:53.014Z","avatar_url":"https://github.com/Teddy55Codes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interactive Bloch Sphere\n\nAn interactive [bloch sphere](https://en.wikipedia.org/wiki/Bloch_sphere) implemented with [Three.js](https://threejs.org/).\n\n## Features\n* Setting qubit state to basis states:\n\n$$\n\\lvert 0 \\rangle =\n\\left\\lceil\n\\begin{matrix}\n1 \\\\\n0\n\\end{matrix}\n\\right\\rceil\n$$\n\n$$\n\\lvert 1 \\rangle =\n\\left\\lceil\n\\begin{matrix}\n0 \\\\\n1\n\\end{matrix}\n\\right\\rceil\n$$\n\n$$\n\\lvert - \\rangle =\n\\frac {1} {\\sqrt{2}}\n\\left\\lceil\n\\begin{matrix}\n1 \\\\\n-1\n\\end{matrix}\n\\right\\rceil \n$$\n\n$$\n\\lvert + \\rangle =\n\\frac {1} {\\sqrt{2}}\n\\left\\lceil\n\\begin{matrix}\n1\\\\\n1\n\\end{matrix}\n\\right\\rceil\n$$\n\n$$\n\\lvert -i \\rangle =\n\\frac {1} {\\sqrt{2}}\n\\left\\lceil\n\\begin{matrix}\n1 \\\\\n-i\n\\end{matrix}\n\\right\\rceil\n$$\n\n$$\n\\lvert +i \\rangle =\n\\frac {1} {\\sqrt{2}}\n\\left\\lceil\n\\begin{matrix}\n1 \\\\\ni\n\\end{matrix}\n\\right\\rceil\n$$\n\n* Applying gates, this includes:\n  * Half turn gates:\n    * $X$ Gate\n    * $Y$ Gate\n    * $Z$ Gate\n    * $H$ Gate\n  * Quater turn gates:\n    * $S$ Gate ($\\sqrt{Z}$)\n    * $S^{-1}$ Gate ($Z^{-\\frac 1 2}$)\n    * $Y^{\\frac 1 2}$ Gate\n    * $Y^{-\\frac 1 2}$ Gate\n    * $X^{\\frac 1 2}$ Gate\n    * $X^{-\\frac 1 2}$ Gate\n  * Eighth turn gates:\n    * $T$ Gate\n    * $T^{-1}$ Gate\n    * $Y^{\\frac 1 4}$ Gate\n    * $Y^{-\\frac 1 4}$ Gate\n    * $X^{\\frac 1 4}$ Gate\n    * $X^{-\\frac 1 4}$ Gate\n\nThese gates can be applied in any order for example $H, T, Y^{-\\frac 1 4}$ will result in this state:\n\n![example qubit state](readme-resources/example-qubit-state.png)\n\n## How To Run\n1. Have npm installed\n2. run `npm install`\n3. run `vite serve`\n\n## Use As npm Package\nThis project is available as an npm package under the name [interactive-blochsphere](https://www.npmjs.com/package/interactive-blochsphere).\n\n### Example Usage\n```javascript\nimport {InteractiveBlochSphere} from \"interactive-blochsphere\";\n\nnew InteractiveBlochSphere(document.getElementById(\"blochsphere\"));\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy55codes%2Fblochsphere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteddy55codes%2Fblochsphere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy55codes%2Fblochsphere/lists"}