Skip to content

resonator

Resonator.

Resonator

Bases: FluxDevice

Resonator Device.

Source code in jaxquantum/devices/superconducting/resonator.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@struct.dataclass
class Resonator(FluxDevice):
    """
    Resonator Device.
    """

    def common_ops(self):
        """Written in the linear basis."""
        ops = {}

        N = self.N_pre_diag
        ops["id"] = identity(N)
        ops["a"] = destroy(N)
        ops["a_dag"] = 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):
        """Return Phase ZPF."""
        return (2 * self.params["Ec"] / self.params["El"]) ** (0.25)

    def n_zpf(self):
        n_zpf = (self.params["El"] / (32.0 * self.params["Ec"])) ** (0.25)
        return n_zpf

    def get_linear_ω(self):
        """Get frequency of linear terms."""
        return jnp.sqrt(8 * self.params["El"] * self.params["Ec"])

    def get_H_linear(self):
        """Return linear terms in H."""
        w = self.get_linear_ω()
        return w * (self.linear_ops["a_dag"] @ self.linear_ops["a"] + 1 / 2)

    def get_H_full(self):
        """Return full H in linear basis."""
        return self.get_H_linear()

    def potential(self, phi):
        """Return potential energy for a given phi."""
        return 0.5 * self.params["El"] * (2 * jnp.pi * phi) ** 2

common_ops()

Written in the linear basis.

Source code in jaxquantum/devices/superconducting/resonator.py
20
21
22
23
24
25
26
27
28
29
30
31
def common_ops(self):
    """Written in the linear basis."""
    ops = {}

    N = self.N_pre_diag
    ops["id"] = identity(N)
    ops["a"] = destroy(N)
    ops["a_dag"] = 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

get_H_full()

Return full H in linear basis.

Source code in jaxquantum/devices/superconducting/resonator.py
50
51
52
def get_H_full(self):
    """Return full H in linear basis."""
    return self.get_H_linear()

get_H_linear()

Return linear terms in H.

Source code in jaxquantum/devices/superconducting/resonator.py
45
46
47
48
def get_H_linear(self):
    """Return linear terms in H."""
    w = self.get_linear_ω()
    return w * (self.linear_ops["a_dag"] @ self.linear_ops["a"] + 1 / 2)

get_linear_ω()

Get frequency of linear terms.

Source code in jaxquantum/devices/superconducting/resonator.py
41
42
43
def get_linear_ω(self):
    """Get frequency of linear terms."""
    return jnp.sqrt(8 * self.params["El"] * self.params["Ec"])

phi_zpf()

Return Phase ZPF.

Source code in jaxquantum/devices/superconducting/resonator.py
33
34
35
def phi_zpf(self):
    """Return Phase ZPF."""
    return (2 * self.params["Ec"] / self.params["El"]) ** (0.25)

potential(phi)

Return potential energy for a given phi.

Source code in jaxquantum/devices/superconducting/resonator.py
54
55
56
def potential(self, phi):
    """Return potential energy for a given phi."""
    return 0.5 * self.params["El"] * (2 * jnp.pi * phi) ** 2