Skip to content

Commit

Permalink
fix: Change exponential parameters units, from samples to duration
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Mar 30, 2024
1 parent 2b5fcde commit 6faa495
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/qibolab/pulses/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,24 @@ class Exponential(BaseEnvelope):
kind: Literal["exponential"] = "exponential"

tau: float
"""The decay rate of the first exponential function."""
"""The decay rate of the first exponential function.
In units of the interval duration.
"""
upsilon: float
"""The decay rate of the second exponential function."""
"""The decay rate of the second exponential function.
In units of the interval duration.
"""
g: float = 0.1
"""Weight of the second exponential function."""

def i(self, samples: int) -> Waveform:
"""Generate a combination of two exponential decays."""
x = np.arange(samples)
return (np.exp(-x / self.upsilon) + self.g * np.exp(-x / self.tau)) / (
1 + self.g
)
upsilon = self.upsilon * samples
tau = self.tau * samples
return (np.exp(-x / upsilon) + self.g * np.exp(-x / tau)) / (1 + self.g)


def _samples_sigma(rel_sigma: float, samples: int) -> float:
Expand Down Expand Up @@ -244,6 +250,7 @@ class Snz(BaseEnvelope):
kind: Literal["snz"] = "snz"

t_idling: float
"""Fraction of interval where idling."""
b_amplitude: float = 0.5
"""Relative B amplitude (wrt A)."""

Expand Down Expand Up @@ -278,6 +285,7 @@ class ECap(BaseEnvelope):
kind: Literal["ecap"] = "ecap"

alpha: float
"""In units of the inverse interval duration."""

def i(self, samples: int) -> Waveform:
""".. todo::"""
Expand Down

0 comments on commit 6faa495

Please sign in to comment.