Skip to main content

The titanQ SDK for python

Project description

The titanQ SDK for Python

Python License

titanQ is the infinityQ Software Development Kit (SDK) for Python. The SDK facilitates and opens the way for faster implementation of the titanQ solver without having to deal directly with the API.

This titanq package is maintained and published by InfinityQ

API Key

In order to use the titanQ service, a user needs an API key. The API key can be obtained by contacting InfinityQ support

Installation

The following steps assume that you have:

  • A valid and active API Key
  • A supported Python version installed

Setting up an environment

python -m venv .venv
.venv/bin/activate

Install titanQ

pip install titanq

Using titanQ

The titanQ solver is designed to support very large problems and therefore very large files. To simplify the user experience, titanQ will instead use cloud storage set up and managed by the end users.

Currently, the SDK only supports two types of storage

Storage options Vector variables limit
S3 Buckets ✅ Up to 100k vector variables
Managed storage ⚠️ Up to 10k vector variables

Both options are documented with examples at the titanQ's Quickstart documentation

Problem construction

NOTE: The weights matrix must be symmetrical.

The QUBO problem is defined as finding the minimal energy configuration (the state $\mathbf{x}$ which results in the minimal $E(\mathbf{x})$). Each state $\mathbf{x}$ is a vector of $n$ binary elements $x_i$ which can take the values of 0 or 1 (binary values). This model formulation is given in the equation below

$ \begin{align} argmin_{\mathbf{x}} ,,,, E(\mathbf{x}) = \sum_{i=1}^n\sum_{i \leq j}^n Q_{i,j} x_i x_j ,,,,,,,, \mathbf{x}=(x_i)\in {0,1}^{n} \notag \end{align} $

The bias terms of a QUBO model are stored along the diagonal of the $\mathbf{Q}$ matrix. However, to simplify converting between Ising and QUBO models, we assume that the diagonals of the $\mathbf{Q}$ matrix are 0, and take in an additional bias vector instead. To avoid confusion, the modified $\mathbf{Q}$ matrix with 0s along its diagonal is referred to as the weights matrix, denoted by

$ \begin{align} \mathbf{W}=(W_{i,j})\in \mathbb{R}^{n \times n}, ~ where ~ \mathbf{Q} = \mathbf{W} + \mathbf{b}^{\intercal}\boldsymbol{I}, ~ and ~ \mathbf{b} = (b_i) \in \mathbb{R}^{n} \notag \end{align} $

denotes the biases, which are used in the final model formulation described below

$ \begin{align} argmin_{\mathbf{x}} , , , , E(\mathbf{x}) & = \sum_{i=1}^n \sum_{i < j}^n W_{i,j}x_i x_j + \sum_i^n b_i x_i \notag \ & = \frac{1}{2}\sum_{i=1}^n\sum_{j=1}^n W_{i,j}x_{i}x_{j} + \sum_{i=1}^{n} b_{i}x_{i} \notag \ & = \frac{1}{2}(\mathbf{x}^{\intercal}\mathbf{W}\mathbf{x}) + \mathbf{b}^{\intercal}\mathbf{x} \notag \end{align} $

Getting support or help

Further help can be obtained by contacting InfinityQ support

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

titanq-0.2.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

titanq-0.2.4-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file titanq-0.2.4.tar.gz.

File metadata

  • Download URL: titanq-0.2.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for titanq-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8705006119d1cc0a3721c7632ad1c49e9bde877a67e1ab47533ab424ef26ea9d
MD5 0fc4d43350492003c592c7b260d9d191
BLAKE2b-256 81e107f5b191df8a65eb339c378b3d28acbcb5c432ddd0e34bc73da7497e0b81

See more details on using hashes here.

File details

Details for the file titanq-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: titanq-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for titanq-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0f99adbbdeaa45ad69b0c13ca923d5036b57d9f1ef56d35cd9788adb95b9c75b
MD5 182f60c4ac67247897c5f8087071b723
BLAKE2b-256 ce69c58b44c638edd6d37555edcba19fadaf300c39101d36d3e3097a38655bbc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page