diff --git a/src/qibocal/protocols/randomized_benchmarking/utils.py b/src/qibocal/protocols/randomized_benchmarking/utils.py index e9f41ced3..3c92faa01 100644 --- a/src/qibocal/protocols/randomized_benchmarking/utils.py +++ b/src/qibocal/protocols/randomized_benchmarking/utils.py @@ -7,7 +7,7 @@ import numpy as np import numpy.typing as npt from qibo import gates -from qibo.backends import GlobalBackend +from qibo.backends import get_backend from qibo.config import raise_error from qibo.models import Circuit from qibolab.platform import Platform @@ -352,7 +352,7 @@ def setup( tuple: A tuple containing the experiment data, noise model, and backend. """ - backend = GlobalBackend() + backend = get_backend() backend.platform = platform # For simulations, a noise model can be added. noise_model = None diff --git a/src/qibocal/protocols/readout_mitigation_matrix.py b/src/qibocal/protocols/readout_mitigation_matrix.py index ce11fd314..81ca108bc 100644 --- a/src/qibocal/protocols/readout_mitigation_matrix.py +++ b/src/qibocal/protocols/readout_mitigation_matrix.py @@ -5,7 +5,7 @@ import numpy.typing as npt import plotly.express as px from qibo import gates -from qibo.backends import GlobalBackend +from qibo.backends import get_backend from qibo.models import Circuit from qibolab.platform import Platform from qibolab.qubits import QubitId @@ -61,7 +61,7 @@ def _acquisition( data = ReadoutMitigationMatrixData( nshots=params.nshots, qubit_list=[list(qq) for qq in targets] ) - backend = GlobalBackend() + backend = get_backend() backend.platform = platform transpiler = dummy_transpiler(backend) qubit_map = [i for i in range(platform.nqubits)] diff --git a/src/qibocal/protocols/state_tomography.py b/src/qibocal/protocols/state_tomography.py index 7085aecd7..d1645b42a 100644 --- a/src/qibocal/protocols/state_tomography.py +++ b/src/qibocal/protocols/state_tomography.py @@ -8,7 +8,7 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots from qibo import Circuit, gates -from qibo.backends import GlobalBackend, NumpyBackend, matrices +from qibo.backends import NumpyBackend, get_backend, matrices from qibo.quantum_info import fidelity, partial_trace from qibolab.platform import Platform from qibolab.qubits import QubitId @@ -102,7 +102,7 @@ def _acquisition( if params.circuit is None: params.circuit = Circuit(len(targets)) - backend = GlobalBackend() + backend = get_backend() backend.platform = platform transpiler = dummy_transpiler(backend) diff --git a/src/qibocal/protocols/two_qubit_interaction/chsh/protocol.py b/src/qibocal/protocols/two_qubit_interaction/chsh/protocol.py index f8a64c57b..c7e5f97fe 100644 --- a/src/qibocal/protocols/two_qubit_interaction/chsh/protocol.py +++ b/src/qibocal/protocols/two_qubit_interaction/chsh/protocol.py @@ -8,7 +8,7 @@ import numpy as np import numpy.typing as npt import plotly.graph_objects as go -from qibo.backends import GlobalBackend +from qibo.backends import get_backend from qibolab import ExecutionParameters from qibolab.platform import Platform from qibolab.qubits import QubitId, QubitPairId @@ -222,7 +222,7 @@ def _acquisition_circuits( bell_states=params.bell_states, thetas=thetas.tolist(), ) - backend = GlobalBackend() + backend = get_backend() backend.platform = platform transpiler = dummy_transpiler(backend) if params.apply_error_mitigation: diff --git a/src/qibocal/protocols/two_qubit_state_tomography.py b/src/qibocal/protocols/two_qubit_state_tomography.py index 114254edd..238f5697a 100644 --- a/src/qibocal/protocols/two_qubit_state_tomography.py +++ b/src/qibocal/protocols/two_qubit_state_tomography.py @@ -9,7 +9,7 @@ import plotly.graph_objects as go from plotly.subplots import make_subplots from qibo import Circuit, gates -from qibo.backends import GlobalBackend, NumpyBackend +from qibo.backends import NumpyBackend, get_backend from qibo.quantum_info import fidelity, partial_trace from qibo.result import QuantumState from qibolab.platform import Platform @@ -97,7 +97,7 @@ def _acquisition( if params.circuit is None: params.circuit = Circuit(len(qubits)) - backend = GlobalBackend() + backend = get_backend() backend.platform = platform simulator = NumpyBackend() transpiler = dummy_transpiler(backend) diff --git a/tests/test_task_options.py b/tests/test_task_options.py index f2caafd58..25b477285 100644 --- a/tests/test_task_options.py +++ b/tests/test_task_options.py @@ -4,7 +4,7 @@ import pytest from pytest import approx -from qibo.backends import GlobalBackend, set_backend +from qibo.backends import get_backend, set_backend from qibocal import protocols from qibocal.auto.mode import AUTOCALIBRATION, ExecutionMode @@ -20,7 +20,7 @@ @pytest.fixture(scope="module") def platform(): set_backend(backend="qibolab", platform="dummy") - return GlobalBackend().platform + return get_backend().platform TARGETS = [0, 1, 2] @@ -107,7 +107,7 @@ def test_update_argument(platform, global_update, local_update, tmp_path): NEW_CARD = modify_card( UPDATE_CARD, local_update=local_update, global_update=global_update ) - # platform = deepcopy(GlobalBackend().platform) + # platform = deepcopy(get_backend().platform) old_readout_frequency = platform.qubits[0].readout_frequency old_iq_angle = platform.qubits[1].iq_angle Runcard.load(NEW_CARD).run( diff --git a/tests/test_transpile.py b/tests/test_transpile.py index 499ac9d28..d9f953796 100644 --- a/tests/test_transpile.py +++ b/tests/test_transpile.py @@ -1,6 +1,6 @@ import numpy as np from qibo import Circuit, gates, set_backend -from qibo.backends import GlobalBackend +from qibo.backends import get_backend from qibocal.auto.transpile import ( dummy_transpiler, @@ -30,7 +30,7 @@ def test_execute_transpiled_circuit(): circuit.add(gates.X(1)) qubit_map = [1, 2] set_backend("qibolab", platform="dummy") - backend = GlobalBackend() + backend = get_backend() transpiler = dummy_transpiler(backend) transpiled_circuit, _ = execute_transpiled_circuit( circuit, qubit_map, backend, transpiler=transpiler @@ -52,7 +52,7 @@ def test_execute_transpiled_circuits(): circuit.add(gates.X(1)) qubit_map = [1, 2] set_backend("qibolab", platform="dummy") - backend = GlobalBackend() + backend = get_backend() transpiler = dummy_transpiler(backend) transpiled_circuits, _ = execute_transpiled_circuits( [circuit], [qubit_map], backend, transpiler=transpiler