{"id":29596237,"url":"https://github.com/jij-inc/openjij","last_synced_at":"2025-07-20T09:13:09.798Z","repository":{"id":37601480,"uuid":"164117633","full_name":"Jij-Inc/OpenJij","owner":"Jij-Inc","description":"OpenJij  : Framework for the Ising model and QUBO.","archived":false,"fork":false,"pushed_at":"2025-07-18T02:54:42.000Z","size":51570,"stargazers_count":108,"open_issues_count":15,"forks_count":30,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-07-18T04:28:36.254Z","etag":null,"topics":["benchmarking","cmake","optimization","python","quantum-annealing","quantum-computing","quantum-mechanics","simulated-annealing"],"latest_commit_sha":null,"homepage":"https://www.openjij.org/","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/Jij-Inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-04T14:31:51.000Z","updated_at":"2025-07-18T00:09:53.000Z","dependencies_parsed_at":"2023-12-29T06:14:09.577Z","dependency_job_id":"280d9f10-020f-4b68-9506-33da74d6e809","html_url":"https://github.com/Jij-Inc/OpenJij","commit_stats":{"total_commits":1949,"total_committers":26,"mean_commits":74.96153846153847,"dds":0.5541303232426886,"last_synced_commit":"2d8afafa7cc75e6366d1cf01c05e5592d02c097f"},"previous_names":["jij-inc/openjij","openjij/openjij"],"tags_count":118,"template":false,"template_full_name":null,"purl":"pkg:github/Jij-Inc/OpenJij","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jij-Inc%2FOpenJij","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jij-Inc%2FOpenJij/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jij-Inc%2FOpenJij/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jij-Inc%2FOpenJij/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jij-Inc","download_url":"https://codeload.github.com/Jij-Inc/OpenJij/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jij-Inc%2FOpenJij/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266094083,"owners_count":23875571,"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":["benchmarking","cmake","optimization","python","quantum-annealing","quantum-computing","quantum-mechanics","simulated-annealing"],"created_at":"2025-07-20T09:13:07.315Z","updated_at":"2025-07-20T09:13:09.789Z","avatar_url":"https://github.com/Jij-Inc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenJij : Framework for the Ising model and QUBO.\n\n[![PyPI version shields.io](https://img.shields.io/pypi/v/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![PyPI implementation](https://img.shields.io/pypi/implementation/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![PyPI format](https://img.shields.io/pypi/format/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![PyPI license](https://img.shields.io/pypi/l/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![PyPI download month](https://img.shields.io/pypi/dm/openjij.svg)](https://pypi.python.org/pypi/openjij/)\n[![Downloads](https://static.pepy.tech/badge/openjij)](https://pepy.tech/project/openjij)\n\n[![CPP Test](https://github.com/OpenJij/OpenJij/actions/workflows/ci-test-cpp.yml/badge.svg)](https://github.com/OpenJij/OpenJij/actions/workflows/ci-test-cpp.yml)\n[![Python Test](https://github.com/OpenJij/OpenJij/actions/workflows/ci-test-python.yaml/badge.svg)](https://github.com/OpenJij/OpenJij/actions/workflows/ci-test-python.yaml)\n[![Build Documentation](https://github.com/OpenJij/OpenJij/actions/workflows/buid-doc.yml/badge.svg)](https://github.com/OpenJij/OpenJij/actions/workflows/buid-doc.yml)\n[![CodeQL](https://github.com/OpenJij/OpenJij/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/OpenJij/OpenJij/actions/workflows/codeql-analysis.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0204475dc07d48ffa851480d03db759e)](https://www.codacy.com/gh/OpenJij/OpenJij/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=OpenJij/OpenJij\u0026utm_campaign=Badge_Grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/3b2f43f3e601ae74c497/maintainability)](https://codeclimate.com/github/OpenJij/OpenJij/maintainability)\n[![codecov](https://codecov.io/gh/OpenJij/OpenJij/branch/main/graph/badge.svg?token=WMSK3GS8E5)](https://codecov.io/gh/OpenJij/OpenJij)\n\n[![DOI](https://zenodo.org/badge/164117633.svg)](https://zenodo.org/badge/latestdoi/164117633)\n\n## Coverage Graph\n\n| **Sunburst**                                                                                                                                                         | **Grid**                                                                                                                                                         | **Icicle**                                                                                                                                                         |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| \u003ca href=\"https://codecov.io/gh/OpenJij/OpenJij\"\u003e\u003cimg src=\"https://codecov.io/gh/OpenJij/OpenJij/branch/main/graphs/sunburst.svg?token=WMSK3GS8E5\" width=\"100%\"/\u003e\u003c/a\u003e | \u003ca href=\"https://codecov.io/gh/OpenJij/OpenJij\"\u003e\u003cimg src=\"https://codecov.io/gh/OpenJij/OpenJij/branch/main/graphs/tree.svg?token=WMSK3GS8E5\" width=\"100%\"/\u003e\u003c/a\u003e | \u003ca href=\"https://codecov.io/gh/OpenJij/OpenJij\"\u003e\u003cimg src=\"https://codecov.io/gh/OpenJij/OpenJij/branch/main/graphs/icicle.svg?token=WMSK3GS8E5\" width=\"100%\"/\u003e\u003c/a\u003e |\n\n- python \u003e= 3.8\n- (optional) gcc \u003e= 7.0.0\n- (optional) cmake \u003e= 3.22\n- (optional) Ninja\n\n[OpenJij Website](https://www.openjij.org/)\n\n### Change **IMPORT**\n\n- OpenJij \u003e= v0.5.0\n\n  ```python\n  import openjij.cxxjij\n  ```\n\n- OpenJij \u003c= v0.4.9\n\n  ```python\n  import cxxjij\n  ```\n\n- [Documents](https://jij-inc.github.io/OpenJij/)\n\n- [C++ Docs](https://openjij.github.io/OpenJij-Reference-Page/index.html)\n\n## install\n\n### install via pip\n\n\u003e Note: (2023/08/09) GPGPU algorithms will no longer be supported.\n\n```\n# Binary\n$ pip install openjij \n# From Source\n$ pip install --no-binary=openjij openjij\n```\n\n### install via pip from source codes\n\nTo install OpenJij from source codes, please install CMake first then install OpenJij.\n\n#### cmake setup\n\nIf you want to use setup.py instead of PIP, You will need to install CMake\u003e=3.22.\\\nWe are Highly recommended install CMake via PYPI.\n\n```\n$ pip install -U cmake\n```\n\nMake sure the enviroment path for CMake is set correctly.\n\n#### install OpenJij\n\n```\n$ pip install --no-binary=openjij openjij\n```\n\n### install from github repository\n\n```\n$ git clone git@github.com:OpenJij/OpenJij.git\n$ cd openjij\n$ python -m pip install -vvv .\n```\n\n### Development Install (Recommended for Contributors)\n\nFor faster development iteration, use the editable install approach:\n\n```sh\n$ git clone git@github.com:OpenJij/OpenJij.git\n$ cd OpenJij\n$ python -m venv .venv\n$ source .venv/bin/activate  # or `.venv\\Scripts\\activate` on Windows\n$ pip-compile setup.cfg\n$ pip-compile dev-requirements.in\n$ pip-sync requirements.txt dev-requirements.txt\n# Build C++ extension only (faster than full install)\n$ python setup.py build_ext --inplace\n# Install Python code in editable mode\n$ pip install -e . --no-build-isolation\n```\n\nThis setup allows you to:\n- Edit Python code and see changes immediately (no reinstall needed)\n- Only rebuild C++ when you modify C++ source files\n- Maintain fast development iterations\n\nWhen you modify C++ code, rebuild with:\n```sh\n$ python setup.py build_ext --inplace\n```\n\n### Troubleshooting Development Setup\n\nIf you encounter issues:\n\n1. **Import errors after editable install**: Make sure C++ extension is built:\n   ```sh\n   $ python setup.py build_ext --inplace\n   ```\n\n2. **CMake errors**: Ensure you have CMake \u003e 3.22:\n   ```sh\n   $ pip install -U cmake\n   ```\n\n3. **Clean rebuild**: Remove build artifacts and rebuild:\n   ```sh\n   $ rm -rf _skbuild/ openjij/*.so openjij/include/ openjij/share/\n   $ python setup.py build_ext --inplace\n   ```\n\n4. **Check installation**: Verify the setup is working:\n   ```sh\n   $ python -c \"import openjij; print('Success:', dir(openjij))\"\n   ```\n\n## For Contributor\n\nUse `pre-commit` for auto chech before git commit.\n`.pre-commit-config.yaml`\n\n```\n# pipx install pre-commit \n# or \n# pip install pre-commit\npre-commit install\n```\n\n## Test\n\n### Python\n\n```sh\n$ python -m venv .venv\n$ . .venv/bin/activate\n$ pip install pip-tools \n$ pip-compile setup.cfg\n$ pip-compile dev-requirements.in\n$ pip-sync requirements.txt dev-requirements.txt\n$ source .venv/bin/activate\n$ export CMAKE_BUILD_TYPE=Debug\n$ python setup.py --force-cmake install --build-type Debug -G Ninja\n$ python setup.py --build-type Debug test \n$ python -m coverage html\n```\n\n### Development with Editable Install\n\nFor development, you can build only the C++ extension once and install Python code in editable mode:\n\n```sh\n# Build C++ extension only (in-place)\n$ python setup.py build_ext --inplace\n\n# Install Python code in editable mode (without rebuilding C++)\n$ pip install -e . --no-build-isolation\n\n# Now you can edit Python code and changes will be reflected immediately\n# To rebuild C++ extension after making C++ changes:\n$ python setup.py build_ext --inplace\n```\n\nThis approach allows you to:\n- Modify Python code without reinstalling\n- Only rebuild C++ when necessary\n- Faster development iteration\n\n### C++\n\n```sh\n$ mkdir build \n$ cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build\n$ cmake --build build --parallel\n$ cd build\n$ ./tests/cxxjij_test\n# Alternatively  Use CTest \n$ ctest --extra-verbose --parallel --schedule-random\n```\n\n\nNeeds: CMake \u003e 3.22, C++17\n\n- Format\n\n```sh\n$ pip-compile format-requirements.in\n$ pip-sync format-requirements.txt\n```\n\n```sh\n$ python -m isort \n$ python -m black \n```\n\n- Aggressive Format\n\n```sh\n$ python -m isort --force-single-line-imports --verbose ./openjij\n$ python -m autoflake --in-place --recursive --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables ./openjij\n$ python -m autopep8 --in-place --aggressive --aggressive  --recursive ./openjij\n$ python -m isort ./openjij\n$ python -m black ./openjij\n```\n\n- Lint\n\n```sh\n$ pip-compile setup.cfg\n$ pip-compile dev-requirements.in\n$ pip-compile lint-requirements.in\n$ pip-sync requirements.txt dev-requirements.txt lint-requirements.txt\n```\n\n```sh\n$ python -m flake8\n$ python -m mypy\n$ python -m pyright\n```\n\n## Python Documentation \nUse Juyter Book for build documentation.   \nWith KaTeX    \nNeed: Graphviz\n\n``` sh\n$ pip-compile setup.cfg\n$ pip-compile build-requirements.in\n$ pip-compile doc-requirements.in\n$ pip-sync requirements.txt build-requirements.txt doc-requirements.txt\n```\n\nPlease place your document to `docs/tutorial`either markdown or jupyter notebook style.\n\n```sh\n$ pip install -vvv .\n```\n\n```sh \n$ jupyter-book build docs --all\n```\n\n\n## How to use\n\n### Python example\n\n```python\nimport openjij as oj\nsampler = oj.SASampler()\nresponse = sampler.sample_ising(h={0: -1}, J={(0,1): -1})\nresponse.states\n# [[1,1]]\n\n# with indices\nresponse = sampler.sample_ising(h={'a': -1}, J={('a','b'): 1})\n[{index: s for index, s in zip(response.indices, state)} for state in response.states]\n# [{'b': -1, 'a': 1}]\n```\n\n## Community\n\n- [OpenJij Discord Community](https://discord.gg/Km5dKF9JjG)\n\n## About us\n\nThis product is maintained by Jij Inc.\n\n**Please visit our website for more information!**\nhttps://www.j-ij.com/\n\n### Licences\n\nCopyright 2023 Jij Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\\\nyou may not use this file except in compliance with the License.\\\nYou may obtain a copy of the License at\n\n```\n http://www.apache.org/licenses/LICENSE-2.0  \n```\n\nUnless required by applicable law or agreed to in writing, software\\\ndistributed under the License is distributed on an \"AS IS\" BASIS,\\\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\\nSee the License for the specific language governing permissions and\\\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjij-inc%2Fopenjij","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjij-inc%2Fopenjij","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjij-inc%2Fopenjij/lists"}