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/

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.7.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.7-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stt_qubo_core-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 46d2ac1a10ceca9a735bdeaabbc1af4d0a4965325f0ddfc891430148669dab87
MD5 d38c20feca0027a394e6c02dd86f8b77
BLAKE2b-256 aa4f4f46a2f498fcaea210d39c8b592a96c2df0e9e0a487ca1f2541937669d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for stt_qubo_core-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: stt_qubo_core-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f26369b6cdfc6ff47607f3356268f8406e7d64cb3faff1dbc7db2b25d21e3197
MD5 49710085f7de891699ca734931f884ec
BLAKE2b-256 7c142f040dbe2b13a5684f8b097f76e279a494379a0df3cd7c57ae78a5d45fb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for stt_qubo_core-0.1.7-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