Skip to content

Commit

Permalink
added charge operator to ATS and added to RAR sims
Browse files Browse the repository at this point in the history
  • Loading branch information
Phionx committed Jul 21, 2024
1 parent 3534ea2 commit ff326e6
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 11 deletions.
1 change: 1 addition & 0 deletions qcsys/devices/ats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
58 changes: 48 additions & 10 deletions tutorials/ats-coupler/0-resonator-ats-resonator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
],
Expand Down
27 changes: 26 additions & 1 deletion tutorials/ats-coupler/rar_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit ff326e6

Please sign in to comment.