Metadata-Version: 2.1
Name: quantuminspire
Version: 3.5.2
Summary: SDK for the Quantum Inspire platform.
Home-page: https://www.quantum-inspire.com
License: Apache-2.0
Author: Quantum Inspire
Author-email: support@quantum-inspire.com
Requires-Python: >=3.10,<3.14
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: local
Requires-Dist: oauthlib (>=3.2.2,<4.0.0)
Requires-Dist: opensquirrel (==0.8.0)
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
Requires-Dist: pydantic-settings (>=2.7.1,<3.0.0)
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
Requires-Dist: qi-compute-api-client (>=0.56.0,<0.57.0)
Requires-Dist: qiskit (>=2.0.0,<2.2.0)
Requires-Dist: qxelarator (>=0.7.4,<0.11.0) ; extra == "local"
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: typer[all] (>=0.15.1,<0.26.0)
Project-URL: Repository, https://github.com/qutech-delft/quantuminspire
Description-Content-Type: text/markdown

# Quantum Inspire

[![License](https://img.shields.io/github/license/qutech-delft/qiskit-quantuminspire.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)

Welcome to the repository for the Quantum Inspire tool. The goal of this project to offer basic support for interacting with the Quantum Inspire platform.
Currently, functionality of the tool is still limited, but the tool is required for logging in to the Quantum Inspire systems. For example, if you would like to use the QI [Qiskit](https://github.com/QuTech-Delft/qiskit-quantuminspire) or [Pennylane](https://github.com/QuTech-Delft/pennylane-quantuminspire) plugins.

## Installation

The recommended way of installing the CLI is to use `pipx`. (Conda users should refer to the subsection below). After following the [pipx installation instructions](https://pipx.pypa.io/stable/installation), run the following command:

```bash
pipx install quantuminspire
```

Afterwards, running `qi --help` should show a help menu.

> [!NOTE]  
> If your python version is newer then supported by quantuminspire, please run the following command: `pipx install quantuminspire --python /path/to/python3.12`.
> Check which versions of python are supported by the tool.

### Installation using Conda

> [!WARNING]  
> Installing quantuminspire using pipx **inside a conda environment** may cause conflicts with other packages. This can result in unexpected behavior and prevent you from using the tool correctly. To avoid these issues, it is recommended to instead create a Conda environment from an `environment.yml` file. 

Check you Conda version with `conda --version`, then run the appropriate command:

**Conda >= 26.3:**

```bash
conda create --file https://conda.quantum-inspire.com/cli.yml
```
**Conda < 26.3:**

```bash
conda env create --file https://conda.quantum-inspire.com/cli.yml
```

By default, the environment that will be created will be named `quantuminspire`; use the `-n/--name <CUSTOM-ENV-NAME>` option to overwrite this.

After creating the environment, you need to activate it (use your custom environment name if you have defined it):

```bash
conda activate quantuminspire
```

## Using the CLI to login

In order to login to the platform, run the following command:

```bash
qi login
```

This will open a browser window that will allow you to login or create an account. By default this command will login to the production environment, but the command accepts an argument for a different host URL if needed (e.g. for beta testing purposes).

## Upload files

The CLI can be used to upload files to Quantum Inspire. These files can both be hybrid and quantum circuits.

**IMPORTANT**: Submitting a (python) `.py` file for hybrid algorithms requires a [specific format](https://qutech-delft.github.io/qiskit-quantuminspire/hybrid/basics.html).
Not all `.py` files are valid for submission.

```bash
qi files upload <filename> <backend_id>
```

The CLI will assume that files with the extension `.cq` are quantum circuits, while files with a `.py` extension are python files.

The list of backends (and their properties)
can be retrieved using the following command, from which id field can be read.

```bash
qi backends list
```

## Get results

The previous command outputs a job ID for the job that was just started. Use this job ID when querying for results.

```bash
qi results get <job_id>
```


## List projects

List all projects belonging to the current user. You can optionally filter projects by name, either using substring matching (default) or exact matching.

### Usage

```bash
qi projects list
```

### Options

* `--print, -p`
  Print the full project list as a table.

* `--name <name>`
  Filter projects by name or description using substring matching.

* `--exact`
  When used with `--name`, only return projects whose name exactly matches the given value.

### Examples

List all projects:

```bash
qi projects list
```

List projects whose name or description contains `"quantum"`:

```bash
qi projects list --name quantum
```

List projects whose name is exactly `"my-project"`:

```bash
qi projects list --name my-project --exact
```

Print the full project list:

```bash
qi projects list --print
```

---

## Delete projects

Delete one or more projects by ID, by name, or delete all projects after confirmation.

> ⚠️ **Deleting projects is irreversible.**
> You will always be prompted for confirmation before deletion.

### Usage

```bash
qi projects delete [PROJECT_IDS...]
```

### Options

* `PROJECT_IDS`
  One or more project IDs to delete.

* `--name <name>`
  Delete projects matching this name or description pattern.

* `--exact`
  When used with `--name`, only delete projects whose name exactly matches the given value.

### Behavior and precedence

* If **project IDs are provided**, `--name` and `--exact` are ignored.
* If no IDs are provided:

  * `--name` filters projects by substring match
  * `--name` + `--exact` performs an exact name match
* If **no IDs and no name** are provided, **all projects** will be deleted after confirmation.

### Examples

Delete projects by ID:

```bash
qi projects delete 1 2 3
```

Delete projects whose name or description contains `"quantum"`:

```bash
qi projects delete --name quantum
```

Delete the project with the exact name `"my-project"`:

```bash
qi projects delete --name my-project --exact
```

Delete **all projects**:

```bash
qi projects delete
```

> You will be asked to confirm before deletion.

**Note**: Mostly useful for quantum circuits.

## Get final results

A job also always contains a final result. This object can be queried with the following command.

```bash
qi final_results get <job_id>
```

**Note**: This object will always be generated. In the case of a quantum circuit, the result and final result will be the same. For hybrid algorithms, the final result is a free form datastructure that could for example be used for the aggregation of data. This is generated in the `finalize` step.

