From 148edc0a9b6fc151eeac7d3d20d5ba1139afccf3 Mon Sep 17 00:00:00 2001 From: Clara Fontaine <42681983+clarayfontaine@users.noreply.github.com> Date: Wed, 26 Apr 2023 04:20:00 +0800 Subject: [PATCH] Correctly select a few modes in analyze_variation (#149) * Fix mode selection in analyze_variation Addressing issue #148: analyze_variation incorrectly chooses Pj, Sj, Om, PHI_zpf when passed a subset of modes * Remove redundant frequency selection The frequencies are already correctly selected outside of this if-statement, so this is not necessary --- pyEPR/core_quantum_analysis.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyEPR/core_quantum_analysis.py b/pyEPR/core_quantum_analysis.py index 3b9b5af..1b936c5 100644 --- a/pyEPR/core_quantum_analysis.py +++ b/pyEPR/core_quantum_analysis.py @@ -664,11 +664,10 @@ def analyze_variation(self, PJ_cap = PJ_cap[:, junctions] if modes is not None: - freqs_hfss = freqs_hfss[range(len(self.modes[variation])), ] - PJ = PJ[range(len(modes)), :] - SJ = SJ[range(len(modes)), :] - Om = Om[range(len(modes)), :][:, range(len(modes))] - PHI_zpf = PHI_zpf[range(len(modes)), :] + PJ = PJ[modes, :] + SJ = SJ[modes, :] + Om = Om[modes, :][:, modes] + PHI_zpf = PHI_zpf[modes, :] PJ_cap = PJ_cap[:, junctions] # Analytic 4-th order