From f34fd1ab092dde2b314ce59bdea270c79042be16 Mon Sep 17 00:00:00 2001 From: Hamsatz Date: Tue, 14 May 2024 07:55:17 +0200 Subject: [PATCH] Cleaning a bit the result.py file. --- mpqp/execution/result.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mpqp/execution/result.py b/mpqp/execution/result.py index e71777d3..5f42cf89 100644 --- a/mpqp/execution/result.py +++ b/mpqp/execution/result.py @@ -58,7 +58,6 @@ def amplitudes(self): """Return the amplitudes of the state vector""" return self.vector - def __str__(self): return f""" State vector: {clean_array(self.vector)} Probabilities: {clean_array(self.probabilities)} @@ -66,7 +65,6 @@ def __str__(self): """ - @typechecked class Sample: """Class representing a sample, which contains the result of the experiment @@ -434,7 +432,9 @@ def __repr__(self): def __getitem__(self, index: int): return self.results[index] -def clean_array(array): # type: ignore + +def clean_array(array) -> str: + """TODO: doc""" try: cleaned_array = [] for element in array: @@ -443,4 +443,4 @@ def clean_array(array): # type: ignore cleaned_array.append(cleaned_element) return str(cleaned_array).replace("(", "").replace(")", "") except: - return str(array) \ No newline at end of file + return str(array)