titanq


Nametitanq JSON
Version 0.9.5 PyPI version JSON
download
home_pageNone
SummaryThe TitanQ SDK for python
upload_time2024-04-29 20:08:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache 2.0
keywords titan titanq optimization platform infinity infinityq
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # The TitanQ SDK for Python

![Python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11-blue) ![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)

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](https://docs.titanq.infinityq.io).

This TitanQ package is maintained and published by [InfinityQ](https://www.infinityq.tech/)


## 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](mailto:support@infinityq.tech)


## Installation

The following steps assume that you have:

- A **valid** and **active** API Key
- A supported Python version installed


## Setting up an environment

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


## Install TitanQ

``` bash
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](https://docs.titanq.infinityq.io/quickstart/category/python-sdk)

## 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} \\](https://latex.codecogs.com/svg.latex?%5C%5C%20argmin_%7B%5Cmathbf%7Bx%7D%7D%20%5C%2C%5C%2C%5C%2C%5C%2C%20E(%5Cmathbf%7Bx%7D)%20%3D%20%5Csum_%7Bi%3D1%7D%5En%5Csum_%7Bi%20%5Cleq%20j%7D%5En%20Q_%7Bi%2Cj%7D%20x_i%20x_j%20%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%20%5Cmathbf%7Bx%7D%3D(x_i)%5Cin%20%5C%7B0%2C1%5C%7D%5E%7Bn%7D%20%5C%5C)](#_)

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}](https://latex.codecogs.com/svg.latex?%5C%5C%20%5Cmathbf%7BW%7D%3D(W_%7Bi%2Cj%7D)%5Cin%20%5Cmathbb%7BR%7D%5E%7Bn%20%5Ctimes%20n%7D%2C%20~%20where%20~%20%5Cmathbf%7BQ%7D%20%3D%20%5Cmathbf%7BW%7D%20%2B%20%5Cmathbf%7Bb%7D%5E%7B%5Cintercal%7D%5Cboldsymbol%7BI%7D%2C%20~%20and%20~%20%5Cmathbf%7Bb%7D%20%3D%20(b_i)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bn%7D)](#_)

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}](https://latex.codecogs.com/svg.latex?%5C%5C%20%5Cbegin%7Balign%7D%20%5Cnotag%20%5C%5C%20argmin_%7B%5Cmathbf%7Bx%7D%7D%20%5C%2C%20%5C%2C%20%5C%2C%20%5C%2C%20E(%5Cmathbf%7Bx%7D)%20%26%20%3D%20%5Csum_%7Bi%3D1%7D%5En%20%5Csum_%7Bi%20%3C%20j%7D%5En%20W_%7Bi%2Cj%7Dx_i%20x_j%20%2B%20%5Csum_i%5En%20b_i%20x_i%20%5Cnotag%20%5C%5C%20%26%20%3D%20%5Cfrac%7B1%7D%7B2%7D%5Csum_%7Bi%3D1%7D%5En%5Csum_%7Bj%3D1%7D%5En%20W_%7Bi%2Cj%7Dx_%7Bi%7Dx_%7Bj%7D%20%2B%20%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20b_%7Bi%7Dx_%7Bi%7D%20%5Cnotag%20%5C%5C%20%26%20%3D%20%5Cfrac%7B1%7D%7B2%7D(%5Cmathbf%7Bx%7D%5E%7B%5Cintercal%7D%5Cmathbf%7BW%7D%5Cmathbf%7Bx%7D)%20%2B%20%5Cmathbf%7Bb%7D%5E%7B%5Cintercal%7D%5Cmathbf%7Bx%7D%20%5Cnotag%20%5Cend%7Balign%7D)](#_)


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](https://docs.titanq.infinityq.io)


## Getting support or help


Further help can be obtained by contacting [InfinityQ support](mailto:support@infinityq.tech)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "titanq",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "InfinityQ <support@infinityq.tech>",
    "keywords": "titan, titanq, optimization, platform, infinity, infinityq",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/8c/0d/b978c5f099c83632c20d5d6f6aff98b3a0a980677512b744c0038684d0a8/titanq-0.9.5.tar.gz",
    "platform": null,
    "description": "# The TitanQ SDK for Python\n\n![Python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11-blue) ![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)\n\nTitanQ is the InfinityQ Software Development Kit (SDK) for Python. The SDK facilitates and opens the way for faster implementation\nof the TitanQ solver without having to deal directly with the [TitanQ API](https://docs.titanq.infinityq.io).\n\nThis TitanQ package is maintained and published by [InfinityQ](https://www.infinityq.tech/)\n\n\n## API Key\n\nIn order to use the TitanQ service, a user needs an API key.\nThe API key can be obtained by contacting [InfinityQ support](mailto:support@infinityq.tech)\n\n\n## Installation\n\nThe following steps assume that you have:\n\n- A **valid** and **active** API Key\n- A supported Python version installed\n\n\n## Setting up an environment\n\n``` bash\npython -m venv .venv\n.venv/bin/activate\n```\n\n\n## Install TitanQ\n\n``` bash\npip install titanq\n```\n\n\n## Using TitanQ\n\nThe 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.\n\nCurrently, the SDK only supports two types of storage\n\n| Storage options                | Vector variables limit           |\n|--------------------------------|----------------------------------|\n| S3 Buckets                     | \u2705 Up to 100k vector variables   |\n| Managed storage                | \u26a0\ufe0f Up to 10k vector variables     |\n\nBoth options are documented with examples at the TitanQ's [Quickstart documentation](https://docs.titanq.infinityq.io/quickstart/category/python-sdk)\n\n## Problem construction\n\n> **_NOTE:_**  The weights matrix must be symmetrical.\n\nThe QUBO problem is defined as finding the minimal energy configuration (the state $\\mathbf{x}$ which results in the minimal $E(\\mathbf{x})$).\nEach state $\\mathbf{x}$ is a vector of $n$ binary elements $x_i$ which can take the values of 0 or 1 (binary values).\nThis model formulation is given in the equation below\n\n[![\\\\ 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} \\\\](https://latex.codecogs.com/svg.latex?%5C%5C%20argmin_%7B%5Cmathbf%7Bx%7D%7D%20%5C%2C%5C%2C%5C%2C%5C%2C%20E(%5Cmathbf%7Bx%7D)%20%3D%20%5Csum_%7Bi%3D1%7D%5En%5Csum_%7Bi%20%5Cleq%20j%7D%5En%20Q_%7Bi%2Cj%7D%20x_i%20x_j%20%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%5C%2C%20%5Cmathbf%7Bx%7D%3D(x_i)%5Cin%20%5C%7B0%2C1%5C%7D%5E%7Bn%7D%20%5C%5C)](#_)\n\nThe 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,\nwe 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\nalong its diagonal is referred to as the *weights* matrix, denoted by\n\n[![\\\\ \\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}](https://latex.codecogs.com/svg.latex?%5C%5C%20%5Cmathbf%7BW%7D%3D(W_%7Bi%2Cj%7D)%5Cin%20%5Cmathbb%7BR%7D%5E%7Bn%20%5Ctimes%20n%7D%2C%20~%20where%20~%20%5Cmathbf%7BQ%7D%20%3D%20%5Cmathbf%7BW%7D%20%2B%20%5Cmathbf%7Bb%7D%5E%7B%5Cintercal%7D%5Cboldsymbol%7BI%7D%2C%20~%20and%20~%20%5Cmathbf%7Bb%7D%20%3D%20(b_i)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bn%7D)](#_)\n\ndenotes the *biases*, which are used in the final model formulation described below\n\n[![\\\\ \\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}](https://latex.codecogs.com/svg.latex?%5C%5C%20%5Cbegin%7Balign%7D%20%5Cnotag%20%5C%5C%20argmin_%7B%5Cmathbf%7Bx%7D%7D%20%5C%2C%20%5C%2C%20%5C%2C%20%5C%2C%20E(%5Cmathbf%7Bx%7D)%20%26%20%3D%20%5Csum_%7Bi%3D1%7D%5En%20%5Csum_%7Bi%20%3C%20j%7D%5En%20W_%7Bi%2Cj%7Dx_i%20x_j%20%2B%20%5Csum_i%5En%20b_i%20x_i%20%5Cnotag%20%5C%5C%20%26%20%3D%20%5Cfrac%7B1%7D%7B2%7D%5Csum_%7Bi%3D1%7D%5En%5Csum_%7Bj%3D1%7D%5En%20W_%7Bi%2Cj%7Dx_%7Bi%7Dx_%7Bj%7D%20%2B%20%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%20b_%7Bi%7Dx_%7Bi%7D%20%5Cnotag%20%5C%5C%20%26%20%3D%20%5Cfrac%7B1%7D%7B2%7D(%5Cmathbf%7Bx%7D%5E%7B%5Cintercal%7D%5Cmathbf%7BW%7D%5Cmathbf%7Bx%7D)%20%2B%20%5Cmathbf%7Bb%7D%5E%7B%5Cintercal%7D%5Cmathbf%7Bx%7D%20%5Cnotag%20%5Cend%7Balign%7D)](#_)\n\n\nAdditional parameters are available to tune the problem:\n- beta\n- coupling_mult\n- num_chains\n- num_engines\n\nFor more informations how to use theses parameters, please refer to the [API documentation](https://docs.titanq.infinityq.io)\n\n\n## Getting support or help\n\n\nFurther help can be obtained by contacting [InfinityQ support](mailto:support@infinityq.tech)\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "The TitanQ SDK for python",
    "version": "0.9.5",
    "project_urls": {
        "Documentation": "https://sdk.titanq.infinityq.io",
        "Examples": "https://github.com/infinityq-tech/titanq-examples",
        "Homepage": "https://www.infinityq.tech"
    },
    "split_keywords": [
        "titan",
        " titanq",
        " optimization",
        " platform",
        " infinity",
        " infinityq"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "248d6ce3f2d83d2cecfb184b1a7dceefac2a53fb03bfeb3abbc4365b166285af",
                "md5": "087c7ea42439257d0de50d8e13a14d00",
                "sha256": "3ab8acf768f08d0520fb7d62d56db37a9acee5989c6d1eeda1cafe1d2dedf404"
            },
            "downloads": -1,
            "filename": "titanq-0.9.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "087c7ea42439257d0de50d8e13a14d00",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 25690,
            "upload_time": "2024-04-29T20:08:42",
            "upload_time_iso_8601": "2024-04-29T20:08:42.904649Z",
            "url": "https://files.pythonhosted.org/packages/24/8d/6ce3f2d83d2cecfb184b1a7dceefac2a53fb03bfeb3abbc4365b166285af/titanq-0.9.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c0db978c5f099c83632c20d5d6f6aff98b3a0a980677512b744c0038684d0a8",
                "md5": "42767f91ef6bccf58e9f6b442d52647f",
                "sha256": "0c985a9b973795c556a95f38a5a857d9e67055d86978ed861b508965dba6ed95"
            },
            "downloads": -1,
            "filename": "titanq-0.9.5.tar.gz",
            "has_sig": false,
            "md5_digest": "42767f91ef6bccf58e9f6b442d52647f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 28055,
            "upload_time": "2024-04-29T20:08:44",
            "upload_time_iso_8601": "2024-04-29T20:08:44.795760Z",
            "url": "https://files.pythonhosted.org/packages/8c/0d/b978c5f099c83632c20d5d6f6aff98b3a0a980677512b744c0038684d0a8/titanq-0.9.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 20:08:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "infinityq-tech",
    "github_project": "titanq-examples",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "titanq"
}
        
Elapsed time: 0.29814s