{"id":17998240,"url":"https://github.com/primaryobjects/quantum","last_synced_at":"2025-03-26T04:31:47.882Z","repository":{"id":139343264,"uuid":"161538312","full_name":"primaryobjects/quantum","owner":"primaryobjects","description":"A set of simple tutorial programs for quantum computing including a game, Fly Unicorn.","archived":false,"fork":false,"pushed_at":"2019-10-25T21:02:03.000Z","size":28,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T06:41:35.651Z","etag":null,"topics":["deutsch-jozsa-algorithm","ibmqx","qiskit","quantum","quantum-algorithms","quantum-computing","quantum-mechanics","quantum-programming-language","qubit","qubits"],"latest_commit_sha":null,"homepage":"http://www.primaryobjects.com/2019/01/07/an-introduction-to-quantum-computing/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primaryobjects.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-12T19:58:22.000Z","updated_at":"2024-12-10T19:54:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d64dac6-8b26-400b-98a4-7a9b5f511744","html_url":"https://github.com/primaryobjects/quantum","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fquantum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fquantum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fquantum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fquantum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primaryobjects","download_url":"https://codeload.github.com/primaryobjects/quantum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245589266,"owners_count":20640254,"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":["deutsch-jozsa-algorithm","ibmqx","qiskit","quantum","quantum-algorithms","quantum-computing","quantum-mechanics","quantum-programming-language","qubit","qubits"],"created_at":"2024-10-29T21:24:42.730Z","updated_at":"2025-03-26T04:31:47.874Z","avatar_url":"https://github.com/primaryobjects.png","language":"Python","readme":"Quantum Computing Tutorial\n==========================\n\nA set of simple programs for learning how to program a quantum computer.\n\nRead the tutorial [An Introduction to Quantum Computing](http://www.primaryobjects.com/2019/01/07/an-introduction-to-quantum-computing).\n\n## What is it?\n\nQuantum computing is a technology based upon quantum physics and its inherent properties of superposition and entanglement. It brings a new paradigm to programming, where algorithms can be created that can process exponentially more data than classical computers that rely on transistor-based technology.\n\nThis project contains a set of basic example programs to learn about programming a quantum computer.\n\nSeveral tutorial examples are included in this repository including the projects listed below.\n\n## Quick Start\n\nTo get started with quantum programming and the examples in this project, follow the steps below.\n\n1. Install [Python3](https://www.python.org/downloads/).\n\n2. Install [pip](https://pip.pypa.io/en/stable/installing/) if needed. To install pip, download [get-pip.py](https://bootstrap.pypa.io/get-pip.py) and execute it with the following command.\n\n    ```bash\n    python get-pip.py\n    ```\n\n3. Install the required libraries for QisKit and the examples.\n\n    ```bash\n    pip install qiskit\n    pip install ConfigParser\n    ```\n\n### Hello World\n\n[hello.py](hello.py)\n\nA simple \"Hello World\" program in quantum computing. The program uses 1 qubit and simply measures it, finally printing out the text, \"Hello World\" and the measurement appended.\n\n### Fly Unicorn\n\n[unicorn.py](unicorn.py)\n\nA game written on a quantum computer!\n\nYour magestic unicorn is ready for flight!\nAfter a long night of preparation and celebration, it's time to visit the castle in the clouds.\nUse your keyboard to fly up or down on a quantum computer, as you ascend your way into the castle.\n\n```text\n===============\n  Fly Unicorn\n===============\n\nYour majestic unicorn is ready for flight!\nAfter a long night of preparation and celebration, it’s time to visit the castle in the clouds.\nUse your keyboard to fly up or down on a quantum computer, as you ascend your way into the castle.\n\n\n=====================\n-[ Altitude 0 feet ]-\nYour unicorn is waiting for you on the ground.\n[up,down,quit]: u\nYou soar into the sky.\nRunning on the simulator.\n{'0': 945, '1': 55}\n\n=====================\n-[ Altitude 55 feet ]-\nYour unicorn is floating gently above the ground.\n[up,down,quit]: u\nYou soar into the sky.\nRunning on the simulator.\n{'0': 886, '1': 114}\n\n=====================\n-[ Altitude 114 feet ]-\nYour unicorn is hovering just above the evergreen sea of trees.\n[up,down,quit]:\n```\n\n### Superposition\n\n[superposition.py](superposition.py)\n\nAn example of using superposition in quantum programming. This program contains three examples to demonstrate the properties of quantum superposition and entanglement.\n\nThe first example measures 2 qubits in their initial states (all zeros) and prints the results.\n\nThe second example creates a [Bell state](https://en.wikipedia.org/wiki/Bell_state) (|00\u003e + |11\u003e), (|00\u003e - |11\u003e), (|01\u003e + |10\u003e), (|01\u003e - |10\u003e). This is done by entangling 2 qubits, placing the first qubit into superposition (existing as 0 and 1 simulataneously with 50% chance of measuring either value), and finally measuring the results. The output should be half 00 and half 11.\n\nThe third example demonstrates [superdense coding](https://en.wikipedia.org/wiki/Superdense_coding). This involves sending two classical bits of information (for example: 01) by only manipulating a single qubit. Suppose Alice wants to send Bob the message 01. This can be done by entangling the two qubits to create a Bell state of `00`. One qubit is given to Alice and the other is given to Bob. Alice can now manipulate her qubit to alter the resulting Bell state to indicate the value `01`. She can do this by inverting the value of her qubit (which is in superposition). She then sends Bob her qubit. Bob now reverses the entanglement and reverses the superposition of Alice's qubit. Bob can now measure the two qubits and obtain the value of `01`. In this case, Bob's qubit miraculously turns from a `0` into a `1`.\n\n### Cloning a Qubit\n\n[clone.py](clone.py)\n\nAn example of cloning a qubit that is currently in superposition to another qubit.\n\nThis process involves setting the first qubit to a value of 1 (the value we want to clone to the second qubit). We then place the first qubit into superposition. To clone, we first reverse the superposition on the first qubit. Next, we perform a controlled-not operation between the two qubits, establishing an entanglement. We then put both qubits into superposition, effectively cloning their values.\n\n### The Deutsch Jozsa Algorithm\n\n[deutsch_jozsa.py](deutsch_jozsa.py)\n\nAn example of the Deutsch Jozsa Algorithm. This algorithm demonstrates how a quantum computer substantially differs from a classical computer by solving a problem in 1 cycle, that would take a classical computer much longer.\n\nLicense\n----\n\nMIT\n\nAuthor\n----\nKory Becker\nhttp://www.primaryobjects.com/kory-becker\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimaryobjects%2Fquantum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimaryobjects%2Fquantum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimaryobjects%2Fquantum/lists"}