From 219db624e9e124df51e2763b11b44d87ba98b2a3 Mon Sep 17 00:00:00 2001 From: MatteoRobbiati Date: Thu, 10 Aug 2023 17:41:17 +0200 Subject: [PATCH] restore append in overlapo with density mode and added pragma --- src/qibo/callbacks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qibo/callbacks.py b/src/qibo/callbacks.py index 4a8553f485..f68e8d2312 100644 --- a/src/qibo/callbacks.py +++ b/src/qibo/callbacks.py @@ -206,8 +206,10 @@ def apply(self, backend, state): self.append(overlap) return overlap - def apply_density_matrix(self, backend, state): - return backend.calculate_overlap_density_matrix(self.state, state) + def apply_density_matrix(self, backend, state): # pragma: no cover + overlap = backend.calculate_overlap_density_matrix(self.state, state) + self.append(overlap) + return overlap class Energy(Callback):