Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Failing a fetch to get an ISA will no longer raise errors when initializing a backend #46

Merged
merged 1 commit into from
Feb 6, 2024
Merged
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
10 changes: 8 additions & 2 deletions qiskit_rigetti/_qcs_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from typing import Any, Optional, List, Dict

from pyquil.api import QCSClient, list_quantum_computers
from qcs_sdk.qpu.isa import InstructionSetArchitecture, get_instruction_set_architecture
from qcs_sdk.qpu.isa import InstructionSetArchitecture, get_instruction_set_architecture, GetISAError
from qiskit.providers import ProviderV1
from qiskit.providers.models import QasmBackendConfiguration

Expand Down Expand Up @@ -105,7 +105,13 @@ def get_simulator(self, *, num_qubits: int, noisy: bool = False) -> RigettiQCSBa

def _get_quantum_processors(self) -> Dict[str, InstructionSetArchitecture]:
qpus = list_quantum_computers(qvms=False, client_configuration=self._client_configuration)
return {qpu: get_instruction_set_architecture(qpu, client=self._client_configuration) for qpu in qpus}
qpu_to_isa: Dict[str, InstructionSetArchitecture] = {}
for qpu in qpus:
try:
qpu_to_isa[qpu] = get_instruction_set_architecture(qpu, client=self._client_configuration)
except GetISAError:
pass
return qpu_to_isa


def _configuration(name: str, num_qubits: int, local: bool, simulator: bool) -> QasmBackendConfiguration:
Expand Down
Loading