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

Commit

Permalink
feat: using PlanQK provider for PennyLane-Qiskit plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Wagner committed Dec 11, 2023
1 parent d84aca5 commit 3f27de3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions planqk/qiskit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def run(self, circuit, **kwargs) -> PlanqkJob:
raise ValueError("Multi-experiment jobs are not supported")
circuit = circuit[0]

# PennyLane-Qiskit Plugin identifies the result based on the circuit name which must be "circ0"
circuit.name = "circ0"
shots = kwargs.get('shots', self._backend_info.configuration.shots_range.min)

# TODO add support for input params
Expand Down
5 changes: 4 additions & 1 deletion planqk/qiskit/job.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional

from qiskit.providers import JobV1, JobStatus, Backend
from qiskit.qobj import QobjExperimentHeader
from qiskit.result import Result
from qiskit.result.models import ExperimentResult, ExperimentResultData

Expand Down Expand Up @@ -81,7 +82,9 @@ def result(self) -> Result:
data=ExperimentResultData(
counts=result_data["counts"] if result_data["counts"] is not None else {},
memory=result_data["memory"] if result_data["memory"] is not None else []
)
),
# Header required for PennyLane-Qiskit Plugin as it identifies the result based on the circuit name which is always "circ0"
header=QobjExperimentHeader(name="circ0")
)

self._result = Result(
Expand Down

0 comments on commit 3f27de3

Please sign in to comment.