{"id":13590485,"url":"https://github.com/qulacs/qulacs","last_synced_at":"2026-01-15T00:50:41.677Z","repository":{"id":37385093,"uuid":"151675481","full_name":"qulacs/qulacs","owner":"qulacs","description":"Variational Quantum Circuit Simulator for Quantum Computation Research","archived":false,"fork":false,"pushed_at":"2025-09-01T00:44:20.000Z","size":5978,"stargazers_count":484,"open_issues_count":16,"forks_count":129,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-10-03T19:59:51.968Z","etag":null,"topics":["nisq","quantum-circuit","quantum-circuit-simulator","quantum-computing","qulacs"],"latest_commit_sha":null,"homepage":"","language":"C++","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/qulacs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-05T05:39:51.000Z","updated_at":"2025-09-26T12:06:06.000Z","dependencies_parsed_at":"2023-11-28T01:28:27.676Z","dependency_job_id":"0aeae1dd-44d7-43f5-866d-3db376fe6d4f","html_url":"https://github.com/qulacs/qulacs","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/qulacs/qulacs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qulacs%2Fqulacs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qulacs%2Fqulacs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qulacs%2Fqulacs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qulacs%2Fqulacs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qulacs","download_url":"https://codeload.github.com/qulacs/qulacs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qulacs%2Fqulacs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nisq","quantum-circuit","quantum-circuit-simulator","quantum-computing","qulacs"],"created_at":"2024-08-01T16:00:46.246Z","updated_at":"2026-01-15T00:50:41.671Z","avatar_url":"https://github.com/qulacs.png","language":"C++","funding_links":[],"categories":["C++","Frameworks \u0026 Libraries","Simulation Tools"],"sub_categories":["Quantum Simulation \u0026 Specialized Libraries"],"readme":"# Qulacs\n\n[![Ubuntu CI](https://github.com/qulacs/qulacs/actions/workflows/ci_ubuntu.yml/badge.svg)](https://github.com/qulacs/qulacs/actions/workflows/ci_ubuntu.yml)\n[![macOS CI](https://github.com/qulacs/qulacs/actions/workflows/ci_macos.yml/badge.svg)](https://github.com/qulacs/qulacs/actions/workflows/ci_macos.yml)\n[![Windows CI](https://github.com/qulacs/qulacs/actions/workflows/ci_windows.yml/badge.svg)](https://github.com/qulacs/qulacs/actions/workflows/ci_windows.yml)\n[![Wheel build](https://github.com/qulacs/qulacs/actions/workflows/wheel.yml/badge.svg)](https://github.com/qulacs/qulacs/actions/workflows/wheel.yml)\n[![Downloads](https://pepy.tech/badge/qulacs)](https://pepy.tech/project/qulacs)\n\n\nQulacs is a Python/C++ library for fast simulation of large, noisy, or parametric quantum circuits.\nQulacs is developed at QunaSys, Osaka University, NTT, and Fujitsu.\n\nQulacs is licensed under the [MIT license](https://github.com/qulacs/qulacs/blob/master/LICENSE).\n\n## Quick Install for Python\n\n```\npip install qulacs\n```\n\nIf your CPU is older than Intel Haswell architecture, the binary installed with the above command does not work. In this case, please install Qulacs with the following command.\nEven if your CPU is newer than Haswell, Qulacs installed with the below command shows better performance but takes a longer time. See \"Install Python library from source\" section for detail.\n\n```\npip install git+https://github.com/qulacs/qulacs.git\n```\n\nIf you have NVIDIA GPU and CUDA is installed, GPU-version can be installed with the following command:\n```\npip install qulacs-gpu\n```\n\n## Features\n\n**Note**\nQulacs-Osaka/qulacs-osaka was integrated into the qulacs/qulacs. For more details, please refer to [Information](#Information) section.\n\n- Fast quantum circuit simulation with parallelized C/C++ backend\n- Noisy quantum gate for simulation of NISQ devices\n- Parametric quantum gates for variational methods\n- Circuit compression for fast simulation\n- GPU support for fast simulation\n- Many utility functions for research\n\n## Performance\n\nThe time for simulating random quantum circuits is compared with several quantum circuit simulators in November 2020.\n\nSee [the benchmark repository](https://github.com/qulacs/benchmark-qulacs) and [Section VI and VII of our paper](https://arxiv.org/abs/2011.13524) for the detail of this benchmark.\n\nNote that the plots with names ending with \"opt\" and \"heavy opt\" perform circuit optimization for fast simulation, where the time for optimization is included in the execution time.\n\n### Single-thread benchmark\n\n![single thread benchmark](https://storage.googleapis.com/qunasys/fig_both_singlethread.png)\n\n### Multi-thread benchmark\n\n![multi thread benchmark](https://storage.googleapis.com/qunasys/fig_both_multithread.png)\n\n### GPU benchmark\n\n![GPU benchmark](https://storage.googleapis.com/qunasys/fig_both_gpu.png)\n\n## Install Python library from source\n\nTo install Qulacs optimized for your system, we recommend the following install procedure for faster simulation of quantum circuits, while this requires a compiler and takes time for installation. In addition, you can enable or disable optimization features such as SIMD optimization, OpenMP parallelization, and GPU support.\n\nA binary that is installed via pip command is optimized for Haswell architecture. Thus, Qulacs installed via pip command does not work with a CPU older than Haswell. If your CPU is newer than Haswell, Qualcs built from source shows the better performance.\n\n### Requirements\n\n- C++ compiler (gcc or VisualStudio)\n  - gcc/g++ \u003e= 7.0.0 (checked in Linux, MacOS, cygwin, MinGW, and WSL)\n  - Microsoft VisualStudio C++ 2015 or later\n- [Boost](https://github.com/boostorg/boost) \u003e= 1.71.0 (Minimum version tested in CI)\n- Python \u003e= 3.9\n- CMake \u003e= 3.21\n- git\n- (option) CUDA \u003e= 8.0\n- (option) AVX2 support\n\nIf your system supports AVX2 instructions, SIMD optimization is automatically enabled. \nIf you want to enable GPU simulator, install qulacs through `qulacs-gpu` package or build from source.\nNote that `qulacs-gpu` includes CPU simulator. You don't need to install both.\n\nQulacs is tested on the following systems.\n\n- Ubuntu 20.04\n- macOS Big Sur 11\n- Windows Server 2019\n\nIf you encounter some troubles, see [troubleshooting](https://docs.qulacs.org/en/latest/intro/2_faq.html).\n\n### How to install\n\nInstall with default options (Multi-thread without GPU):\n\n```\npip install .\n```\n\nIf AVX2 instructions are not supported, SIMD optimization is automatically disabled.\n\n\nInstall with GPU support (CUDA is required):\n\n```\nUSE_GPU=Yes pip install .\n```\n\nInstall single-thread Qulacs:\n\n```\nUSE_OMP=No pip install .\n```\n\nThe number of threads used in Qulacs installed with default options can be controlled via the environment variable `OMP_NUM_THREADS` or `QULACS_NUM_THREADS`.\nWhile `OMP_NUM_THREADS` affects the parallelization of other libraries, `QULACS_NUM_THREADS` controls only the parallelization of QULACS.\nOr, if you want to force only Qulacs to use a single thread, You can install single-thread Qulacs with the above command.\n\nFor development purpose, optional dependencies can be installed as follows.\n```\n# Install development tools\npip install .[dev]\n# Install dependencies for document generation\npip install .[doc]\n```\n\nUninstall Qulacs:\n\n```\npip uninstall qulacs\n```\n\n## Use Qulacs as C++ library\n\n### Build with GCC\n\nStatic libraries of Qulacs can be built with the following commands:\n\n```\ngit clone https://github.com/qulacs/qulacs.git\ncd qulacs\n./script/build_gcc.sh\n```\n\nTo build shared libraries, execute `make shared` at `./qulacs/build` folder.\nWhen you want to build with GPU, use `build_gcc_with_gpu.sh` instead of `build_gcc.sh`.\n\nThen, you can build your codes with the following gcc command:\n\n```sh\ng++ -O2 -I ./\u003cqulacs_path\u003e/include -L ./\u003cqulacs_path\u003e/lib \u003cyour_code\u003e.cpp -lvqcsim_static -lcppsim_static -lcsim_static -fopenmp\n```\n\nIf you want to run your codes with GPU, include `cppsim/state_gpu.hpp` and use `QuantumStateGpu` instead of `QuantumState` and build with the following command:\n\n```\nnvcc -O2 -I ./\u003cqulacs_path\u003e/include -L ./\u003cqulacs_path\u003e/lib \u003cyour_code\u003e.cu -lvqcsim_static -lcppsim_static -lcsim_static -lgpusim_static -D _USE_GPU -lcublas -Xcompiler -fopenmp\n```\n\n### Build with MSVC\n\nStatic libraries of Qulacs can be built with the following command:\n\n```\ngit clone https://github.com/qulacs/qulacs.git\ncd qulacs\nscript/build_msvc_2017.bat\n```\n\nWhen you want to build with GPU, use `build_msvc_2017_with_gpu.bat`.\nIf you use MSVC with other versions, use `build_msvc_2015.bat` or edit the generator name in `build_msvc_2017.bat`.\n\nYour C++ codes can be built with Qulacs with the following process:\n\n1. Create an empty project.\n1. Select \"x64\" as an active solution platform.\n1. Right Click your project name in Solution Explorer, and select \"Properties\".\n1. At \"VC++ Directories\" section, add the full path to `./qulacs/include` to \"Include Directories\"\n1. At \"VC++ Directories\" section, add the full path to `./qulacs/lib` to \"Library Directories\"\n1. At \"C/C++ -\u003e Code Generation\" section, change \"Runtime library\" to \"Multi-threaded (/MT)\".\n1. At \"Linker -\u003e Input\" section, add `vqcsim_static.lib;cppsim_static.lib;csim_static.lib;` to \"Additional Dependencies\".\n\n## Tutorial and API documents\n\nSee the following documents for tutorials.\n\n- [Python Tutorial](http://docs.qulacs.org/en/latest/intro/4.1_python_tutorial.html)\n- [C++ Tutorial](http://docs.qulacs.org/en/latest/intro/4.2_cpp_tutorial.html)\n- [Manual](http://docs.qulacs.org/en/latest/guide/2.0_python_advanced.html)\n- [Examples](http://docs.qulacs.org/en/latest/apply/0_overview.html)  \n\n\n### Python sample code\n\n```python\nfrom qulacs import Observable, QuantumCircuit, QuantumState\nfrom qulacs.gate import Y,CNOT,merge\n\nstate = QuantumState(3)\nstate.set_Haar_random_state()\n\ncircuit = QuantumCircuit(3)\ncircuit.add_X_gate(0)\nmerged_gate = merge(CNOT(0,1),Y(1))\ncircuit.add_gate(merged_gate)\ncircuit.add_RX_gate(1,0.5)\ncircuit.update_quantum_state(state)\n\nobservable = Observable(3)\nobservable.add_operator(2.0, \"X 2 Y 1 Z 0\")\nobservable.add_operator(-3.0, \"Z 2\")\nvalue = observable.get_expectation_value(state)\nprint(value)\n```\n\nIf you want to run it on GPU, install GPU-enabled qulacs and replace `QuantumState` in the above codes with `QuantumStateGpu`.\n\n### C++ sample code\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003ccppsim/state.hpp\u003e\n#include \u003ccppsim/circuit.hpp\u003e\n#include \u003ccppsim/observable.hpp\u003e\n#include \u003ccppsim/gate_factory.hpp\u003e\n#include \u003ccppsim/gate_merge.hpp\u003e\n\nint main(){\n    QuantumState state(3);\n    state.set_Haar_random_state();\n\n    QuantumCircuit circuit(3);\n    circuit.add_X_gate(0);\n    auto merged_gate = gate::merge(gate::CNOT(0,1),gate::Y(1));\n    circuit.add_gate(merged_gate);\n    circuit.add_RX_gate(1,0.5);\n    circuit.update_quantum_state(\u0026state);\n\n    Observable observable(3);\n    observable.add_operator(2.0, \"X 2 Y 1 Z 0\");\n    observable.add_operator(-3.0, \"Z 2\");\n    auto value = observable.get_expectation_value(\u0026state);\n    std::cout \u003c\u003c value \u003c\u003c std::endl;\n    return 0;\n}\n```\n\nIf you place the above codes in the root directory of this repository(e.g., `qulacs/main.cpp`), you can build your codes with the following command:\n\n```\ng++ -O2 -I ./include -L ./lib main.cpp -fopenmp -lcppsim_static -lcsim_static\n```\n\nIf you want to run it on GPU, include `cppsim/state_gpu.hpp` and replace `QuantumState` with `QuantumStateGpu`.\n\n\n## How to cite\n\nPlease cite this arXiv paper: [Qulacs: a fast and versatile quantum circuit simulator for research purpose](https://arxiv.org/abs/2011.13524)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqulacs%2Fqulacs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqulacs%2Fqulacs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqulacs%2Fqulacs/lists"}