Skip to main content

Our hybrid solver for QUBO problems merges classical and quantum computing, efficiently solving complex optimization tasks. It offers fast, accurate results for applications in logistics, finance, and more.

Project description

QDeep Hybrid Solver - Quadratic Unconstrained Binary Optimization Solver

QDeep Hybrid Solver is a Python library specifically developed for efficiently solving Quadratic Unconstrained Binary Optimization (QUBO) problems through advanced hybrid quantum-classical computing methods. It provides a user-friendly interface to submit QUBO matrices and retrieve structured, optimized solutions.

Mathematical Formulation

A QUBO problem is mathematically expressed as:

\min_{x \in \{0,1\}^n} \; x^T Q x

where:

  • (x) is a binary vector.
  • (Q) is a symmetric matrix representing the problem's coefficients.

Features

  • Type-hinted implementation using Python's TypedDict
  • Comprehensive input validation for matrices
  • Secure authentication token management
  • Structured and detailed response handling

Installation

Install the required dependencies along with the solver:

pip install numpy requests qdeepsdk

Dependencies

  • numpy
  • requests
  • qdeepsdk

Quantum Optimization Parameters

m_budget

  • Type: Integer
  • Default Value: 1000
  • Description: Represents the measurement budget, which determines the maximum number of quantum measurement samples executed during the optimization process. This parameter is critical for managing quantum resource allocation while balancing solution quality and computational efficiency.

num_reads

  • Type: Integer
  • Default Value: 10000
  • Description: Specifies the number of iterations (reads) performed by the solver. This parameter plays an integral role in the convergence of the algorithm by defining the number of independent solution attempts during the optimization process.

Usage

import numpy as np
from qdeepsdk import QDeepHybridSolver

# Initialize the solver
solver = QDeepHybridSolver()

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

# Configure parameters (if different from defaults)
solver.m_budget = 50000      # Measurement budget
solver.num_reads = 10000    # Number of reads

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

# Solve the QUBO problem
try:
    response = solver.solve(matrix)
    results = response['QdeepHybridSolver']
    print("Hybrid Solver Results:", results)
except ValueError as e:
    print(f"Error: {e}")
except requests.RequestException as e:
    print(f"API Error: {e}")

Sample Matrix and Response

Sample Matrix

[[1, 0], [0, -1]]

Sample Response

{
        "QdeepHybridSolver": {
            "configuration": [0.0, 1.0],
            "energy": -1.0,
            "time": 3.6245157718658447
        }

}

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-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

qdeepsdk-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qdeepsdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c5aecd7580404eec25a90fefc140b551e47363002fc1d118d1416b8601ed99ce
MD5 daf2d08692975f383b83e46d94aaea9b
BLAKE2b-256 a94357fd89d0841180191f794347516b87bfe8f57669a81905b517cc2a81d897

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for qdeepsdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab80f49c6fe1fe82744d54a7be779db7b2215889bb295e9da156e3be847f5d12
MD5 7453f2d171571f8af54b5da48a5be4b6
BLAKE2b-256 edeb74735b4083580e301550091d2216a6b9f12b5297fb58b3f4de2c4f14766f

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