refactor: make QibotnBackend abstract and inherit both this and NumpyBackend in Qibotn concrete backends

This commit is contained in:
MatteoRobbiati
2025-02-10 10:49:30 +01:00
parent d854d15068
commit a5f7d1fb14
4 changed files with 10 additions and 17 deletions

View File

@@ -1,20 +1,11 @@
from qibo.backends.numpy import NumpyBackend
from abc import ABC
from qibo.config import raise_error
DEFAULT_CONFIGURATION = {
"MPI_enabled": False, # TODO: cutensornet specific, TBRemoved
"NCCL_enabled": False, # TODO: cutensornet specific, TBRemoved
"expectation_enabled": False,
"pauli_string_pattern": None,
"MPS_enabled": False,
"gate_algo": None,
"mps_opts": None,
}
class QibotnBackend(ABC):
class QibotnBackend(NumpyBackend):
def __init__(self, runcard: dict = DEFAULT_CONFIGURATION):
def __init__(self):
super().__init__()
def apply_gate(self, gate, state, nqubits): # pragma: no cover
@@ -33,7 +24,6 @@ class QibotnBackend(NumpyBackend):
def set_device(self, device):
self.device = device
# @abstractmethod
def configure_tn_simulation(self, **config):
"""Configure the TN simulation that will be performed."""
pass