{"id":13536068,"url":"https://github.com/Qiskit/qiskit-aer","last_synced_at":"2025-04-02T02:32:14.678Z","repository":{"id":37334537,"uuid":"162182953","full_name":"Qiskit/qiskit-aer","owner":"Qiskit","description":"Aer is a high performance simulator for quantum circuits that includes noise models","archived":false,"fork":false,"pushed_at":"2024-07-12T01:17:22.000Z","size":36684,"stargazers_count":470,"open_issues_count":114,"forks_count":353,"subscribers_count":31,"default_branch":"main","last_synced_at":"2024-07-15T10:21:42.115Z","etag":null,"topics":["gpu","qiskit","quantum-computing","simulator"],"latest_commit_sha":null,"homepage":"https://qiskit.github.io/qiskit-aer/","language":"C++","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/Qiskit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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-17T19:58:16.000Z","updated_at":"2024-07-18T13:29:57.547Z","dependencies_parsed_at":"2023-12-08T15:11:00.921Z","dependency_job_id":"f3cd45f7-5e85-4796-a67d-e4b675694f2c","html_url":"https://github.com/Qiskit/qiskit-aer","commit_stats":{"total_commits":1380,"total_committers":103,"mean_commits":"13.398058252427184","dds":0.7036231884057971,"last_synced_commit":"cd478c20770b5c7808750693fd5244b2f362b43d"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qiskit%2Fqiskit-aer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qiskit%2Fqiskit-aer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qiskit%2Fqiskit-aer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qiskit%2Fqiskit-aer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qiskit","download_url":"https://codeload.github.com/Qiskit/qiskit-aer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246743876,"owners_count":20826624,"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":["gpu","qiskit","quantum-computing","simulator"],"created_at":"2024-08-01T09:00:34.344Z","updated_at":"2025-04-02T02:32:13.883Z","avatar_url":"https://github.com/Qiskit.png","language":"C++","funding_links":[],"categories":["Quantum SDKs","Main","Quantum simulators"],"sub_categories":[],"readme":"# Aer - high performance quantum circuit simulation for Qiskit\n\n[![License](https://img.shields.io/github/license/Qiskit/qiskit-aer.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)\n[![Build](https://github.com/Qiskit/qiskit-aer/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/Qiskit/qiskit-aer/actions/workflows/build.yml)\n[![Tests](https://github.com/Qiskit/qiskit-aer/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/Qiskit/qiskit-aer/actions/workflows/tests.yml)\n[![](https://img.shields.io/github/release/Qiskit/qiskit-aer.svg?style=popout-square)](https://github.com/Qiskit/qiskit-aer/releases)\n[![](https://img.shields.io/pypi/dm/qiskit-aer.svg?style=popout-square)](https://pypi.org/project/qiskit-aer/)\n\n**Aer** is a high performance simulator for quantum circuits written in Qiskit, that includes realistic noise models.\n\n## Installation\n\nWe encourage installing Aer via the pip tool (a python package manager):\n\n```bash\npip install qiskit-aer\n```\n\nPip will handle all dependencies automatically for us, and you will always install the latest (and well-tested) version.\n\nTo install from source, follow the instructions in the [contribution guidelines](CONTRIBUTING.md).\n\n## Installing GPU support\n\nIn order to install and run the GPU supported simulators on Linux, you need CUDA\u0026reg; 11.2 or newer previously installed.\nCUDA\u0026reg; itself would require a set of specific GPU drivers. Please follow CUDA\u0026reg; installation procedure in the NVIDIA\u0026reg; [web](https://www.nvidia.com/drivers).\n\nIf you want to install our GPU supported simulators, you have to install this other package:\n\n```bash\npip install qiskit-aer-gpu\n```\n\nThe package above is for CUDA\u0026reg 12, so if your system has CUDA\u0026reg; 11 installed, install separate package:\n```bash\npip install qiskit-aer-gpu-cu11\n```\n\nThis will overwrite your current `qiskit-aer` package installation giving you\nthe same functionality found in the canonical `qiskit-aer` package, plus the\nability to run the GPU supported simulators: statevector, density matrix, and unitary.\n\n**Note**: This package is only available on x86_64 Linux. For other platforms\nthat have CUDA support, you will have to build from source. You can refer to\nthe [contributing guide](CONTRIBUTING.md#building-with-gpu-support)\nfor instructions on doing this.\n\n## Simulating your first Qiskit circuit with Aer\nNow that you have Aer installed, you can start simulating quantum circuits using primitives and noise models. Here is a basic example:\n\n```\n$ python\n```\n\n```python\nfrom qiskit import transpile\nfrom qiskit.circuit.library import RealAmplitudes\nfrom qiskit.quantum_info import SparsePauliOp\nfrom qiskit_aer import AerSimulator\n\nsim = AerSimulator()\n# --------------------------\n# Simulating using estimator\n#---------------------------\nfrom qiskit_aer.primitives import EstimatorV2\n\npsi1 = transpile(RealAmplitudes(num_qubits=2, reps=2), sim, optimization_level=0)\npsi2 = transpile(RealAmplitudes(num_qubits=2, reps=3), sim, optimization_level=0)\n\nH1 = SparsePauliOp.from_list([(\"II\", 1), (\"IZ\", 2), (\"XI\", 3)])\nH2 = SparsePauliOp.from_list([(\"IZ\", 1)])\nH3 = SparsePauliOp.from_list([(\"ZI\", 1), (\"ZZ\", 1)])\n\ntheta1 = [0, 1, 1, 2, 3, 5]\ntheta2 = [0, 1, 1, 2, 3, 5, 8, 13]\ntheta3 = [1, 2, 3, 4, 5, 6]\n\nestimator = EstimatorV2()\n\n# calculate [ [\u003cpsi1(theta1)|H1|psi1(theta1)\u003e,\n#              \u003cpsi1(theta3)|H3|psi1(theta3)\u003e],\n#             [\u003cpsi2(theta2)|H2|psi2(theta2)\u003e] ]\njob = estimator.run(\n    [\n        (psi1, [H1, H3], [theta1, theta3]),\n        (psi2, H2, theta2)\n    ],\n    precision=0.01\n)\nresult = job.result()\nprint(f\"expectation values : psi1 = {result[0].data.evs}, psi2 = {result[1].data.evs}\")\n\n# --------------------------\n# Simulating using sampler\n# --------------------------\nfrom qiskit_aer.primitives import SamplerV2\nfrom qiskit import QuantumCircuit\n\n# create a Bell circuit\nbell = QuantumCircuit(2)\nbell.h(0)\nbell.cx(0, 1)\nbell.measure_all()\n\n# create two parameterized circuits\npqc = RealAmplitudes(num_qubits=2, reps=2)\npqc.measure_all()\npqc = transpile(pqc, sim, optimization_level=0)\npqc2 = RealAmplitudes(num_qubits=2, reps=3)\npqc2.measure_all()\npqc2 = transpile(pqc2, sim, optimization_level=0)\n\ntheta1 = [0, 1, 1, 2, 3, 5]\ntheta2 = [0, 1, 2, 3, 4, 5, 6, 7]\n\n# initialization of the sampler\nsampler = SamplerV2()\n\n# collect 128 shots from the Bell circuit\njob = sampler.run([bell], shots=128)\njob_result = job.result()\nprint(f\"counts for Bell circuit : {job_result[0].data.meas.get_counts()}\")\n \n# run a sampler job on the parameterized circuits\njob2 = sampler.run([(pqc, theta1), (pqc2, theta2)])\njob_result = job2.result()\nprint(f\"counts for parameterized circuit : {job_result[0].data.meas.get_counts()}\")\n\n# --------------------------------------------------\n# Simulating with noise model from actual hardware\n# --------------------------------------------------\nfrom qiskit_ibm_runtime import QiskitRuntimeService\nprovider = QiskitRuntimeService(channel='ibm_quantum', token=\"set your own token here\")\nbackend = provider.get_backend(\"ibm_kyoto\")\n\n# create sampler from the actual backend\nsampler = SamplerV2.from_backend(backend)\n\n# run a sampler job on the parameterized circuits with noise model of the actual hardware\nbell_t = transpile(bell, AerSimulator(basis_gates=[\"ecr\", \"id\", \"rz\", \"sx\"]), optimization_level=0)\njob3 = sampler.run([bell_t], shots=128)\njob_result = job3.result()\nprint(f\"counts for Bell circuit w/noise: {job_result[0].data.meas.get_counts()}\")\n```\n\n## Contribution Guidelines\n\nIf you'd like to contribute to Aer, please take a look at our\n[contribution guidelines](CONTRIBUTING.md). This project adheres to Qiskit's [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.\n\nWe use [GitHub issues](https://github.com/Qiskit/qiskit-aer/issues) for tracking requests and bugs. Please use our [slack](https://qiskit.slack.com) for discussion and simple questions. To join our Slack community use the [link](https://qiskit.slack.com/join/shared_invite/zt-fybmq791-hYRopcSH6YetxycNPXgv~A#/). For questions that are more suited for a forum, we use the Qiskit tag in the [Stack Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).\n\n## Next Steps\n\nNow you're set up and ready to check out some of the other examples from the [Aer documentation](https://qiskit.github.io/qiskit-aer/).\n\n## Authors and Citation\n\nAer is the work of [many people](https://github.com/Qiskit/qiskit-aer/graphs/contributors) who contribute to the project at different levels.\nIf you use Qiskit, please cite as per the included [BibTeX file](https://github.com/Qiskit/qiskit/blob/main/CITATION.bib).\n\n## License\n\n[Apache License 2.0](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQiskit%2Fqiskit-aer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQiskit%2Fqiskit-aer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQiskit%2Fqiskit-aer/lists"}