# Quantagonia API Client
This package contains Quantagonia's CLI client and client-side APIs for using HybridSolver in the cloud.
## Installation
Python >= 3.8 is required. Then, do
```
python -m pip install quantagonia-api-client
```
In order to use HybridSolver through Quantagonia's cloud system, you'll need to sign up for an API key and set it system-wide by
```
export QUANTAGONIA_API_KEY=<your API key here>
```
## Quick start: using the CLI client
This package provides the script `hybridsolver` to interact with the
cloud solver. In order to solve a MIP (supported formats: `.mps, .lp,
.mps.gz, .lp.gz`) or QUBO (spported formats: `.qubo, .qubo.gz`), just
use
```
hybridsolver solve path/to/example.mps
```
which will automatically set all parameters and solver controls to their default value, which is a good compromise for many middle-sized
optimization problems out there.
The `solve` call has a few options (try `hybridsolver solve --help`) and will, after submitting the problem, stream the logs and output the
solution vector if one is found.
To start a job without attaching to its log stream and leave it running in the background, use
```
hybridsolver submit path/to/example.mps
```
which supports the same parameters as `solve` and returns a `job_id`.
using this ID, logs, results and job status as well as time billed can
be retrieved using
```
hybridsolver (logs | solution | status | time_billed) job_id
```
Lastly, in order to cancel a runnning job and avoid unnecessary
costs, use `hybridsolver cancel job_id`. To list `k` active and/or past jobs,
use `hybridsolver list --n=k`.
## Using the API client in your own code
The capabilities of the API client include, but are not limited to:
- a plugin for PuLP to solve PuLP-generated models locally and in the client,
- a simple API to model QUBOs locally and solve them in the cloud and
- an importer to convert PyQUBO models into our format - allowing to solve PyQUBO models in QUantagonia's cloud.
For starters, you can run the examples in `examples/` through, e.g.,
```
QUANTAGONIA_API_KEY="<redacted>" python examples/submit_qubo.py
```
with a valid Quantagonia API key.
For more details, we refer to our [API reference](https://docs.quantagonia.com).
Raw data
{
"_id": null,
"home_page": "https://www.quantagonia.com",
"name": "quantagonia-api-client",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Optimization, Linear Programming, Operations Research",
"author": "Quantagonia GmbH",
"author_email": "apis@quantagonia.com",
"download_url": null,
"platform": null,
"description": "# Quantagonia API Client\n\nThis package contains Quantagonia's CLI client and client-side APIs for using HybridSolver in the cloud.\n\n## Installation\n\nPython >= 3.8 is required. Then, do\n```\npython -m pip install quantagonia-api-client\n```\nIn order to use HybridSolver through Quantagonia's cloud system, you'll need to sign up for an API key and set it system-wide by\n```\nexport QUANTAGONIA_API_KEY=<your API key here>\n```\n\n## Quick start: using the CLI client\n\nThis package provides the script `hybridsolver` to interact with the\ncloud solver. In order to solve a MIP (supported formats: `.mps, .lp,\n.mps.gz, .lp.gz`) or QUBO (spported formats: `.qubo, .qubo.gz`), just\nuse\n```\nhybridsolver solve path/to/example.mps\n```\nwhich will automatically set all parameters and solver controls to their default value, which is a good compromise for many middle-sized\noptimization problems out there.\n\nThe `solve` call has a few options (try `hybridsolver solve --help`) and will, after submitting the problem, stream the logs and output the\nsolution vector if one is found.\n\nTo start a job without attaching to its log stream and leave it running in the background, use\n```\nhybridsolver submit path/to/example.mps\n```\nwhich supports the same parameters as `solve` and returns a `job_id`.\nusing this ID, logs, results and job status as well as time billed can\nbe retrieved using\n```\nhybridsolver (logs | solution | status | time_billed) job_id\n```\nLastly, in order to cancel a runnning job and avoid unnecessary\ncosts, use `hybridsolver cancel job_id`. To list `k` active and/or past jobs,\nuse `hybridsolver list --n=k`.\n\n## Using the API client in your own code\n\nThe capabilities of the API client include, but are not limited to:\n- a plugin for PuLP to solve PuLP-generated models locally and in the client,\n- a simple API to model QUBOs locally and solve them in the cloud and\n- an importer to convert PyQUBO models into our format - allowing to solve PyQUBO models in QUantagonia's cloud.\n\nFor starters, you can run the examples in `examples/` through, e.g.,\n```\nQUANTAGONIA_API_KEY=\"<redacted>\" python examples/submit_qubo.py\n```\nwith a valid Quantagonia API key.\n\nFor more details, we refer to our [API reference](https://docs.quantagonia.com).\n",
"bugtrack_url": null,
"license": null,
"summary": "This package contains APIs for accessing Quantagonia's HybridSolver for solving MIPs and QUBOs through native file formats or PuLP resp. PyQUBO, Qiskit, or Ocean",
"version": "0.85",
"project_urls": {
"Homepage": "https://www.quantagonia.com"
},
"split_keywords": [
"optimization",
" linear programming",
" operations research"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b551f1aeb1cbf5d089ebe7d1094fe014e63bdb3e32b27dcd82f27637d390c749",
"md5": "759efc0bde850e1751f0eb666948ab71",
"sha256": "d31992a36f9681d17bb00693b35396c6d1b11d2584e854a7217966cefec33777"
},
"downloads": -1,
"filename": "quantagonia_api_client-0.85-py3-none-any.whl",
"has_sig": false,
"md5_digest": "759efc0bde850e1751f0eb666948ab71",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 75396,
"upload_time": "2024-06-19T11:01:15",
"upload_time_iso_8601": "2024-06-19T11:01:15.982313Z",
"url": "https://files.pythonhosted.org/packages/b5/51/f1aeb1cbf5d089ebe7d1094fe014e63bdb3e32b27dcd82f27637d390c749/quantagonia_api_client-0.85-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-19 11:01:15",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "quantagonia-api-client"
}