From 60adc077b1dcc32dcb5da09eeacadaed5c881173 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Tue, 22 Feb 2022 10:27:25 +0100 Subject: [PATCH] support zero interactions --- two_qubit_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/two_qubit_model.py b/two_qubit_model.py index d2729c4..ca986c1 100644 --- a/two_qubit_model.py +++ b/two_qubit_model.py @@ -202,7 +202,9 @@ class TwoQubitModel: """The inter-qubit interaction hamiltonian.""" interaction = self.bare_interaction - interaction *= self.γ / (2 * max(interaction.eigenenergies())) + + norm = max(interaction.eigenenergies()) + interaction *= self.γ / (2 * norm) if norm > 0 else 0 return interaction