Skip to main content

An SDK for CIM or QUBO.

Project description

Kaiwu Community

Python Version License

Language: 中文 | English


Kaiwu Community is a Python development toolkit designed specifically for QUBO (Quadratic Unconstrained Binary Optimization) problems, providing rapid modeling, flexible extension, and efficient solving capabilities.

Installation

pip install kaiwu_community

Requirements:

  • Python 3.10.x
  • Make (for development builds)
  • Virtualenv (optional, for environment isolation)

For more installation information, please refer to the Installation Documentation.


Quick Start

Learning Resources

Getting Help

Example: Traveling Salesman Problem (TSP)

This example demonstrates how to solve the Traveling Salesman Problem using Kaiwu SDK Community, including the following steps:

  • Build a TSP problem model using a distance matrix
  • Define QUBO objective function and constraints
  • Solve the model using built-in solvers
  • Validate the solution results

For the complete TSP example code, please see example/tsp_sdk_1_2_doc_example.py.

For more detailed explanations, please refer to the TSP Documentation.


Application Scenarios

Kaiwu SDK is suitable for:

  • Combinatorial Optimization: Traveling Salesman Problem (TSP), Knapsack Problem, Graph Coloring, Max-Cut
  • Machine Learning: Feature Selection, Cluster Analysis, Model Compression
  • Quantum Computing Research: QUBO Model Research, Solver Development, Quantum Algorithm Verification

Contributing

Community contributions are welcome! 🎉

You can extend SDK functionality, such as new solver implementations, classical optimization algorithms, example programs, and documentation.

Contribution Example

Quickly extend functionality by inheriting base classes:

from kaiwu.core import OptimizerBase, SolverBase
import kaiwu

# Custom optimizer
class CustomOptimizer(OptimizerBase):
    def solve(self, ising_matrix=None):
        # Implement custom optimization logic
        pass

# Custom solver
class CustomSolver(SolverBase):
    def solve_qubo(self, model):
        # Implement custom solver logic
        self._optimizer.solve()
        pass

# Modeling
qubo_model = kaiwu.qubo.QuboModel()
# Calling the custom component
optimizer = CustomOptimizer()
solver = CustomSolver(optimizer)
result = solver.solve_qubo(qubo_model)

➡️ For detailed contribution guidelines, please refer to the Contributing Guide.


License

This project is open-sourced under the Apache License 2.0. For details, please see the LICENSE file.

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

kaiwu_community-1.0.4.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

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

kaiwu_community-1.0.4-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file kaiwu_community-1.0.4.tar.gz.

File metadata

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

File hashes

Hashes for kaiwu_community-1.0.4.tar.gz
Algorithm Hash digest
SHA256 213dd3f81a8170fdc58860c9ea2d6100d32e9269903cece0db2622f62d9fbc6d
MD5 4f572ffc1eb6a8aeab78ad1d29f9406a
BLAKE2b-256 0ae9f1167304cef0e5202d49b07c19ef459a5db5963c76172f9c99d0995e1df7

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiwu_community-1.0.4.tar.gz:

Publisher: release.yml on qboson/kaiwu_community

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

File details

Details for the file kaiwu_community-1.0.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for kaiwu_community-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fe4cad74079951cc2243902475a673dc6a21b5a247c15e573fc8894e692c2863
MD5 8da245826e57f1633761c59adc45bf51
BLAKE2b-256 b3342e6c51f5b2ae290cf7701d9d57e0b5a49561c97e210d4cc16b7f8a829227

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiwu_community-1.0.4-py3-none-any.whl:

Publisher: release.yml on qboson/kaiwu_community

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