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

{
    "solutions": {
        "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

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['solutions']['QdeepHybridSolver'] print("Hybrid Solver Results:", results) except ValueError as e: print(f"Error: {e}") except requests.RequestException as e: print(f"API Error: {e}")

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['solutions']['QdeepHybridSolver'] print("Hybrid Solver Results:", results) except ValueError as e: print(f"Error: {e}") except requests.RequestException as e: print(f"API Error: {e}")

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.0.tar.gz (3.7 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.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qdeepsdk-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 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.0.tar.gz
Algorithm Hash digest
SHA256 f6f96abc95e6902977c1bd7f05001c45cdb6bb7335d8c3dbd11ae5a3e1fe07a0
MD5 ec5397e869859dde8fb8e7b5450c79e3
BLAKE2b-256 db1f1bfcd6225e787b34fdb47ea0dc752f7d78ea96fa0169d14cdf10afaedbd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qdeepsdk-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9ce90f3e80ad2ce60bf44188b3ffc43e3676eff811b99751b74cb9f61709079
MD5 4f38cfd8d40921eeb39d727fc976ce3f
BLAKE2b-256 cccf039bb333fe35edfe0ba4bdc4c32fe8d3376efbbadf1a9bb946d469443cb3

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