From 6a8abdff4b87bf2a72e9d46d85ed7bf025bf752b Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:20:40 +0400 Subject: [PATCH] Copy Hamiltonian ground state before passing to adiabatic evolution --- src/qibo/models/evolution.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qibo/models/evolution.py b/src/qibo/models/evolution.py index 58e35322ff..42c43be240 100644 --- a/src/qibo/models/evolution.py +++ b/src/qibo/models/evolution.py @@ -236,7 +236,9 @@ def execute(self, final_time, start_time=0.0, initial_state=None): ) self.hamiltonian.total_time = final_time - start_time if initial_state is None: - initial_state = self.hamiltonian.ground_state() + initial_state = self.backend.cast( + self.hamiltonian.ground_state(), copy=True + ) return super().execute(final_time, start_time, initial_state) @staticmethod