Skip to content

Commit

Permalink
set architecture in BackendInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMacCQ committed Aug 30, 2024
1 parent 1d5fd8c commit 64a3ad8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pytket/extensions/qiskit/backends/aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,22 +695,26 @@ def __init__(
super().__init__()
self._qiskit_backend = qiskit_aer_backend(self._qiskit_backend_name)

gate_set = _tket_gate_set_from_qiskit_backend(self._qiskit_backend).union(
self._allowed_special_gates
)
gate_set: set[OpType] = _tket_gate_set_from_qiskit_backend(
self._qiskit_backend
).union(self._allowed_special_gates)
self._noise_model = _map_trivial_noise_model_to_none(noise_model)
characterisation = _get_characterisation_of_noise_model(
self._noise_model, gate_set
characterisation: NoiseModelCharacterisation = (
_get_characterisation_of_noise_model(self._noise_model, gate_set)
)
self._has_arch = bool(characterisation.architecture) and bool(
self._has_arch: bool = bool(characterisation.architecture) and bool(
characterisation.architecture.nodes
)

self._backend_info = BackendInfo(
name=type(self).__name__,
device_name=self._qiskit_backend_name,
version=__extension_version__,
architecture=FullyConnected(n_qubits),
architecture=(
FullyConnected(n_qubits)
if not self._has_arch
else characterisation.architecture
),
gate_set=_tket_gate_set_from_qiskit_backend(self._qiskit_backend),
supports_midcircuit_measurement=True,
supports_reset=True,
Expand Down

0 comments on commit 64a3ad8

Please sign in to comment.