Skip to content

Commit 9f7e74c

Browse files
committed
[QI2-1289] Qiskit hybrid
1 parent ee4e7cf commit 9f7e74c

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "qi-compute-api-client"
3-
version = "0.43.0"
3+
version = "0.44.0"
44
description = "An API client for the Compute Job Manager of Quantum Inspire."
55
license = "Apache-2.0"
66
authors = ["Quantum Inspire <[email protected]>"]
@@ -29,7 +29,7 @@ pydantic = "^2.10.4"
2929
python = "^3.8"
3030
python-dateutil = "^2.8.2"
3131
urllib3 = "^2.0.0"
32-
requests = "^2.32.3"
32+
requests = "^2.31.0"
3333

3434
[tool.poetry.group.dev.dependencies]
3535
pytest = {extras = ["toml"], version = "^8.0.0"}

qi2_shared/hybrid/__init__.py

Whitespace-only changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""Quantum Inspire SDK.
2+
3+
Copyright 2022 QuTech Delft
4+
5+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
6+
License. You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
11+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
12+
language governing permissions and limitations under the License.
13+
"""
14+
15+
from abc import ABC, abstractmethod
16+
from typing import Any, Dict, List
17+
18+
from compute_api_client.models.backend_type import BackendType
19+
from pydantic import BaseModel
20+
21+
22+
class ExecuteCircuitResult(BaseModel):
23+
"""Result of executing a quantum circuit."""
24+
25+
results: Dict[str, float]
26+
shots_requested: int
27+
shots_done: int
28+
29+
30+
class QuantumInterface(ABC):
31+
"""Interface for running quantum circuits from hybrid algorithms."""
32+
33+
# pylint: disable = R0903
34+
# Too few public methods (1/2) (too-few-public-methods)
35+
36+
results: List[Dict[str, Any]]
37+
backend_type: BackendType
38+
39+
@abstractmethod
40+
def execute_circuit(
41+
self, circuit: str, number_of_shots: int
42+
) -> ExecuteCircuitResult:
43+
"""Execute a quantum circuit."""
44+
raise NotImplementedError

0 commit comments

Comments
 (0)