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 TitanQ 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

\ 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} \

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

\ \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}

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

\ \begin{align} \notag \ 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}

Additional parameters are available to tune the problem:

  • beta
  • coupling_mult
  • num_chains
  • num_engines

For more informations how to use theses parameters, please refer to the API documentation

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

Uploaded Source

Built Distribution

titanq-0.14.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for titanq-0.14.0.tar.gz
Algorithm Hash digest
SHA256 29e511a406b4962654e730f203927a5ba706bb2555e9350de0fd341efe293ee9
MD5 9f25b5a912e258cec35e01c337a8b758
BLAKE2b-256 562a1b8c35b4a5160d6e7af532300f5f07a32bf3e3bbab08b8c515b7591d6859

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for titanq-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fe42c7878667d6555e8ba0953f4a6910027c8d1309c2c54b3f87abb98d44332
MD5 a4a8f4e95c004c85ecb82c970edfdec6
BLAKE2b-256 dca6c584b977ce30bfdcc1fb5f752e11e2a47d78d93d2d7808d13fe7bfab0093

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