Kaiwu SDK Enterprise
Kaiwu SDK Enterprise is a Python SDK for building and solving QUBO and Ising optimization problems with Kaiwu classical optimizers and CIM services.
This package is the enterprise distribution. A valid license is required before using licensed features.
Requirements
- Python >= 3.10
- Windows, Linux, or macOS
Installation
- Python 3.10 / 3.12 / 3.14 https://www.python.org/downloads/ .
- pip3 install -i https://mirrors.aliyun.com/pypi/simple -r requirements/devel.txt
pip install kaiwu
Install a specific version:
pip install kaiwu==1.4.4
Quick Start
Solve an Ising Matrix
import numpy as np
import kaiwu as kw
matrix = -np.array(
[
[0.0, 1.0, 0.0, 1.0, 1.0],
[1.0, 0.0, 0.0, 1.0, 1.0],
[0.0, 0.0, 0.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 0.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 0.0],
]
)
optimizer = kw.classical.SimulatedAnnealingOptimizer(
initial_temperature=100,
alpha=0.99,
cutoff_temperature=0.001,
iterations_per_t=10,
size_limit=10,
)
solutions = optimizer.solve(matrix)
print(solutions)
Solve a QUBO Matrix
solve_qubo() accepts a QuboModel. If you already have a QUBO matrix, convert it first:
import numpy as np
import kaiwu as kw
qubo_matrix = -np.array(
[
[0.0, -1.0, 0.0, 1.0, 1.0],
[-1.0, 0.0, 0.0, 1.0, 1.0],
[0.0, 0.0, 0.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 0.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 0.0],
]
)
# QUBO matrix conversion uses the upper-triangular convention.
qubo_model = kw.core.qubo_matrix_to_qubo_model(np.triu(qubo_matrix))
optimizer = kw.classical.SimulatedAnnealingOptimizer(
initial_temperature=100,
alpha=0.99,
cutoff_temperature=0.001,
iterations_per_t=10,
size_limit=10,
)
solution, objective = optimizer.solve_qubo(qubo_model)
print(solution)
print(objective)
Use CIMOptimizer
CIMOptimizer submits or queries CIM tasks. Set a checkpoint directory before creating the optimizer.
import numpy as np
import kaiwu as kw
kw.common.CheckpointManager.save_dir = "tmp"
qubo_matrix = np.array(
[
[0.0, 1.0, 0.0],
[0.0, 0.0, -2.0],
[0.0, 0.0, 0.0],
]
)
qubo_model = kw.core.qubo_matrix_to_qubo_model(np.triu(qubo_matrix))
optimizer = kw.cim.CIMOptimizer(
task_name="qubo_cim_example",
wait=False,
task_mode=kw.cim.TaskMode.OPTIMIZATION,
)
solution, objective = optimizer.solve_qubo(qubo_model)
print(solution, objective)
When wait=False, unfinished tasks may return (None, None). Use wait=True if the program should wait for the task result.
Main Modules
kaiwu.classical: classical optimizers, including simulated annealing, tabu search, and brute force searchkaiwu.cim: CIM task optimizer and task modeskaiwu.preprocess: matrix precision analysis and precision reduction toolskaiwu.hybrid: hybrid optimization toolskaiwu.sampler: sampler implementationskaiwu.hobo: higher-order binary optimization tools
Logging
Enable debug logs when needed:
import kaiwu as kw
kw.common.set_log_level("DEBUG")
Metadata
Release files for kaiwu 1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 21.7 MB
Release files / kaiwu-1.4.4-cp314-none-win_amd64.whl
| Download URL | kaiwu-1.4.4-cp314-none-win_amd64.whl |
|---|---|
| Size | 677.5 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
846f140897aa87383d943060751201cc38cb266154aacbcec009eb086c1c5698
|
|
BLAKE2b-256 checksum How to use checksums |
2a241a4e8ef98d8baf2608e8817e20b80ab9111adbca758cfa48b2e413103cee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp314-none-manylinux1_x86_64.whl
| Download URL | kaiwu-1.4.4-cp314-none-manylinux1_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.14 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
136dadf0b6231665ff4fbd6491923a09698317d5d3521ffa49db987b8687570a
|
|
BLAKE2b-256 checksum How to use checksums |
169b752f2a9daa13362f9e97afd5ec9212333ec9f9d7f1e226f77bb4425fe15c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp314-none-macosx_11_0_arm64.whl
| Download URL | kaiwu-1.4.4-cp314-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 707.3 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fcdf4fad18bedd1a73f94f022298c1f41ba2b9c57043bd619cc8b93b675af0b2
|
|
BLAKE2b-256 checksum How to use checksums |
92cdb813ae2bf3ab1930af731aaab4dc1e1987a99a8df07e7392a1cc6eee7dc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp314-none-macosx_10_9_x86_64.whl
| Download URL | kaiwu-1.4.4-cp314-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 728.0 kB |
| Tags | CPython 3.14 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
85664e41c4f13c0372e3ed678cca0d45c2894305b8a9d91ae0ead0fb7b5271d1
|
|
BLAKE2b-256 checksum How to use checksums |
7246d8f66dfb7f120c1d77661ded7155b1e002abfa115138a2699d76f20b7a1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp312-none-win_amd64.whl
| Download URL | kaiwu-1.4.4-cp312-none-win_amd64.whl |
|---|---|
| Size | 685.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d0613655680d3b14db723623dde21333d6adca9df85ca7dee0d558cc602bd9cc
|
|
BLAKE2b-256 checksum How to use checksums |
798163988e4dc719afc005247a57a7617e1c07a887c12009f53925e7a45f8cdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp312-none-manylinux1_x86_64.whl
| Download URL | kaiwu-1.4.4-cp312-none-manylinux1_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.12 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
8ba005e727054a462f440bae11ff4a89ead5d09660e055d6c20c607e52d1c4b7
|
|
BLAKE2b-256 checksum How to use checksums |
a0f558e13485a5db5a07f7a7449ec7b7d3f1c25ffa5b0d3afb751bac689af889
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp312-none-macosx_11_0_arm64.whl
| Download URL | kaiwu-1.4.4-cp312-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 712.3 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c7280391a2396dcf4eda92b753f0bcef878f7460960829e797b52e5c01bb925a
|
|
BLAKE2b-256 checksum How to use checksums |
e7478d127ad7a1b77871797bdcf242b444c68ddaf6d4106b27af4fb3860fa752
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp312-none-macosx_10_9_x86_64.whl
| Download URL | kaiwu-1.4.4-cp312-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 735.3 kB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
01a0d054696100e539c9a0eeaa5ac5ac87469ea2d65b6d79d32fb771ad3ff2af
|
|
BLAKE2b-256 checksum How to use checksums |
c1004d2453b8ea52f6d81924c5163aada89b75016b585f5c4246ac9181a48d8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp310-none-win_amd64.whl
| Download URL | kaiwu-1.4.4-cp310-none-win_amd64.whl |
|---|---|
| Size | 685.1 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
21d7ffbd4438daf28af7c5e5ee6dcd101ae937096983e58749a6fd31577eb005
|
|
BLAKE2b-256 checksum How to use checksums |
f64623936ead49a645692f899152d9f1d5780ad4068b95c582d517a6e9f97c75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp310-none-manylinux1_x86_64.whl
| Download URL | kaiwu-1.4.4-cp310-none-manylinux1_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
b2adf46643fe9eba4ff6636a9df992a7981168a74b7eff05b09f36ef4013a0a3
|
|
BLAKE2b-256 checksum How to use checksums |
4440df32afe3e8b2aaa07c5131c0dd1f388f4b2f3a52f738eed52cf54a0d494f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp310-none-macosx_11_0_arm64.whl
| Download URL | kaiwu-1.4.4-cp310-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 719.2 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7787abee09779957e5662344277f836361f8b5faa57e328f8b9ba33e9d26be46
|
|
BLAKE2b-256 checksum How to use checksums |
71d960ac7bec8c82fa10dd7b7fc59ad954fb30b5e1c5edc1ae33995593b5b3c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Release files / kaiwu-1.4.4-cp310-none-macosx_10_9_x86_64.whl
| Download URL | kaiwu-1.4.4-cp310-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 734.4 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
833904757f8256247821679d00c20e9ca8ebf1f934603c6d1508c637f6d7296a
|
|
BLAKE2b-256 checksum How to use checksums |
63003aceb075525ae320a263dc6d00c0af18d65bbb228ebe9f8c9713d3f066dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.15
|
Security for kaiwu 1.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.