From 9502b1aa3f23b849978ccf23fd4c23bf9fcc947c Mon Sep 17 00:00:00 2001 From: positr0nium Date: Thu, 22 Feb 2024 17:00:17 +0100 Subject: [PATCH] fixed a minor bug that caused the statevector simulator to output a faulty global phase in some situtations --- src/qrisp/simulator/tensor_factor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qrisp/simulator/tensor_factor.py b/src/qrisp/simulator/tensor_factor.py index 9110431b..a182071b 100644 --- a/src/qrisp/simulator/tensor_factor.py +++ b/src/qrisp/simulator/tensor_factor.py @@ -204,6 +204,8 @@ def multi_measure(self, mes_qubits, return_res_tf = True): return p_list, tf_list, outcome_index_list def disentangle(self, qubit): + if len(self.qubits) == 1: + return self, self # Swap the index that is supposed to be measured to the front index = self.qubits.index(qubit)