openjij

OpenJij : Framework for the Ising model and QUBO.

https://github.com/jij-inc/openjij

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

benchmarking cmake optimization python quantum-annealing quantum-computing quantum-mechanics simulated-annealing

Keywords from Contributors

meshing standardization pipeline-testing datacleaner pde pinn interpretability data-profilers interactive mlops
Last synced: 4 months ago · JSON representation ·

Repository

OpenJij : Framework for the Ising model and QUBO.

Basic Info
  • Host: GitHub
  • Owner: Jij-Inc
  • License: apache-2.0
  • Language: C++
  • Default Branch: main
  • Homepage: https://www.openjij.org/
  • Size: 49.1 MB
Statistics
  • Stars: 115
  • Watchers: 13
  • Forks: 32
  • Open Issues: 20
  • Releases: 0
Topics
benchmarking cmake optimization python quantum-annealing quantum-computing quantum-mechanics simulated-annealing
Created almost 7 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

OpenJij : Framework for the Ising model and QUBO.

PyPI version shields.io PyPI pyversions PyPI implementation PyPI format PyPI license PyPI download month Downloads

CPP Test Python Test

DOI

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

For development installation, you will need to install CMake>=3.22.\ We highly recommend installing 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 .

Development Install (Recommended for Contributors)

OpenJij uses uv for efficient dependency management and reproducible development environments.

```sh

Clone repository

$ git clone git@github.com:OpenJij/OpenJij.git $ cd OpenJij

Install uv (choose one method)

$ pip install uv # Recommended

or: curl -LsSf https://astral.sh/uv/install.sh | sh # macOS/Linux

or: brew install uv # Homebrew

Set up development environment with exact dependency versions

$ uv sync --locked --group dev

Verify installation (includes C++ extension build)

$ uv run python -c "import openjij; import openjij.cxxjij; print('OpenJij setup complete')" $ uv run pytest tests/ -v --tb=short ```

Dependency Groups

OpenJij uses PEP 735 dependency groups for efficient quantum computing development:

| Group | Purpose | Command | Use Case | |-------|---------|---------|----------| | dev | Full development environment | uv sync --group dev | Complete setup with all tools | | test | Testing and coverage tools | uv sync --group test | CI/CD and automated testing | | format | Code quality and formatting | uv sync --group format | Linting and style checks | | build | Build and packaging tools | uv sync --group build | Package creation and distribution |

Dependency management: - Reproducible builds (CI/CD, team collaboration): uv sync --locked --group dev - Latest versions (local development): uv sync --group dev - Update dependencies: uv lock or uv lock --upgrade

All dependencies are locked in uv.lock for consistent environments across different systems.

C++ Extension Integration

OpenJij's C++ extensions are built automatically during installation for optimal quantum computing performance:

```sh

Development with C++ code modifications

$ uv sync --group dev # Initial setup

... modify C++ source files ...

$ uv run pip install . # Rebuild C++ extension $ uv run python -c "import openjij.cxxjij; print('C++ extension updated')" ```

Test

Python Tests

```sh

Install test dependencies with exact versions

$ uv sync --locked --group test

Run comprehensive test suite

$ uv run pytest tests/ -v --tb=short $ uv run pytest tests/ -v --cov=openjij --cov-report=html $ uv run python -m coverage html ```

C++ Tests

```sh

Build and run C++ tests (independent of Python environment)

$ mkdir build $ cmake -DCMAKEBUILDTYPE=Debug -S . -B build $ cmake --build build --parallel $ cd build $ ./tests/cxxjij_test

Alternative: Use CTest for comprehensive testing

$ ctest --extra-verbose --parallel --schedule-random ```

Requirements: CMake ≥ 3.22, C++17 compatible compiler

Code Quality

```sh

Install formatting tools with exact versions

$ uv sync --locked --group format

Unified ruff-based quality checks

$ uv run ruff check . # Lint check $ uv run ruff format . # Format code $ uv run ruff check . --fix # Auto-fix issues

All-in-one quality verification

$ uv run ruff check . && uv run ruff format --check . ```

For Contributors

Contributors are welcome! Please follow these guidelines:

  1. Set up development environment: Use uv sync --locked --group dev for consistent setup
  2. Follow code standards: Run quality checks before submitting
  3. Test thoroughly: Ensure both Python and C++ tests pass
  4. Document changes: Update relevant documentation

How to use

Python example

```python 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.

Owner

  • Name: Jij
  • Login: Jij-Inc
  • Kind: organization
  • Email: info@j-ij.com
  • Location: Japan

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: "Nishimura"
    given-names: "Kohji"
    affiliation: "Jij Inc."
  - family-names: "Sakamoto"
    given-names: "Yoshiki"
    affiliation: "Jij Inc."
  - family-names: "Shimizu"
    given-names: "Taro"
    affiliation: "Jij Inc."
  - family-names: "Suzuki"
    given-names: "Kohei"
    affiliation: "Jij Inc."
    orcid: "https://orcid.org/0009-0005-1025-8608"
  - family-names: "Yamashiro"
    given-names: "Yu"
    affiliation: "Jij Inc."
title: "OpenJij"

GitHub Events

Total
  • Create event: 32
  • Release event: 7
  • Issues event: 1
  • Watch event: 3
  • Delete event: 26
  • Issue comment event: 7
  • Push event: 68
  • Pull request review comment event: 17
  • Pull request review event: 30
  • Pull request event: 53
  • Fork event: 2
Last Year
  • Create event: 32
  • Release event: 7
  • Issues event: 1
  • Watch event: 3
  • Delete event: 26
  • Issue comment event: 7
  • Push event: 68
  • Pull request review comment event: 17
  • Pull request review event: 30
  • Pull request event: 53
  • Fork event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 2,047
  • Total Committers: 26
  • Avg Commits per committer: 78.731
  • Development Distribution Score (DDS): 0.541
Past Year
  • Commits: 98
  • Committers: 9
  • Avg Commits per committer: 10.889
  • Development Distribution Score (DDS): 0.582
Top Committers
Name Email Commits
Yoshiki Sakamoto y****o@j****m 939
j-i-k-o j****y@g****m 463
yu yamashiro y****9@g****m 213
KSuzuki k****i@j****m 162
dependabot[bot] 4****] 91
mei.maruo m****6@g****m 47
Masahito Kumagai 5****o 28
Jacomichi h****a@j****m 24
shitaro a****o@g****m 18
Ubuntu n****o@N****t 17
mrcdr m****r 10
durga0201 d****i@g****m 7
Devin AI 1****] 4
中村翔 s****a@n****l 4
github-actions[bot] 4****] 3
takuro saito t****o@j****m 3
Kohei Suzuki k****i@K****l 3
github-nakasho n****o@g****m 2
maruzhang 1****g 2
NY57 n****7@g****m 1
Yoshimura Yuu y****u@m****r 1
taqro 6****o 1
shibukazu s****u@h****p 1
maruzhang m****g@g****m 1
Yu Yamashiro m****9@g****m 1
yuichi-miyashita y****a@j****m 1

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 25 days
  • Total issue authors: 0
  • Total pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 25 days
  • Issue authors: 0
  • Pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • yuichi-miyashita (1)
Pull Request Authors
  • dependabot[bot] (8)
  • yuyamashiro (8)
  • 29rou (6)
  • K-Suzuki-Jij (5)
  • taqro (2)
  • j-i-k-o (2)
  • yuichi-miyashita (1)
  • devin-ai-integration[bot] (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels
dependencies (8) github_actions (8)

Dependencies

.github/workflows/buid-doc.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/build_and_upload.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
  • microsoft/setup-msbuild v1.1.3 composite
  • pypa/cibuildwheel v2.12.0 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/dependabot-auto-merge.yml actions
  • dependabot/fetch-metadata v1.3.6 composite
.github/workflows/dependency-review.yml actions
  • actions/checkout v3 composite
  • actions/dependency-review-action v3 composite
.github/workflows/deploy-openjij-www.yml actions
  • actions/checkout v3 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/format.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pages.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/configure-pages v3 composite
  • actions/deploy-pages v1 composite
  • actions/download-artifact v3 composite
  • actions/setup-node v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • actions/upload-pages-artifact v1 composite
build-requirements.in pypi
  • auditwheel *
  • build *
  • cmake *
  • ninja *
  • pip *
  • pybind11 *
  • scikit-build *
  • setuptools *
  • setuptools_scm *
  • wheel *
dev-requirements.in pypi
  • cmake * development
  • coverage * development
  • ninja * development
  • pre-commit * development
  • pybind11 * development
  • pytest * development
  • pytest-cov * development
  • pytest-mock * development
  • pytest-randomly * development
  • pytest-runner * development
  • pytest-spec * development
  • scikit-build * development
  • setuptools * development
  • setuptools_scm * development
doc-requirements.in pypi
  • dwave-cloud-client *
  • dwave-greedy *
  • dwave-hybrid *
  • dwave-inspector *
  • dwave-neal *
  • dwave-networkx *
  • dwave-preprocessing *
  • dwave-system *
  • dwave-tabu *
  • dwavebinarycsp *
  • jijmodeling-transpiler *
  • jsonschema *
  • jupyter-book *
  • jupyter-cache *
  • jupyter_server *
  • matplotlib *
  • minorminer *
  • myst-parser *
  • networkx *
  • penaltymodel *
  • pyqubo *
  • python-levenshtein *
  • scikit-learn *
  • sphinx-autoapi *
  • sphinx-autobuild *
  • sphinx-comments *
  • sphinx-examples *
  • sphinx-hoverxref *
  • sphinx-inline-tabs *
  • sphinx-jupyterbook-latex *
  • sphinx-notfound-page *
  • sphinx-proof *
  • sphinx_sitemap *
  • sphinxcontrib-katex *
.github/workflows/ci-test-cpp.yml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
  • hendrikmuhs/ccache-action v1.2 composite
  • microsoft/setup-msbuild v1.3.1 composite
.github/workflows/ci-test-python.yaml actions
  • actions/cache v3 composite
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
  • codacy/codacy-coverage-reporter-action v1 composite
  • codecov/codecov-action v3 composite
  • hendrikmuhs/ccache-action v1.2 composite
  • microsoft/setup-msbuild v1.3.1 composite
  • paambaati/codeclimate-action v5.0.0 composite
.github/workflows/python-build-test.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
format-requirements.in pypi
  • autoflake *
  • autopep8 *
  • black *
  • isort *
  • mdformat *
  • mdformat-footnote *
  • mdformat-frontmatter *
  • mdformat-gfm *
  • mdformat-myst *
lint-requirements.in pypi
  • flake8 *
  • flake8-absolute-import *
  • flake8-annotations *
  • flake8-annotations-complexity *
  • flake8-annotations-coverage *
  • flake8-bugbear *
  • flake8-builtins *
  • flake8-class-attributes-order *
  • flake8-cognitive-complexity *
  • flake8-comprehensions *
  • flake8-docstrings *
  • flake8-expression-complexity *
  • flake8-functions *
  • flake8-functions-names *
  • flake8-future-annotations *
  • flake8-length *
  • flake8-no-types *
  • flake8-noqa *
  • flake8-pep585 *
  • flake8-pytest-style *
  • flake8-return *
  • flake8-rst-docstrings *
  • flake8-scream *
  • flake8-secure-coding-standard *
  • flake8-strict *
  • flake8-test-name *
  • flake8-type-checking *
  • flake8-typing-imports *
  • flake8-variables-names *
  • flake8-warnings *
  • lizard *
  • mypy *
  • pep8-naming *
  • pyright *
pyproject.toml pypi
setup.py pypi