Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
feat: Add T-Systems as provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Wagner committed Dec 20, 2023
1 parent f2c23e1 commit 12b2505
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,7 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/pydev,linux,macos,python,windows,intellij+all
/tests/acceptance/backends/
/tests/acceptance/.env
/tests/acceptance/__init__.py
/tests/acceptance/backends alias
4 changes: 2 additions & 2 deletions planqk/qiskit/client/backend_dtos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
from typing import List
from typing import Optional

from pydantic import BaseModel

from planqk.qiskit.client.dto_utils import init_with_defined_params
from planqk.qiskit.client.job_dtos import INPUT_FORMAT
from pydantic import BaseModel


class PROVIDER(Enum):
Expand All @@ -16,6 +15,7 @@ class PROVIDER(Enum):
DWAVE = "DWAVE"
IBM = "IBM"
IBM_CLOUD = "IBM_CLOUD"
TSYSTEMS = "TSYSTEMS"


class TYPE(Enum):
Expand Down
5 changes: 2 additions & 3 deletions planqk/qiskit/providers/adapter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from typing import Optional, List

from qiskit.circuit import Instruction as QiskitInstruction

from planqk.qiskit.client.backend_dtos import PROVIDER, QubitDto, ConnectivityDto
from qiskit.circuit import Instruction as QiskitInstruction


class ProviderAdapter:
Expand All @@ -28,7 +27,7 @@ def get_adapter(provider: PROVIDER) -> ProviderAdapter:
return AwsAdapter()
elif provider == PROVIDER.AZURE:
return AzureAdapter()
elif provider == PROVIDER.IBM or provider == PROVIDER.IBM_CLOUD:
elif provider in {PROVIDER.IBM, PROVIDER.IBM_CLOUD, PROVIDER.TSYSTEMS}:
return IbmAdapter()
else:
raise ValueError(f"Provider {provider} not supported")
11 changes: 5 additions & 6 deletions planqk/qiskit/runtime_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
from datetime import datetime
from typing import Optional, Union, Callable, Type, Sequence, Dict, List, Any

from qiskit.providers import QiskitBackendNotFoundError
from qiskit_ibm_runtime import RuntimeOptions, ParameterNamespace, RuntimeProgram, ibm_backend
from qiskit_ibm_runtime.accounts import ChannelType
from qiskit_ibm_runtime.program import ResultDecoder

from planqk.qiskit import PlanqkQuantumProvider
from planqk.qiskit.client.backend_dtos import PROVIDER
from planqk.qiskit.client.client import _PlanqkClient
from planqk.qiskit.client.job_dtos import RuntimeJobParamsDto, JobDto, INPUT_FORMAT
from planqk.qiskit.planqk_runtime_job import PlanqkRuntimeJob
from planqk.qiskit.providers.job_input_converter import convert_circuit_to_backend_input
from qiskit.providers import QiskitBackendNotFoundError
from qiskit_ibm_runtime import RuntimeOptions, ParameterNamespace, RuntimeProgram, ibm_backend
from qiskit_ibm_runtime.accounts import ChannelType
from qiskit_ibm_runtime.program import ResultDecoder

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -49,7 +48,7 @@ def backend(
"""
# Backend returned must be from IBM
backend = self.get_backend(name=name)
if backend.backend_provider not in {PROVIDER.IBM, PROVIDER.IBM_CLOUD}:
if backend.backend_provider not in {PROVIDER.IBM, PROVIDER.IBM_CLOUD, PROVIDER.TSYSTEMS}:
raise QiskitBackendNotFoundError(
f"Backend '{name}' is not from IBM. Qiskit Runtime only supports IBM backends.")

Expand Down

0 comments on commit 12b2505

Please sign in to comment.