Skip to main content

QDeep QUBO Solver

Project description

# QUBOSolver - Quadratic Unconstrained Binary Optimization Solver

QUBOSolver is a Python library for solving Quadratic Unconstrained Binary Optimization (QUBO) problems using multiple algorithms via an external API service. It provides a clean interface to submit QUBO matrices and retrieve structured results from different solving algorithms.

## Features

- Supports multiple solving algorithms:
  - Simulated Bifurcation
  - Tensor Train
  - Simulated Annealing
- Type-hinted implementation using Python's TypedDict
- Input validation for matrices
- Authentication token management
- Structured response handling

## Installation

```bash
pip install numpy requests

Note: This library requires numpy and requests as dependencies.

Usage

import numpy as np
from qdeepsdk import QUBOSolver

# Initialize solver
solver = QUBOSolver()

# Set authentication token
solver.token = "your-auth-token-here"

# Create a QUBO matrix
matrix = np.array([
    [-1,  2,  2],
    [ 0, -1,  2],
    [ 0,  0, -1]
])

# Solve the QUBO problem
try:
    results = solver.solve(matrix)
  
    # Access results
    print("Simulated Bifurcation:", results["SimulatedBifurcation"])
    print("Tensor Train:", results["TensorTrain"])
    print("Simulated Annealing:", results["SimulatedAnnealer"])
  
except ValueError as e:
    print(f"Error: {e}")
except requests.RequestException as e:
    print(f"API Error: {e}")

API Response Structure

The solver returns a SolveResult dictionary with the following structure:

{
    "SimulatedBifurcation": {
        "configuration": List[int],  # Solution vector
        "energy": float,            # Energy of the solution
        "time": float              # Computation time in seconds
    },
    "TensorTrain": {
        "configuration": List[int],
        "energy": float,
        "time": float
    },
    "SimulatedAnnealer": {
        "configuration": List[int],
        "energy": float,
        "time": float
    }
}

Requirements

  • Python 3.7+
  • NumPy
  • Requests
The library includes comprehensive error handling for:

- Invalid or missing authentication tokens
- Non-square matrices
- Non-2D matrices
- Non-numpy array inputs
- API connection issues

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

qdeepsdk-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

qdeepsdk-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file qdeepsdk-0.1.0.tar.gz.

File metadata

  • Download URL: qdeepsdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0rc1

File hashes

Hashes for qdeepsdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7f36a95fc0ae37a689c18e0c13ed3a1a3f8b96da279b38bca1b1b2e96dec4f3
MD5 2e06b8f61ff47e1df9b846ef73e109c2
BLAKE2b-256 011987ca5e8f8ed314f699a87fc209162ddf05959a8f6cffb78b11781579f8ed

See more details on using hashes here.

File details

Details for the file qdeepsdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qdeepsdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0rc1

File hashes

Hashes for qdeepsdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d503b69809741017ba7c1d7f5d3a1f7ab8f831bf53b6ad2dab58d8c6bdbcb244
MD5 29c444f7dc791744842232f21c607018
BLAKE2b-256 713267852b671362f62050b092c99d6b7478245f08783fb0253643fa61a1717d

See more details on using hashes here.

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