Skip to main content

Reusable QUBO core library for API and HPC execution

Project description

qubo-core

Reusable QUBO core library for solving Quadratic Unconstrained Binary Optimization problems, designed for API and HPC execution.

Installation

pip install stt-qubo-core

Usage

from stt_qubo_core import (
    QuboProblem, QuboDict,
    QuboService, DimodSimulatedAnnealingSolver
)

qubo = QuboDict(data={
    (0, 0): -1.0,
    (1, 1): -1.0,
    (0, 1):  2.0,
})

problem = QuboProblem(qubo=qubo, num_reads=100)
service = QuboService(solver=DimodSimulatedAnnealingSolver())
result = service.solve(problem)

for sol in result.solutions:
    print(sol.energy, sol.sample)

Custom solver

Implement the QuboSolverPort protocol and inject it into QuboService:

from stt_qubo_core import QuboProblem, QuboSolverPort, QuboSolveResult, QuboService

class MyRemoteSolver:
    def solve(self, problem: QuboProblem) -> QuboSolveResult:
        ...

service = QuboService(solver=MyRemoteSolver())

Development

pip install -e ".[dev]"
pytest tests/

Publishing to PyPI

Publishing is automated via GitHub Actions (.github/workflows/publish.yml). The workflow triggers when a GitHub Release is published.

Prerequisites

In GitHub → Settings → Environments, create an environment named pypi and add a secret PYPI_API_TOKEN with your PyPI API token.

Steps

1. Bump the version in pyproject.toml:

[project]
version = "0.2.0"

2. Commit and push to the main branch.

3. Create a GitHub Release:

  • Go to GitHub → Releases → Draft a new release
  • Create a tag matching the version (e.g. v0.2.0)
  • Click Publish release

The workflow will build the package and publish it to PyPI automatically.

Verify

pip install stt-qubo-core==<version>

License

MIT

Project details


Download files

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

Source Distribution

stt_qubo_core-0.1.6.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stt_qubo_core-0.1.6-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file stt_qubo_core-0.1.6.tar.gz.

File metadata

  • Download URL: stt_qubo_core-0.1.6.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stt_qubo_core-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7b3216e88886de4b7106e4f32739f3c69a5c2be8a3c3ae6169da246854d2ec86
MD5 8a6fa5508064d090ece7c4be64e553aa
BLAKE2b-256 5cec8db492508bd16f2e640540f67fe0fe5c7131d39037b0c58b582e64aec55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for stt_qubo_core-0.1.6.tar.gz:

Publisher: publish.yml on pasqualcastellon/qubo-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stt_qubo_core-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: stt_qubo_core-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stt_qubo_core-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cccd0d39314c1b8f51e764d82bf6f4037c078d13829e673003486b0bb6676486
MD5 28ebd2bd9a4cbf3cdb4c942993df2459
BLAKE2b-256 3b0bc46c4238ffe822e15026d19a33186d2590bce19e37f0fcf142e389c5d7f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for stt_qubo_core-0.1.6-py3-none-any.whl:

Publisher: publish.yml on pasqualcastellon/qubo-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page