{"id":13751594,"url":"https://github.com/artificial-brain/quantumcat","last_synced_at":"2025-05-09T18:31:35.135Z","repository":{"id":47586501,"uuid":"353344004","full_name":"artificial-brain/quantumcat","owner":"artificial-brain","description":"quantumcat is a platform-independent, open-source, high-level quantum computing library, which allows the quantum community to focus on developing platform-independent quantum applications without much effort.","archived":false,"fork":false,"pushed_at":"2024-01-03T04:46:38.000Z","size":6396,"stargazers_count":24,"open_issues_count":3,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T03:15:01.245Z","etag":null,"topics":["cross-platform","high-level-programming","quantum-algorithms","quantum-applications","quantum-computing","quantum-library"],"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/artificial-brain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-31T12:11:05.000Z","updated_at":"2025-02-06T14:42:47.000Z","dependencies_parsed_at":"2024-01-13T11:51:33.541Z","dependency_job_id":"0c33f9f8-e20b-4fea-afb9-3032ac53bc97","html_url":"https://github.com/artificial-brain/quantumcat","commit_stats":{"total_commits":140,"total_committers":8,"mean_commits":17.5,"dds":0.6642857142857144,"last_synced_commit":"eff99cac7674b3a1b7e1f752e7ebed2b960f85b3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artificial-brain%2Fquantumcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artificial-brain%2Fquantumcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artificial-brain%2Fquantumcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artificial-brain%2Fquantumcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artificial-brain","download_url":"https://codeload.github.com/artificial-brain/quantumcat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949272,"owners_count":21830151,"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":["cross-platform","high-level-programming","quantum-algorithms","quantum-applications","quantum-computing","quantum-library"],"created_at":"2024-08-03T09:00:49.423Z","updated_at":"2025-05-09T18:31:34.494Z","avatar_url":"https://github.com/artificial-brain.png","language":"Python","readme":"\n\n\u003ch1 align=\"center\"\u003e  \n  \u003cimg src=\"https://github.com/artificial-brain/quantumcat/blob/assets/quantumcat/logo/quantum_cat_logo.jpg?raw=true\" alt=\"Quantum Cat Logo\" width=\"250\" height=\"250\" /\u003e  \n\u003c/h1\u003e  \n  \n  \n## Introduction  \nquantumcat is a platform-independent, open-source, high-level quantum computing library, which allows the quantum community to focus on developing platform-independent quantum applications without much effort.\n## It is based on two principles:\n1) Write once and execute on any supported quantum provider using one syntax\n\n2) quantumcat should enable researchers and developers to create quantum applications using high-level programming in the future so that they can focus on developing quantum applications instead of learning low-level concepts such as gates and circuits\n\n### Write once\n```python  \nfrom quantumcat.utils import providers  \nnum_of_qubits = 2\nqc = QCircuit(num_of_qubits)\nqc.h_gate(0)\nqc.cx_gate(0, 1)\n\n# To execute on Google Cirq\nresult = qc.execute(provider=providers.GOOGLE_PROVIDER, repetitions=1024) \n```  \n```python  \n# To execute on IBM Qiskit\nresult = qc.execute(provider=providers.IBM_PROVIDER, repetitions=1024)\n```  \n```python  \n# To execute on Amazon Braket\nresult = qc.execute(provider=providers.AMAZON_PROVIDER, repetitions=1024)\n```\n\n### Compare the results of all the supported providers with a single line of code\n\n```python  \n# Execute on All providers in one go\ncircuit.compare_results(plot=True)\n```\n\u003ch1 align=\"center\"\u003e  \n  \u003cimg src=\"https://github.com/artificial-brain/quantumcat/blob/assets/quantumcat/screenshots/compare-histogram.png?raw=true\" alt=\"Compare Results\" width=\"400\" height=\"300\" /\u003e  \n\u003c/h1\u003e  \n\n### Execute on real IBM quantum hardware with quantumcat\n```python  \nfrom quantumcat.utils import providers  \n  \nresult = qc.execute(provider=providers.IBM_PROVIDER,\napi='API KEY from IBM Quantum dashboard', \ndevice='IBM DEVICE NAME such as ibmq_manila or ibmq_quito')  \n# Copy API and Device name from https://quantum-computing.ibm.com/  \n```\n## Installation  \n```shell  \npip install quantumcat\n```  \n\n## Platforms Supported  \n* Google Cirq  \n* IBM Qiskit  \n* Amazon Braket  \n* IonQ (Via Braket)  \n* Rigetti (Via Braket)  \n\n## Examples of High-Level Functions\n### Deutsch Jozsa  Algorithm\n```python  \ndeutsch_jozsa = DeutschJozsa('balanced', 4)\nprint(deutsch_jozsa.execute(provider=providers.IBM_PROVIDER))\n```\n\n### Superposition  \n```python  \nqc.superposition(0) \n# puts qubit 0 in superposition  \n```  \n### Entanglement  \n```python  \nqc.entangle(0, 1) \n# entangles qubit 0 with qubit 1  \n```  \n### Phase Kickback  \n```python  \nqc.phase_kickback(0) \n# applies |-\u003e to qubit 0  \n```  \n\n## Example of High-Level Applications  \n### Random Number Generator  \n```python  \nfrom quantumcat.utils import providers, constants  \nfrom quantumcat.applications.generator import RandomNumber  \n  \nrandom_number = RandomNumber(length=2, output_type=constants.DECIMAL).execute(provider=providers.GOOGLE_PROVIDER)\nprint(random_number)  \n\n# To generate random number on actual IBM device  \nrandom_number = RandomNumber(length=2, output_type=constants.DECIMAL)\n\t.execute(provider=providers.IBM_PROVIDER, repetitions=1024, api='API KEY from IBM Quantum dashboard'\n\t\t device='IBM DEVICE NAME such as ibmq_manila or ibmq_quito')\nprint(random_number)\n```  \n### Password Generator  \n```python  \nfrom quantumcat.applications.generator import Password  \n  \npassword = Password(8).generate()  \nprint(password)  \n# Length should be between 5 - 20  \n# Password is generated in hexadecimal format using QRNG@ANU JSON API\n```  \n### OTP Generator  \n```python  \nfrom quantumcat.applications.generator import OTP  \n  \notp = OTP().generate()  \nprint(otp)  \n# 5 digits OTP is generated using QRNG@ANU JSON API  \n```  \n\n## Examples of Low-Level Functions\n### Circuit Creation  \n```python  \nfrom quantumcat.circuit import QCircuit  \n  \nnum_of_qubits = 3  \nqc = QCircuit(num_of_qubits)  \n```  \n### Single-Qubit Gate  \n```python  \nqc.x_gate(0) # applies X gate on qubit 0  \n```  \n### Two-Qubit Gate  \n```python  \nqc.cx_gate(0, 1) # control qubit, target qubit  \n```  \n### Multi-Qubit Gate  \n```python  \nqc.mct_gate([0, 1], 2) # control qubits array, target qubit  \n```  \n### Draw Circuit  \n```python  \nfrom quantumcat.utils import providers  \n  \nqc.draw_circuit(provider=providers.GOOGLE_PROVIDER)\n``` \n## Gates Supported  \n[Click here to view gates supported](https://drive.google.com/file/d/1XNCY2NyioTpqNII4dalm4plKE2-suKYB/view)  \n\n## Visualization  \n### Histogram\n```python  \ncircuit = QCircuit(1)\ncircuit.superposition(0)\ncounts = circuit.execute(provider=providers.GOOGLE_PROVIDER, repetitions=1024)\ncircuit.histogram(counts) \n```\n\u003ch1 align=\"center\"\u003e  \n  \u003cimg src=\"https://github.com/artificial-brain/quantumcat/blob/assets/quantumcat/screenshots/single-histogram.png?raw=true\" alt=\"Histogram\" width=400\" height=\"300\"/\u003e  \n\u003c/h1\u003e\n\n### Bloch Multivector\n```python  \ncircuit = QCircuit(1)\ncircuit.superposition(0)\nstate = circuit.execute(provider=providers.GOOGLE_PROVIDER, \n\t\t\tsimulator_name=constants.STATEVECTOR_SIMULATOR)\ncircuit.bloch_multivector(state) \n```\n\n\u003ch1 align=\"center\"\u003e  \n  \u003cimg src=\"https://github.com/artificial-brain/quantumcat/blob/assets/quantumcat/screenshots/bloch.png?raw=true\" alt=\"Bloch Multivector\" width=\"300\" height=\"300\" /\u003e  \n\u003c/h1\u003e\n\n### QSphere\n```python  \ncircuit = QCircuit(1)\ncircuit.superposition(0)\nstate = circuit.execute(provider=providers.GOOGLE_PROVIDER, \n\t\t\tsimulator_name=constants.STATEVECTOR_SIMULATOR)\ncircuit.state_qsphere(state) \n```\n\n\u003ch1 align=\"center\"\u003e  \n  \u003cimg src=\"https://github.com/artificial-brain/quantumcat/blob/assets/quantumcat/screenshots/qsphere.png?raw=true\" alt=\"QSphere\" width=\"300\" height=\"300\" /\u003e  \n\u003c/h1\u003e\n\n## License  \n  \n[Apache License 2.0](LICENSE.txt)\n","funding_links":[],"categories":["Community"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartificial-brain%2Fquantumcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartificial-brain%2Fquantumcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartificial-brain%2Fquantumcat/lists"}