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

Commit

Permalink
fix: fetching IBM backend properties deactivated
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Wagner committed May 17, 2024
1 parent 651e763 commit ae42595
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions planqk/qiskit/providers/ibm/ibm_provider_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
from typing import Dict
from typing import Optional, List

from qiskit import QuantumCircuit
from qiskit.providers.models import BackendStatus
from qiskit_ibm_provider import IBMBackend
from qiskit_ibm_provider.job import IBMCircuitJob
from qiskit_ibm_provider.utils import RuntimeEncoder

from planqk.qiskit import PlanqkJob
from planqk.qiskit.client.backend_dtos import STATUS
from planqk.qiskit.client.client import _PlanqkClient
from planqk.qiskit.client.job_dtos import JobDto, INPUT_FORMAT, RuntimeJobParamsDto
from planqk.qiskit.planqk_runtime_job import PlanqkRuntimeJob
from planqk.qiskit.providers.ibm.ibm_backend import PlanqkIbmBackend
from qiskit import QuantumCircuit
from qiskit.providers.models import BackendStatus
from qiskit_ibm_provider import IBMBackend
from qiskit_ibm_provider.job import IBMCircuitJob
from qiskit_ibm_provider.utils import RuntimeEncoder


def _encode_circuit_base64(circuit: QuantumCircuit):
Expand All @@ -27,8 +26,11 @@ class PlanqkIbmProviderBackend(PlanqkIbmBackend):

def __init__(self, **kwargs):
PlanqkIbmBackend.__init__(self, **kwargs)
self.ibm_backend = IBMBackend(configuration=self.configuration(), provider=None, api_client=None)
self.ibm_backend = IBMBackend(configuration=self.configuration(),
provider=kwargs.get('provider'),
api_client=None)
self.ibm_backend._runtime_run = self._submit_job
self.ibm_backend.properties = self._backend_properties
self.ibm_backend.status = self.status

def run(self, circuit, **kwargs) -> PlanqkRuntimeJob:
Expand Down Expand Up @@ -70,6 +72,10 @@ def _submit_job(

return PlanqkRuntimeJob(backend=self, job_details=job_request)

def _backend_properties(self):
# Supported for loading dynamic properties currently not supported
return None;

def retrieve_job(self, job_id: str) -> PlanqkJob:
job_details = _PlanqkClient.get_job(job_id)
return PlanqkRuntimeJob(backend=self, job_id=job_id, job_details=job_details)

0 comments on commit ae42595

Please sign in to comment.