Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Framework for the Ising model and QUBO

Project description

OpenJij : Framework for the Ising model and QUBO.

Build Status

  • python >= 3.6
  • (optional) gcc >= 7.0.0
  • (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 
  • Windows

Please install cmake from here.

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

About us

This product is maintained by Jij Inc.

Please visit our website for more information! https://j-ij.com/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for openjij, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size openjij-0.1.1-cp35-cp35m-manylinux2014_x86_64.whl (495.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size openjij-0.1.1-cp36-cp36m-macosx_10_15_x86_64.whl (373.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size openjij-0.1.1-cp36-cp36m-manylinux2014_x86_64.whl (495.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size openjij-0.1.1-cp36-cp36m-win_amd64.whl (4.5 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size openjij-0.1.1-cp37-cp37m-macosx_10_15_x86_64.whl (373.9 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size openjij-0.1.1-cp37-cp37m-manylinux2014_x86_64.whl (495.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size openjij-0.1.1-cp37-cp37m-win_amd64.whl (4.5 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size openjij-0.1.1-cp38-cp38-macosx_10_15_x86_64.whl (384.6 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size openjij-0.1.1-cp38-cp38-manylinux2014_x86_64.whl (485.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size openjij-0.1.1-cp38-cp38-win_amd64.whl (4.4 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size openjij-0.1.1-cp39-cp39-macosx_10_15_x86_64.whl (384.6 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size openjij-0.1.1-cp39-cp39-manylinux2014_x86_64.whl (485.3 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size openjij-0.1.1-cp39-cp39-win_amd64.whl (4.4 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size openjij-0.1.1.tar.gz (233.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page