Skip to content

Commit

Permalink
removing jit since we don't want to vmap over anything that is jitted
Browse files Browse the repository at this point in the history
  • Loading branch information
Phionx committed Jul 31, 2024
1 parent 8f2ed4f commit ad05352
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions qcsys/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

from scipy.special import pbdv
from scipy import constants
from jax import jit, vmap, grad
from jax import vmap, grad

import jax.scipy as jsp

@jit
def factorial_approx(n):
return jsp.special.gamma(n+1)

Expand Down
2 changes: 1 addition & 1 deletion qcsys/devices/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Dict, Any

from flax import struct
from jax import tree_util, jit, Array
from jax import tree_util, Array
from jax import config
import jax.numpy as jnp

Expand Down
2 changes: 0 additions & 2 deletions qcsys/devices/squid_transmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import jaxquantum as jqt
import jax.numpy as jnp
import jax.scipy as jsp
from jax import jit

from qcsys.devices.base import Device

Expand Down Expand Up @@ -125,7 +124,6 @@ def get_H_full(self):
- 2 * self.params["Ej"] * jnp.cos(phi_ext / 2) * self.linear_ops["cos(φ)"]
)

@jit
def get_op_in_H_eigenbasis(self, op):
"""
We overwrite this function to effectively truncate to the first N levels out of N_max_charge
Expand Down
3 changes: 1 addition & 2 deletions qcsys/devices/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import math

from flax import struct
from jax import jit, vmap, Array
from jax import vmap, Array
from jax import config
import jaxquantum as jqt
import jax.numpy as jnp
Expand All @@ -16,7 +16,6 @@
config.update("jax_enable_x64", True)


@partial(jit, static_argnums=(0,))
def calculate_eig(Ns, H: jqt.Qarray):
N_tot = math.prod(Ns)
edxs = jnp.arange(N_tot)
Expand Down
1 change: 0 additions & 1 deletion qcsys/devices/transmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import jaxquantum as jqt
import jax.numpy as jnp
import jax.scipy as jsp
from jax import jit

from qcsys.devices.base import BasisTypes, FluxDevice, HamiltonianTypes

Expand Down
2 changes: 0 additions & 2 deletions qcsys/devices/transmon_single_charge_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import jaxquantum as jqt
import jax.numpy as jnp
import jax.scipy as jsp
from jax import jit

from qcsys.devices.base import Device

Expand Down Expand Up @@ -110,7 +109,6 @@ def get_H_full(self):
- self.params["Ej"] * self.linear_ops["cos(φ)"]
)

@jit
def get_op_in_H_eigenbasis(self, op):
"""
We overwrite this function to effectively truncate to the first N levels out of N_max_charge
Expand Down
1 change: 0 additions & 1 deletion qcsys/devices/truncated_transmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import jaxquantum as jqt
import jax.numpy as jnp
import jax.scipy as jsp
from jax import jit

from qcsys.devices.base import FluxDevice

Expand Down

0 comments on commit ad05352

Please sign in to comment.