pyepr.sequences.TWTProfileSequence

class pyepr.sequences.TWTProfileSequence(*, B, freq, reptime, averages=1, shots=100, dtp=2, **kwargs)[source]

Bases: Sequence

Builds TWT based Resonator Profile sequence.

Build a TWT profile sequence, a nutation experiment where both the length and the amplitude scale of the nutating pulse are varied. This is used to characterise the (non-)linearity of the TWT amplifier.

Sequence: [p_{nut}(t_p, scale) - tau_1 - pi/2 - tau_2 - pi - tau_2 - echo]

Parameters:
Bint or float

The B0 field, in Gauss

freqint or float

The freq frequency in GHz

reptime_type_

The shot repetition time in us

averagesint, optional

The number of scans, by default 1

shotsint, optional

The number of shots per point, by default 100

dtpfloat, optional

The time step for the test pulse in ns, by default 2 ns

Examples

import pyepr as epr
import numpy as np
epr.set_waveform_precision(1)

seq = epr.TWTProfileSequence(
    B=12000, freq=34, reptime=3e3, averages=1, shots=10, dtp=2)
seq.draw()

(Source code, png)

../../../_images/TWTProfileSequence-11.png

Attributes

kwargs: dict

Keyword arguments

dtp: pyepr.classes.Parameter

Time step for the test pulse

Methods

simulate(nu1=75, damping=0.06, sat=None)[source]

Simulates the TWT profile as damped nutations, where the nutation frequency is proportional to the amplitude scale of the test pulse.

An optional saturation of the amplifier can be included, in which case the nutation frequency follows a hyperbolic tangent of the scale.

\nu_1(s) = \nu_{1,max} \frac{\tanh(s/s_{sat})}{\tanh(1/s_{sat})}

Parameters:
nu1float

The nutation frequency at full scale (scale=1) in MHz, by default 75 MHz

dampingfloat

The damping factor of the nutations, by default 0.06

satfloat, optional

The saturation scale of the amplifier. If None the amplifier is assumed to be linear, by default None

Returns:
axeslist[np.ndarray]

The test pulse length axis in ns and the amplitude scale axis

datanp.ndarray

The simulated nutation data, with shape (len(tp), len(scale))

Examples

import matplotlib.pyplot as plt
import pyepr as epr
epr.set_waveform_precision(1)

seq = epr.TWTProfileSequence(
    B=12000, freq=34, reptime=3e3, averages=1, shots=10, dtp=2)
[tp, scale], data = seq.simulate(nu1=75, sat=0.5)
plt.pcolormesh(scale, tp, data.real, shading='auto')
plt.xlabel("Amplitude Scale")
plt.ylabel("Test Pulse Length (ns)")

(Source code, png)

../../../_images/TWTProfileSequence-21.png