diff --git a/qcsys/devices/ats.py b/qcsys/devices/ats.py index a893565..893c27f 100644 --- a/qcsys/devices/ats.py +++ b/qcsys/devices/ats.py @@ -24,6 +24,7 @@ def common_ops(self): ops["a"] = jqt.destroy(N) ops["a_dag"] = jqt.create(N) ops["phi"] = self.phi_zpf()*(ops["a"] + ops["a_dag"]) + ops["n"] = 1j * self.n_zpf() * (ops["a_dag"] - ops["a"]) return ops def phi_zpf(self): diff --git a/tutorials/ats-coupler/0-resonator-ats-resonator.ipynb b/tutorials/ats-coupler/0-resonator-ats-resonator.ipynb index 214137e..67d0de1 100644 --- a/tutorials/ats-coupler/0-resonator-ats-resonator.ipynb +++ b/tutorials/ats-coupler/0-resonator-ats-resonator.ipynb @@ -33,35 +33,73 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'g_ex': Array(-0.00212182+0.j, dtype=complex128),\n", + " 'ω_ATS': Array(6.02181564, dtype=float64),\n", + " 'ω_ResonatorA': Array(4.99584201, dtype=float64),\n", + " 'ω_ResonatorB': Array(7.00151547, dtype=float64)}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# system, ϕ0, metrics0, system0 = get_system_normal_rar({})\n", - "ϕ0, metrics0, system0 = get_metrics_linear_rar({})" + "ϕ0, metrics0, system0 = get_metrics_linear_rar({})\n", + "metrics0" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'g_ex': Array(-0.00212182+0.j, dtype=complex128),\n", - " 'ω_ATS': Array(6.02181564, dtype=float64),\n", - " 'ω_ResonatorA': Array(4.99584201, dtype=float64),\n", - " 'ω_ResonatorB': Array(7.00151547, dtype=float64)}" + "Array([ 0.00000000e+00, -3.55271368e-06, 3.55271368e-06, -3.55271368e-06,\n", + " -1.06581410e-05, 2.13162821e-05], dtype=float64)" ] }, - "execution_count": 10, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "metrics0" + "metrics, system, ϕ0, metrics0, system0 = get_metrics_normal_rar({})#{\"ResonatorA_frequency\": 3})\n", + "metrics[\"K_a\"]*1e9" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Array([-2.14061657e-01, -2.14015472e-01, -2.14154028e-01, -2.11546336e-01,\n", + " -4.03521234e+01, 1.18006174e+05], dtype=float64)" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "metrics, system, ϕ0, metrics0, system0 = get_metrics_normal_rar({\n", + " \"ATS__dE_J\": 37.0 * 0.01\n", + "})\n", + "metrics[\"K_a\"]*1e9" ] } ], diff --git a/tutorials/ats-coupler/rar_helpers.py b/tutorials/ats-coupler/rar_helpers.py index 4f04fb1..07722d5 100644 --- a/tutorials/ats-coupler/rar_helpers.py +++ b/tutorials/ats-coupler/rar_helpers.py @@ -254,4 +254,29 @@ def get_system_normal_rar(params): system = qs.System.create(devices, couplings=couplings) system.params["phi_c"] = phi_c system.params["phi_c_alternative"] = phi_c_alternative - return system, ϕ0, metrics0, system0 \ No newline at end of file + return system, ϕ0, metrics0, system0 + +@jit +def get_metrics_normal_rar(params): + """set up devices""" + system, ϕ0, metrics0, system0 = get_system_normal_rar(params) + a_indx = 2 + c_indx = 1 + b_indx = 0 + + epsilon_p = params.get("ATS__drive_strength", DRIVE_STRENGTH) + + resonator_a = system.devices[a_indx] + ats = system.devices[c_indx] + resonator_b = system.devices[b_indx] + + Es, kets = system.calculate_eig() + + n_ats = 0 + K_a = (Es[2:, n_ats, 0] - Es[1:-1, n_ats, 0]) - ( + Es[1:-1, n_ats, 0] - Es[0:-2, n_ats, 0] + ) + metrics = {} + metrics["K_a"] = K_a + + return metrics, system, ϕ0, metrics0, system0 \ No newline at end of file