Framework for the Ising model and QUBO
Project description
OpenJij : Framework for the Ising model and QUBO.
- python >= 3.6
- (optional) gcc >= 7.0.0 (or another C++ compiler that supports C++17)
- (optional) cmake >= 3.12.2
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.
$ pip install openjij
install via pip from source codes
To install OpenJij from source codes, please install CMake first then install OpenJij.
cmake setup
If you had not installed cmake>=3.12.2, you need install cmake>=3.12.2
macOS
$ brew install cmake
Linux
# if you installed old version by apt-get
$ apt-get purge cmake
# install cmake
$ wget https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz
$ tar xvf cmake-3.13.2.tar.gz
$ cd cmake-3.13.2
$ ./bootstrap && make && sudo make install
Alternatively, you can use
$ pip install -U cmake
Make sure the enviroment path for CMake is set correctly.
install OpenJij
$ pip install openjij --no-binary :all:
install from github repository
$ git clone git@github.com:OpenJij/OpenJij.git
$ cd openjij
$ python setup.py install
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}]
C++ example
$ source ./build_gcc.sh
$ cd ./project_template
$ make
$ ./tutorial
The result spins are [1 1 1 1 1 ]
Community
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
openjij-0.1.0.tar.gz
(225.1 kB
view hashes)
Built Distributions
Close
Hashes for openjij-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e874a5cf01690c2557e5e861da9845de6ffcec80625424a7517e852d1d9d79c9 |
|
MD5 | 80b5543e72d22bc9b7e7c0b3ddc63b91 |
|
BLAKE2b-256 | 1585f18ee062e2c39df78ef68b696ca316aa498cf4619361f8ff8f3e918e0524 |
Close
Hashes for openjij-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84cef03dfa2d386d9c7d6a3b18f2f742e300fdb1658160338b5a760601014a31 |
|
MD5 | 286feef126c128cdf9dbb533bbfcdd31 |
|
BLAKE2b-256 | 42099c2d52a7b49a2c3478752bbe5dc138ccebda4c50f887fcb9e410898ce7c1 |
Close
Hashes for openjij-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e981a548ff1bcb2465bf4ddeb232d17c9a76da4931485aa941966e8210f853b |
|
MD5 | bcf75b7cc84cc7b853667dfc633dcac0 |
|
BLAKE2b-256 | 5f1fdae7249afebe606d8e0f6603c60ac6015b3f5edda712110e801ba6999560 |
Close
Hashes for openjij-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cb351a01cd05fa46aa49e55b7dad7cdaa56d6764f90210efe3fd0e61d58f6a6 |
|
MD5 | 582d3b6eec4d84c902e9aab2d58f70d3 |
|
BLAKE2b-256 | 93a55e9210622484a16de57e3013f02ed385a4d6c56a1c6bc391b10e4cfdd4df |
Close
Hashes for openjij-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb49a2ce72dc6795e4b650a26ad4d3eb7f0d3ae8c8939f4f1a5b1d929bca31c |
|
MD5 | fe9c053d947c1acee63ba8633d22199e |
|
BLAKE2b-256 | d82b3d915b9ddbab534c9ecd946f8eac51f951f14c7aefd6ca6a51c54475a10c |
Close
Hashes for openjij-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70b5795aec27fd741a793740755d58440ac550bcbd76745d91b7ae8fa956fd72 |
|
MD5 | 9104b430608c0b1935ef92d07357de63 |
|
BLAKE2b-256 | e85f806bd01a7bfe3697d6cc15f76922c56e346f8ce8e719eaa3ca8572e1aaa4 |
Close
Hashes for openjij-0.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19911f6a909f5d534ef356df85f4ece8d3390dc96fbd84948b3d77e1ef71a4bd |
|
MD5 | 2969b53fcb9841af49569b466d8706a1 |
|
BLAKE2b-256 | 1f870c11fc8f3c0f54e610a6456501e1c51c87d47de18b54175ef42a97580072 |
Close
Hashes for openjij-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4d4e360b789ae06b3ae23c8d84ee57c0c71c038d04c99e03da33c070ed9e2b0 |
|
MD5 | 9eeb85364a8d3ac4412b2311d41ebc11 |
|
BLAKE2b-256 | aa814fbf597d73909c5c5c460e1e5ae32133d3e03d03ab7273d5dd0db9799816 |
Close
Hashes for openjij-0.1.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d96d07653a7d3e7589244522849605e359174e9b154080f3a480eb9ce04e3477 |
|
MD5 | c55dd4eb7eec75daaf325ce6253329a3 |
|
BLAKE2b-256 | 2eadad44ed05e264b88b8181961a3c829e27d73293ab8b75ea7ca78125386337 |
Close
Hashes for openjij-0.1.0-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05159389218751faa1578fbb20ccb07cd9138f75b13f215bd4f423839ca111a0 |
|
MD5 | 39db5ad74e11eda0ab00307e0b722406 |
|
BLAKE2b-256 | f360aeae370d322233d7ec2f7b8b881b5733adcdc92eae1de4f574328c0d0a08 |
Close
Hashes for openjij-0.1.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec4d81f045c9009cb0d0bf16f932616e4889c61127eb799915266e77e1cfc780 |
|
MD5 | 713d044297268c610e3eecccdea71d57 |
|
BLAKE2b-256 | a0ff55058b2ae4b8d84d3fa146fb9a2a53afe98b0944891e2f20bd94a72abc36 |