doc: improve docstrings related to TensorNetworkResult

This commit is contained in:
MatteoRobbiati
2025-02-10 12:17:37 +01:00
parent 30c3bba23a
commit 97d2c79300
2 changed files with 17 additions and 4 deletions

View File

@@ -126,9 +126,6 @@ class QMatchaTeaBackend(QibotnBackend, NumpyBackend):
prob_type = "U"
prob_kwargs = {"num_samples": 500}
# To be sure the setup is correct and no modifications have been done
self._setup_qmatchatea_backend()
# TODO: check
circuit = self._qibocirc_to_qiskitcirc(circuit)
run_qk_params = qmatchatea.preprocessing.qk_transpilation_params(False)
@@ -189,7 +186,9 @@ class QMatchaTeaBackend(QibotnBackend, NumpyBackend):
(e.g., `X(0)*Y(1)` or `Z(0)*Z(1) + 1.5*Y(2)`).
Returns:
qmatchatea.SimulationResult [TEMPORARY]
qibotn.TensorNetworkResult class, providing methods to retrieve
probabilities, frequencies and state always according to the chosen
simulation setup.
"""
# From Qibo to Qiskit

View File

@@ -10,6 +10,20 @@ from qibotn.backends.abstract import QibotnBackend
@dataclass
class TensorNetworkResult:
"""
Object to store and process the output of a Tensor Network simulation of a quantum circuit.
Args:
nqubits (int): number of qubits involved in the simulation;
backend (QibotnBackend): specific backend on which the simulation has been performed;
measures (dict): measures (if performed) during the tensor network simulation;
measured_probabilities (Union[dict, ndarray]): probabilities of the final state
according to the simulation;
prob_type (str): string identifying the method used to compute the probabilities.
Especially useful in case the `QmatchateaBackend` is selected.
statevector (ndarray): if computed, the reconstructed statevector.
"""
nqubits: int
backend: QibotnBackend
measures: dict