Coverage for jaxquantum/devices/superconducting/tunable_transmon.py: 0%
15 statements
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-17 21:51 +0000
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-17 21:51 +0000
1"""Tunable Transmon."""
3from flax import struct
4from jax import config
5import jax.numpy as jnp
7from jaxquantum.devices.superconducting.transmon import Transmon
9config.update("jax_enable_x64", True)
12@struct.dataclass
13class TunableTransmon(Transmon):
14 """
15 Tunable Transmon Device.
16 """
18 @property
19 def Ej(self):
20 Ejsum = self.params["Ej1"] + self.params["Ej2"]
21 phi_ext = 2 * jnp.pi * self.params["phi_ext"]
22 gamma = self.params["Ej2"] / self.params["Ej1"]
23 d = (gamma - 1) / (gamma + 1)
24 external_flux_factor = jnp.abs(
25 jnp.sqrt(jnp.cos(phi_ext / 2) ** 2 + d**2 * jnp.sin(phi_ext / 2) ** 2)
26 )
27 return Ejsum * external_flux_factor