Framework for the Ising model and QUBO.
Project description
OpenJij : Framework for the Ising model and QUBO.
Coverage Graph
Sunburst | Grid | Icicle |
---|---|---|
- python >= 3.7
- (optional) gcc >= 7.0.0
- (optional) cmake >= 3.22
- (optional) Ninja
Change IMPORT
-
OpenJij >= v0.5.0
import openjij.cxxjij
-
OpenJij <= v0.4.9
import cxxjij
install
install via pip
Note: To use GPGPU algorithms, please follow the section
install via pip from source codes
below. GPGPU algorithms are automatically enabled once CMake finds CUDA frameworks during installation.
# Binary
$ pip install openjij
# From Source (CUDA)
$ pip install --no-binary=openjij,jij-cimod 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,jij-cimod 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
$ pip install pip-tools
$ pip-compile
$ 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
$ 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
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 2022 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.5.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d187512005d77c295ed7d2c629f1e2d66f549ccb0e9be162e4525935b4c5599 |
|
MD5 | 271ecc32744eadc122578a91bd7d3b5f |
|
BLAKE2b-256 | aec9360d7f66ab2e19ad569e6fce06aaee2326d7a045222e8e1119e366794f74 |
Hashes for openjij-0.5.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9efaa51fb97f0b4bb146619c607274f21a32719d26585c422a5eec2567641b15 |
|
MD5 | a26342f11f0c0ce76d1de7e5e16d5074 |
|
BLAKE2b-256 | a0900b4eba111a063889680a66cc3bababc5b91ba35084388b69f796df1f7689 |
Hashes for openjij-0.5.3-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 903072e413ea079a3447337cc0a38bf1bc50b30a26ce088c55dd189ab59d9b90 |
|
MD5 | 00ded26f14ed517e5d5f44d535e4d544 |
|
BLAKE2b-256 | 827193eee86c5a627b8477a2a5a006bc1cce5e573c6310374029bc97f0e399ac |
Hashes for openjij-0.5.3-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0e7e592db7c875e4d27d9f972d6f0121a0b180b5e55c00c1086acc1d76b28e2 |
|
MD5 | 54bf33ef4637dd3987d75a71bc3a6bd8 |
|
BLAKE2b-256 | 2065935aaa248095a47f53175a1166d29cd07ae022159a8b8d5a0dfd09acbd47 |
Hashes for openjij-0.5.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 286d68eb7f0293d2d946f4bd0f74bd90d5397ac219dd511c977218100d07ea63 |
|
MD5 | ad7a5554d282bdceeb9d7542ae398429 |
|
BLAKE2b-256 | 3991a12f4d579164162fd549641ec43c9616585acdbc3a1158ed4f5f1f065c8a |
Hashes for openjij-0.5.3-cp310-cp310-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea4ef75b99613cfc982a0016980db91479af5b879bdc884cd2c11ca5f0a2ed77 |
|
MD5 | 5a7e982c03e8c754a26e058cc27aa6c9 |
|
BLAKE2b-256 | 2b256630a0dcef672bd830b09b32756722f9aa633b14c5b7dacddea88dda115a |
Hashes for openjij-0.5.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2983714210f7cea378683112f5868ae7fade70c6bfec65b6945a00c687701a8c |
|
MD5 | a368d3e0db10836011bbdf3ffa8c1b86 |
|
BLAKE2b-256 | bfb29b4f4974c946cb5092d07efd0cef3ff141ba9ff091da319687402d868a9a |
Hashes for openjij-0.5.3-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916ac7b94af79be016989dde04fd1b115a402aa88af0842ef6c84a06722d8b97 |
|
MD5 | 348c5884189bb32113bf418071b371bf |
|
BLAKE2b-256 | 0e65cb841db46a09efd1ec49d60da36b81ce8d90df6612345c3bcb972539673b |
Hashes for openjij-0.5.3-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c9f921103a437e332b2f89e8aba9f7dc2d146045b37eafe604df92522a9a176 |
|
MD5 | 061fd6953a0e397cbdb4e2b57685ed53 |
|
BLAKE2b-256 | d43d11642baebab14282a1f9a77fa8995e51981f400e0143346f893d1b47c05f |
Hashes for openjij-0.5.3-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b412d4028d0482138b2262889e9ea24705736299b6f0ae2dedffde604418653 |
|
MD5 | 9b487ffd42599d94bcb720c7599c5b53 |
|
BLAKE2b-256 | 4c808a62b79f1404f6393a52ba24974ff8708a40503513f9d10d0e5caee5da6d |
Hashes for openjij-0.5.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d80135bf5d85e585f7aae7aad652e20694566da0ed52cc9a9f69de439bed061 |
|
MD5 | f51ac7e4473ef62c55ada4b32d5d98bb |
|
BLAKE2b-256 | bc3fccc42a49ecd9b748add1b3589b7b0b37621ce00b96a2cc355cd7081c8ced |
Hashes for openjij-0.5.3-cp39-cp39-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ef9c6d1387b497b1c1f5e7699d075eb115c7ad69061be2883f4464ef3bb845a |
|
MD5 | 5f6bb53ba8a8adb8bdc93ab00aa58417 |
|
BLAKE2b-256 | 0d6afe1c554e115abba7266265e6f1c8830733bdaa24ef7eed2593ceb5aafc01 |
Hashes for openjij-0.5.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b791ddd3a2f6d2ff82118cc1cede88d4a6f5f5c3b984172b2d766fbb42a239 |
|
MD5 | 529f0f98e8b6088e573982277066179b |
|
BLAKE2b-256 | 6555344d600624c3b81a47560e852d8ffc789cf4165e025503b2e9650ad58dd5 |
Hashes for openjij-0.5.3-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703a179f8a69c4ea39dee42c7d2960ab11ecbc01bba5b17f26c294423e57fcf1 |
|
MD5 | b3caa83a2e4cf71aae48793986107ac6 |
|
BLAKE2b-256 | a9885e953122aafb742c1f85bf85fa35f88ff84acd4de6beff7621116aaf24da |
Hashes for openjij-0.5.3-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8735c3a508c6830df88e6f120c0b796970210916539f4a56420c20885ddd29d9 |
|
MD5 | f67271b4c650d967270474ef2e99e3d8 |
|
BLAKE2b-256 | a8f9801abf08ccb3fc5605e46254f11f09787c66acf36124d0980a5edcc60ad5 |
Hashes for openjij-0.5.3-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c18c542d599fec61f9b53e120f61e20a7d944687f03d1d82dc93dc0ea49f6ee |
|
MD5 | 6deb7f2733dd26b20205e0afea3ec58c |
|
BLAKE2b-256 | 0efc64c2b81431831f34a777759d196656255c64a10446cea6755af9550fd80a |
Hashes for openjij-0.5.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976269685647988e45884bc192c469ba0add95266606a0f74bc576250953c95a |
|
MD5 | c8268d37f70c8b097c7eeeae49566a3d |
|
BLAKE2b-256 | a984829e32ffabe26b59d6bc0c19116cabc7eec9ba2d215015f77cde1533e8ce |
Hashes for openjij-0.5.3-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7a09d0d5026298cea1a60ad9a259c40715f3226d54d8cc28e252221bf4e8c82 |
|
MD5 | beef24fe990b74db09293deaa8f3e48c |
|
BLAKE2b-256 | bdaf4643914d783a5b711ea511058707511cac703c12c4249534cfc562f36d59 |
Hashes for openjij-0.5.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523f94719c24e75c5389e77172f915a608c9aea206d4891e9a6300d3e7a6b924 |
|
MD5 | 17365f4bec24f9eb3d9ecdbaca56db3f |
|
BLAKE2b-256 | c4c8c5d483cb0c959050d1ba57ee5fa70c6d3347fee990fb7b277178d378fc70 |
Hashes for openjij-0.5.3-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3ffd4ead601c7c3d7800bb0efe5ca76224577f70643aa0318c591dc03561f4c |
|
MD5 | 8dcb00fac196570d0d7c91d558921129 |
|
BLAKE2b-256 | cf0afaeda0f5ea0f98a1133cb5fbd98dc29f864e3631d2d103e033933fe6fdca |
Hashes for openjij-0.5.3-cp37-cp37m-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14764a47b7fb1bfc8527fb147062a31cc88068e77a2c246be43eb0770b412279 |
|
MD5 | 3763d3974a432ea502d85b870332a2ed |
|
BLAKE2b-256 | 349c83d96a23cc8b081c35f1166db113ddaed9ce69e43e7e5e98cafae9bec6b0 |
Hashes for openjij-0.5.3-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5292ad0e7d667c236275efc0144a495e760d99e0a3ac61b72b66352f97b357 |
|
MD5 | ef0af11ea8021380e8029008557c2d24 |
|
BLAKE2b-256 | 7472522f03cff69b1bd03d4bc9d71de56d91cd9473aaa8139bad602d0130b655 |
Hashes for openjij-0.5.3-cp37-cp37m-macosx_10_16_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58ad05d0ca4c9b02a3010629780f48ffac5826049c76bc02f22c36b5e12eb47e |
|
MD5 | e0c8b202f6975128747ee9866263ed16 |
|
BLAKE2b-256 | fe81d09cb9cc74ed7a5d1b7a34777cf55c804f7162b427532629d6f479d0d49a |