Framework for the Ising model and QUBO.
Project description
OpenJij : Framework for the Ising model and QUBO.
Coverage Graph
Sunburst | Grid | Icicle |
---|---|---|
- python >= 3.8
- (optional) gcc >= 7.0.0
- (optional) cmake >= 3.22
- (optional) Ninja
Change IMPORT
install
install via pip
Note: (2023/08/09) GPGPU algorithms will no longer be supported.
# Binary
$ pip install openjij
# From Source
$ pip install --no-binary=openjij openjij
install via pip from source codes
To install OpenJij from source codes, please install CMake first then install OpenJij.
cmake setup
If you want to use setup.py instead of PIP, You will need to install CMake>=3.22.
We are Highly recommended install CMake via PYPI.
$ pip install -U cmake
Make sure the enviroment path for CMake is set correctly.
install OpenJij
$ pip install --no-binary=openjij openjij
install from github repository
$ git clone git@github.com:OpenJij/OpenJij.git
$ cd openjij
$ python -m pip install -vvv .
For Contributor
Use pre-commit
for auto chech before git commit.
.pre-commit-config.yaml
# pipx install pre-commit
# or
# pip install pre-commit
pre-commit install
Test
Python
$ python -m venv .venv
$ . .venv/bin/activate
$ pip install pip-tools
$ pip-compile setup.cfg
$ pip-compile dev-requirements.in
$ pip-sync requirements.txt dev-requirements.txt
$ source .venv/bin/activate
$ export CMAKE_BUILD_TYPE=Debug
$ python setup.py --force-cmake install --build-type Debug -G Ninja
$ python setup.py --build-type Debug test
$ python -m coverage html
C++
$ mkdir build
$ cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build
$ cmake --build build --parallel
$ cd build
$ ./tests/cxxjij_test
# Alternatively Use CTest
$ ctest --extra-verbose --parallel --schedule-random
Needs: CMake > 3.22, C++17
- Format
$ pip-compile format-requirements.in
$ pip-sync format-requirements.txt
$ python -m isort
$ python -m black
- Aggressive Format
$ python -m isort --force-single-line-imports --verbose ./openjij
$ python -m autoflake --in-place --recursive --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables ./openjij
$ python -m autopep8 --in-place --aggressive --aggressive --recursive ./openjij
$ python -m isort ./openjij
$ python -m black ./openjij
- Lint
$ pip-compile setup.cfg
$ pip-compile dev-requirements.in
$ pip-compile lint-requirements.in
$ pip-sync requirements.txt dev-requirements.txt lint-requirements.txt
$ python -m flake8
$ python -m mypy
$ python -m pyright
Python Documentation
Use Juyter Book for build documentation.
With KaTeX
Need: Graphviz
$ pip-compile setup.cfg
$ pip-compile build-requirements.in
$ pip-compile doc-requirements.in
$ pip-sync requirements.txt build-requirements.txt doc-requirements.txt
Please place your document to docs/tutorial
either markdown or jupyter notebook style.
$ pip install -vvv .
$ jupyter-book build docs --all
How to use
Python example
import openjij as oj
sampler = oj.SASampler()
response = sampler.sample_ising(h={0: -1}, J={(0,1): -1})
response.states
# [[1,1]]
# with indices
response = sampler.sample_ising(h={'a': -1}, J={('a','b'): 1})
[{index: s for index, s in zip(response.indices, state)} for state in response.states]
# [{'b': -1, 'a': 1}]
Community
About us
This product is maintained by Jij Inc.
Please visit our website for more information! https://www.j-ij.com/
Licences
Copyright 2023 Jij Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for openjij-0.9.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b038096af7e90de720b8522231963de145164216de9d3241852b0810a83494f |
|
MD5 | 99f60825593cf67509000dc36273a908 |
|
BLAKE2b-256 | f5210f5c48e4bfa5e87a0e7c142b76a9abd8e29e38dad9708e9ade236f1008fb |
Hashes for openjij-0.9.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dde669079724bc467acec51f0a4ec8a3dcb4042c5eab370a03b18482ede36c3 |
|
MD5 | c587f0b73a6e78411ee6966c8c902eac |
|
BLAKE2b-256 | 1c3a256760198db8abb40f881ac80537326f7f95279a272a633dd9a78600b845 |
Hashes for openjij-0.9.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5303dd87322f41f91f6b54aeb663a678b84bdf0743a9f1efb8c59aa583fe0c1c |
|
MD5 | 4a0ac85e00b839c7ad291c4364a7985d |
|
BLAKE2b-256 | 2305ecd25f7d93dc20f9832e580d6e5b6bb530836e21097d76fe9e65e8204197 |
Hashes for openjij-0.9.1-cp312-cp312-macosx_13_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9575b8c922802900dcc90a202e983aa46e41b08bdc9a665208d0f9b9e5a05e1 |
|
MD5 | 2ee4cd09bd2b360e93649aeced229e77 |
|
BLAKE2b-256 | 6eb1169c51c7cabdba7d047e6c34a71d9e4e6ea4d3fcd533a779d7b8ac2529d5 |
Hashes for openjij-0.9.1-cp312-cp312-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5df657be81c7bfda66f052c25fa2c88c93ee51d4373bf6d4d0ff609210e9a86a |
|
MD5 | 1fe9fe7cfe2e105334758da6b1da32fb |
|
BLAKE2b-256 | 294eb909e70fe893c8dcc32ae90a53fb3ae7dc72e325e89d435158a0e717187d |
Hashes for openjij-0.9.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2292f9b9ceec0289e0097d74a5bf374725e0ea137a5c35fd61998a03f4f9e0c |
|
MD5 | 5cdb8303b769f939174157b847b986f3 |
|
BLAKE2b-256 | beadb9042e151607ab71bc02690f95d9c30bb5612b18fc85b5d2614beed3ab5e |
Hashes for openjij-0.9.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd0a9ba9da836b460c38ae348420ddea58d06657903b176f1281602b1a7084c4 |
|
MD5 | 5afb95f00d21ce4bf37bc057215ccd45 |
|
BLAKE2b-256 | 6b6342d634f361b681974b1ccf86848af6ef466818d7348e472427e83d29a87f |
Hashes for openjij-0.9.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af1e7abb14449b718bee477cafa35aaaf871478c1f3d7ee4dec79c1d67a89a3 |
|
MD5 | d420c42b40b2394374886484b9efbbcb |
|
BLAKE2b-256 | edafd8b9cdffdbc5f0403aa55858f19e6cc1355b05bedd9dd947e5f9156619b4 |
Hashes for openjij-0.9.1-cp311-cp311-macosx_13_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bace53b25087c12a32158e264b4c9537c74b59bee5ac2f3067c858d9c965ca9c |
|
MD5 | 422c5da0a5e0de2d92da2e0177fa27c1 |
|
BLAKE2b-256 | cc16947157eb76674e02f8ee94322d9727266e9d174ced22bae4166d47ad7b89 |
Hashes for openjij-0.9.1-cp311-cp311-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c2c83e88408ad470cc57fd5646e78ea757aed0fb611c158e49aa98c418ab64 |
|
MD5 | f9771c46019106381346113f16685fb3 |
|
BLAKE2b-256 | 9c7ff35a015d2f0b37415a4ec4f7363170746f0ff02ea62536927944ff21c4c3 |
Hashes for openjij-0.9.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ef71cc30ed9b037e7a63e7bc5e7bba6959f1801759fb107e35e90d639e48d7 |
|
MD5 | e5d169bbcd0dc1c455f82df1637292a5 |
|
BLAKE2b-256 | 464a3b0ecffcbe0051cc88b72b1fb3885c08230c3baef3b7d3a1b07acb1d6a8b |
Hashes for openjij-0.9.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd6ac29b34b39c74cb479c99cb30fabc853fc932a398e5e2611abfcf545e1d49 |
|
MD5 | 6b41c36073877f275da142394345f29f |
|
BLAKE2b-256 | 960ad9445a4723bd719ec36273d388346ee8ebd07cf2d391704bc17b618c4cb4 |
Hashes for openjij-0.9.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b229e009540e38ad3665c77404f30a4aa20eaffc423c4468e35eb7e025ff701d |
|
MD5 | ec4c5dd41747fb7866ae09c9259c6fea |
|
BLAKE2b-256 | 2ac5268cfa8c5fada3bf16233c7a69b097bfc9f67d4858e02f3b29f45c86b727 |
Hashes for openjij-0.9.1-cp310-cp310-macosx_13_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35d457453abaee7546d149b4602692e67795b41f9742e6d05837ffe01bdea3d4 |
|
MD5 | 63410b0d2f8350195e860a3fdc773bf6 |
|
BLAKE2b-256 | ba62b7aa76eb68da8d7e71945a35c8667a2b7a1a7d37bb8c49a2cd374c55ca42 |
Hashes for openjij-0.9.1-cp310-cp310-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e5097e45545916aa7c294ffd3694a04b8e8438b734e077cf6b03be313e8263e |
|
MD5 | 4645cb7165c5b93347f67e7752751883 |
|
BLAKE2b-256 | 7b6410497e8d3f8f093fed993b307acf550a4277e1e63bc74de2a21d7b591129 |
Hashes for openjij-0.9.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb22213d58208697769da2159184513823c8730286eb4f9c97bc3c9b4b7ff2c4 |
|
MD5 | 75c86d5961eee467096d2e54c29fb764 |
|
BLAKE2b-256 | 737bcf487bd08ac167048efd74c55b27e347205663a633e582e7ca866e5c7a31 |
Hashes for openjij-0.9.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14880996ab8140d0929f57a72ac44e3108e031994078fc29cb9ea3a1e5a15a00 |
|
MD5 | 0f5ef78e9abf4a6acf2d076108cafa77 |
|
BLAKE2b-256 | 649f593256b9cee693c43b944be87730c7145582ec6ab3d44a0f9cb0d7d24f9a |
Hashes for openjij-0.9.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2b5d6591cac5a5b7891fb96f01745282a63151bc0cadcea0e0a7cf3997baad3 |
|
MD5 | c9f2ef186daf90ccb6035ff26adf6eb5 |
|
BLAKE2b-256 | 5b0c7b2756646e815721340a347fd4722b06f82ed054aa5d9bed174c5ee89a79 |
Hashes for openjij-0.9.1-cp39-cp39-macosx_13_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c58defde5ab79320a977fe7aefb44a08391c07bc6c2f0f420b8387c9b857f939 |
|
MD5 | ffe41ed590dff579af84879c0f8aad4d |
|
BLAKE2b-256 | 6a101fd9d8c6cfdf365793f6e35aab7c6facf6de47eec3b5f36ab81a0014a81f |
Hashes for openjij-0.9.1-cp39-cp39-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 157b830fbc728aaa080516f104a34ef883ca5c024ac5de3108c1d08391a31f79 |
|
MD5 | 2802120d807ad850740b6c719aa599b2 |
|
BLAKE2b-256 | 8eaf05d866427b57e15b4c6e76ede718142859c46d6b52bdc1895198b561dd83 |
Hashes for openjij-0.9.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1320e74d4ee17883d244a5e890b9ae13fb962b48b06562c63f95adab8c7b041 |
|
MD5 | 0ecb59baf853b099fc981a098dfb33e1 |
|
BLAKE2b-256 | bb43785e501cd5dcdac567e8112bc4473f321cd096ee9bcf479a10f549d6024b |
Hashes for openjij-0.9.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27fe68528b5400b50a7db3488cae46f68c176cab135a7ed81cc5d7fc1a3cf8fe |
|
MD5 | be3496b4f6dba6ca89e27599c409b183 |
|
BLAKE2b-256 | bbe53147e1bb12d1c0c76cb66bdcc10ce2a1cef27079a01a390d363075e74307 |
Hashes for openjij-0.9.1-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50423dcdb5f385486a04e7a84ac049bc9b732df8411f79c50ad768fab5ef48fd |
|
MD5 | 31be9858fa83ecf522dbe861542f8e78 |
|
BLAKE2b-256 | 29f10c380050c4670ba1d11304182d40e1ee374f58b4f068e8a68fbc6b51be70 |
Hashes for openjij-0.9.1-cp38-cp38-macosx_13_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2436d3b772b2b7e55a5dccb08451c27475d6cb8c7b1b73714cb80664d8cd7588 |
|
MD5 | 2a9e3b204af3ac52eb4d31798d278667 |
|
BLAKE2b-256 | bfb74eba4f89788743c4ef8d8cce6dd9a8f95d8f1deaab8e5700beeb8bbde8be |
Hashes for openjij-0.9.1-cp38-cp38-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dffb1b9a9bc330eaa64d6db9baebdc2f516fd569c1abbe253c6052c34818d9d |
|
MD5 | 10a8c98ae08575642e5a9f21ce597769 |
|
BLAKE2b-256 | 7355e06a13c1ed0b2dc237f1fcc3c0f18671bf13be1385a48ee83315b9683a40 |