Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
- [Aer](https://github.com/Qiskit/qiskit-aer) state vector and tensor network multi-GPU emulators
- [Qsim](https://github.com/quantumlib/qsim) NISQ emulators
- [CUDA-Q](https://developer.nvidia.com/cuda-q) emulators by NVIDIA
- [Quantanium](https://github.com/qperfect-io/quantanium-python) emulators by QPerfect
- [QPerfect](https://github.com/qperfect-io/quantanium-python) emulators by QPerfect
- [Quobly](https://github.com/quobly-sw/Quobly-alloy) silicon spin qubits emulators by Quobly

To run circuits over [Quandela](https://www.quandela.com/) backends provided by Scaleway, you must use [Perceval SDK](https://perceval.quandela.net/) through the [Scaleway provider](https://perceval.quandela.net/docs/providers.html).

Expand Down
4 changes: 2 additions & 2 deletions qiskit_scaleway/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from .base_backend import BaseBackend
from .base_job import BaseJob
from .aer.backend import AerBackend
from .pioneer.backend import PioneerBackend
from .quobly.backend import QuoblyBackend
from .qsim.backend import QsimBackend
from .aqt.backend import AqtBackend
from .iqm.backend import IqmBackend
from .cudaq.backend import CudaqBackend
from .quantanium.backend import QuantaniumBackend
from .qperfect.backend import QperfectBackend
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .backend import QuantaniumBackend
from .job import QuantaniumJob
from .backend import QperfectBackend
from .job import QperfectJob
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler import Target

from qiskit_scaleway.backends.quantanium.job import QuantaniumJob
from qiskit_scaleway.backends.qperfect.job import QperfectJob
from qiskit_scaleway.backends import BaseBackend

from scaleway_qaas_client.v1alpha1 import QaaSClient, QaaSPlatform


class QuantaniumBackend(BaseBackend):
class QperfectBackend(BaseBackend):
def __init__(self, provider, client: QaaSClient, platform: QaaSPlatform):
super().__init__(
provider=provider,
Expand All @@ -40,19 +40,19 @@ def __init__(self, provider, client: QaaSClient, platform: QaaSPlatform):
self._target = Target(num_qubits=platform.max_qubit_count)

def __repr__(self) -> str:
return f"<QuantaniumBackend(name={self.name},num_qubits={self.num_qubits},platform_id={self.id})>"
return f"<QperfectBackend(name={self.name},num_qubits={self.num_qubits},platform_id={self.id})>"

@property
def target(self):
return self._target

@property
def job_cls(self):
return QuantaniumJob
return QperfectJob

def run(
self, circuits: Union[QuantumCircuit, List[QuantumCircuit]], **kwargs
) -> QuantaniumJob:
) -> QperfectJob:
if not isinstance(circuits, List):
circuits = [circuits]

Expand All @@ -69,7 +69,7 @@ def run(
job_config[kwarg] = kwargs[kwarg]

job_config["nsamples"] = job_config["shots"]
job_name = f"qj-quantanium-{randomname.get_name()}"
job_name = f"qj-qperfect-{randomname.get_name()}"

session_id = job_config.get("session_id", None)

Expand All @@ -78,7 +78,7 @@ def run(
job_config.pop("session_max_duration")
job_config.pop("session_max_idle_duration")

job = QuantaniumJob(
job = QperfectJob(
backend=self,
client=self._client,
circuits=circuits,
Expand All @@ -102,7 +102,7 @@ def run(
def _default_options(self):
return Options(
session_id="auto",
session_name="qs-qiskit-quantanium",
session_name="qs-qiskit-qperfect",
session_max_duration="59m",
session_max_idle_duration="59m",
shots=1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from scaleway_qaas_client.v1alpha1 import QaaSClient


class QuantaniumJob(BaseJob):
class QperfectJob(BaseJob):
def __init__(
self,
name: str,
Expand Down Expand Up @@ -63,10 +63,10 @@ def submit(self, session_id: str) -> None:
]

# Retrieve run options
quantanium_option = {}
qperfect_option = {}
shots = options.pop("shots")

quantanium_option = dict(filter(lambda item : item[1] is not None, options.items()))
qperfect_option = dict(filter(lambda item : item[1] is not None, options.items()))

backend_data = BackendData(
name=self.backend().name,
Expand All @@ -86,7 +86,7 @@ def submit(self, session_id: str) -> None:

computation_parameters_json = QuantumComputationParameters(
shots=shots,
options=quantanium_option,
options=qperfect_option,
).to_json_str()

model = self._client.create_model(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from .backend import PioneerBackend
from .backend import QuoblyBackend
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler import Target

from qiskit_scaleway.backends.pioneer.job import PioneerJob
from qiskit_scaleway.backends.quobly.job import QuoblyJob
from qiskit_scaleway.backends import BaseBackend

from scaleway_qaas_client.v1alpha1 import QaaSClient, QaaSPlatform


class PioneerBackend(BaseBackend):
class QuoblyBackend(BaseBackend):
def __init__(self, provider, client: QaaSClient, platform: QaaSPlatform):
super().__init__(
provider=provider,
Expand All @@ -40,19 +40,19 @@ def __init__(self, provider, client: QaaSClient, platform: QaaSPlatform):
self._target = Target(num_qubits=platform.max_qubit_count)

def __repr__(self) -> str:
return f"<PioneerBackend(name={self.name},num_qubits={self.num_qubits},platform_id={self.id})>"
return f"<QuoblyBackend(name={self.name},num_qubits={self.num_qubits},platform_id={self.id})>"

@property
def target(self):
return self._target

@property
def job_cls(self):
return PioneerJob
return QuoblyJob

def run(
self, circuits: Union[QuantumCircuit, List[QuantumCircuit]], **kwargs
) -> PioneerJob:
) -> QuoblyJob:
if not isinstance(circuits, List):
circuits = [circuits]

Expand All @@ -68,7 +68,7 @@ def run(
else:
job_config[kwarg] = kwargs[kwarg]

job_name = f"qj-pioneer-{randomname.get_name()}"
job_name = f"qj-quobly-{randomname.get_name()}"

session_id = job_config.get("session_id", None)

Expand All @@ -77,7 +77,7 @@ def run(
job_config.pop("session_max_duration")
job_config.pop("session_max_idle_duration")

job = PioneerJob(
job = QuoblyJob(
backend=self,
client=self._client,
circuits=circuits,
Expand All @@ -101,7 +101,7 @@ def run(
def _default_options(self):
return Options(
session_id="auto",
session_name="qs-qiskit-pioneer",
session_name="qs-qiskit-quobly",
session_max_duration="59m",
session_max_idle_duration="59m",
shots=1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from scaleway_qaas_client.v1alpha1 import QaaSClient


class PioneerJob(BaseJob):
class QuoblyJob(BaseJob):
def __init__(
self,
name: str,
Expand Down Expand Up @@ -63,10 +63,10 @@ def submit(self, session_id: str) -> None:
]

# Retrieve run options
pioneer_option = {}
quobly_option = {}
shots = options.pop("shots")

pioneer_option = dict(filter(lambda item : item[1] is not None, options.items()))
quobly_option = dict(filter(lambda item : item[1] is not None, options.items()))

backend_data = BackendData(
name=self.backend().name,
Expand All @@ -86,7 +86,7 @@ def submit(self, session_id: str) -> None:

computation_parameters_json = QuantumComputationParameters(
shots=shots,
options=pioneer_option,
options=quobly_option,
).to_json_str()

model = self._client.create_model(
Expand Down
8 changes: 4 additions & 4 deletions qiskit_scaleway/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
QsimBackend,
AerBackend,
CudaqBackend,
QuantaniumBackend,
PioneerBackend,
QperfectBackend,
QuoblyBackend,
)

from scaleway_qaas_client.v1alpha1 import QaaSClient

_MAP_NAME_TO_BACKEND = {
"iqm": IqmBackend,
"aqt": AqtBackend,
"pioneer": PioneerBackend,
"quobly": QuoblyBackend,
"qsim": QsimBackend,
"aer": AerBackend,
"cudaq": CudaqBackend,
"quantanium": QuantaniumBackend,
"qperfect": QperfectBackend,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
from qiskit_scaleway import ScalewayProvider


def test_quantanium_simple_circuit():
def test_qperfect_simple_circuit():
provider = ScalewayProvider(
project_id=os.environ["QISKIT_SCALEWAY_PROJECT_ID"],
secret_key=os.environ["QISKIT_SCALEWAY_SECRET_KEY"],
url=os.getenv("QISKIT_SCALEWAY_API_URL"),
)

backend = provider.get_backend(
os.getenv("QUANTANIUM_SCALEWAY_BACKEND_NAME", "EMU-QUANTANIUM-16C-128M")
os.getenv("QPERFECT_SCALEWAY_BACKEND_NAME", "EMU-QUANTANIUM-16C-128M")
)

assert backend is not None

session_id = backend.start_session(
name="my-quantanium-session-autotest",
deduplication_id=f"my-quantanium-session-autotest-{random.randint(1, 1000)}",
name="my-qperfect-session-autotest",
deduplication_id=f"my-qperfect-session-autotest-{random.randint(1, 1000)}",
max_duration="15m",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
from qiskit_scaleway import ScalewayProvider


def test_pioneer_simple_circuit():
def test_quobly_simple_circuit():
provider = ScalewayProvider(
project_id=os.environ["QISKIT_SCALEWAY_PROJECT_ID"],
secret_key=os.environ["QISKIT_SCALEWAY_SECRET_KEY"],
url=os.getenv("QISKIT_SCALEWAY_API_URL"),
)

backend = provider.get_backend(
os.getenv("PIONEER_SCALEWAY_BACKEND_NAME", "EMU-PIONEER-16C-128M")
os.getenv("QUOBLY_SCALEWAY_BACKEND_NAME", "EMU-PIONEER-16C-128M")
)

assert backend is not None

session_id = backend.start_session(
name="my-pioneer-session-autotest",
deduplication_id=f"my-pioneer-session-autotest-{random.randint(1, 1000)}",
name="my-quobly-session-autotest",
deduplication_id=f"my-quobly-session-autotest-{random.randint(1, 1000)}",
max_duration="15m",
)

Expand Down
Loading