autodeer.pulses

Module Contents

Classes

Pulse

Represents a general experimental pulse.

Detection

Represents a detection pulse.

Delay

DEPRECATION WARNING: THIS WILL BE REMOVED SOON.

RectPulse

Represents a rectangular monochromatic pulse.

GaussianPulse

Represents a Gaussian monochromatic pulse.

FrequencySweptPulse

A general parent class for Frequency Swept Pulses.

HSPulse

Represents a hyperboilc secant frequency-swept pulse.

ChirpPulse

Represents a linear frequency-swept pulse.

SincPulse

Represents a general experimental pulse.

Functions

build_default_pulses([AWG, SPFU, tp])

class autodeer.pulses.Pulse(*, tp, t=None, scale=None, flipangle=None, pcyc=[0], name=None, **kwargs)[source]

Represents a general experimental pulse.

The class for a general pulse.

Parameters:
tpfloat

The pulse length in ns.

scalefloat

The arbitary experimental pulse amplitude, 0-1.

tfloat, optional

The pulse start time in ns.

property bandwidth[source]
property amp_factor[source]

The B1 amplitude factor (nutation frequency) for the pulse in GHz

name[source]
Progression = 'False'[source]
_addPhaseCycle(phases, detections=None)[source]

Adds a phase cycle to the pulse sequence.

Args:

phases (list): List of phases to add to the phase cycle. detections (list, optional): List of detection signs. Defaults to None. If None then all cycles are summed.

Returns:

None

_buildFMAM(func, ax=None)[source]

Builds the amplitude modulation (AM) and frequency modulation (FM) of a given function.

Args:

func: A function that takes in an array of values and returns two arrays, representing the AM and FM of the function.

Returns:

Two arrays representing the AM and FM of the function.

build_shape(ax=None)[source]
build_table()[source]

Builds a table of variables, axes, and UUIDs for all non-static Parameters in the object.

Returns:

dict: A dictionary containing the following keys: “Variable”, “axis”, and “uuid”. The values for each key are lists of the corresponding values for each non-static Parameter.

is_static()[source]

Check if all parameters in the pulse object are static.

Returns:

bool: True if all parameters are static, False otherwise.

isDelayFocused()[source]

Does the pulse contain a specified time, t?

If so then it is not delay focused.

isPulseFocused()[source]

Does the pulse contain a specified time, t?

If so then it is delay focused.

plot(pad=1000)[source]

Plots the time domain representation of this pulse.

Parameters:
padint, optional

The number of zeros to pad the data with, by default 1000

_calc_fft(pad=10000)[source]
exciteprofile(freqs=None, resonator=None)[source]

Excitation profile

Generates the exciatation profiles for this pulse.

This function is ported from EasySpin (https://easyspin.org/easyspin/documentation/sop.html) [1-2], and based upon the method from Gunnar Jeschke, Stefan Pribitzer and Andrin Doll[3].

References:

[1] Stefan Stoll, Arthur Schweiger EasySpin, a comprehensive software package for spectral simulation and analysis in EPR J. Magn. Reson. 178(1), 42-55 (2006)

[2] Stefan Stoll, R. David Britt General and efficient simulation of pulse EPR spectra Phys. Chem. Chem. Phys. 11, 6614-6625 (2009)

[3] Jeschke, G., Pribitzer, S. & DollA. Coherence Transfer by Passage Pulses in Electron Paramagnetic Resonance Spectroscopy. J. Phys. Chem. B 119, 13570-13582 (2015)

Parameters:
freqs: np.ndarray, optional

The frequency axis. Caution: A larger number of points will linearly increase computation time.

resonator: ad.ResonatorProfile, optional
Returns:
Mx: np.ndarray

The magentisation in the X direction.

My: np.ndarray

The magentisation in the Y direction.

Mz: np.ndarray

The magentisation in the Z direction.

plot_fft()[source]
_pcyc_str()[source]
__str__()[source]
copy(clear=False, **kwargs)[source]

Creates a deep-copy of the pulse. I.e. Every parameter object is re-created at another memory space.

Parameter can be chaged at this stage by adding them as keyword- arguments (kwargs).

Returns:
Pulse

A deep copy of the pulse

_to_dict()[source]
_to_json()[source]
save(filename)[source]

Save the Pulse to a JSON file.

Parameters:
filenamestr

Path to the JSON file.

Returns:
None
Raises:
TypeError

If the object cannot be serialized to JSON.

classmethod _from_dict(dct)[source]
classmethod _from_json(JSONstring)[source]
classmethod load(filename)[source]

Load a Pulse object from a JSON file.

Parameters:
filenamestr

Path to the JSON file.

Returns:
objPulse

The Pulse loaded from the JSON file.

Raises:
FileNotFoundError

If the file does not exist.

class autodeer.pulses.Detection(*, tp, t=None, freq=0, **kwargs)[source]

Bases: Pulse

Represents a detection pulse.

A general detection pulse.

Parameters:
tpfloat

The total time of the detection event. The detection event will be symetrical about the centre time.

tfloat, optional

The centre time of the detection event

freq: float, optional

The detection frequency, not all spectrometer support this functionality, by default 0 MHz

scale = 'None'[source]
freq[source]
pcyc = 'None'[source]
class autodeer.pulses.Delay(*, tp, t=None)[source]

Bases: Pulse

DEPRECATION WARNING: THIS WILL BE REMOVED SOON.

Represents a inter-pulse delay pulse.

The class for a general pulse.

Parameters:
tpfloat

The pulse length in ns.

scalefloat

The arbitary experimental pulse amplitude, 0-1.

tfloat, optional

The pulse start time in ns.

tp[source]
pcyc = 'None'[source]
scale = 'None'[source]
class autodeer.pulses.RectPulse(tp=16, freq=0, t=None, flipangle=None, **kwargs)[source]

Bases: Pulse

Represents a rectangular monochromatic pulse.

Parameters:
tpflaot, optional

Pulse Length in ns, by default 16

freqfloat,optional

Frequency in MHz, by default 0

tfloat, optional

Time position in ns, by default None

flipangle_type_, optional

The flip angle in radians, by default None

freq[source]
func(ax)[source]
class autodeer.pulses.GaussianPulse(*, tp=32, FWHM=16, freq=0, **kwargs)[source]

Bases: Pulse

Represents a Gaussian monochromatic pulse.

Represents a Gaussian monochromatic pulse.

Parameters:
tpfloat

Pulse length in ns, by default 128

FWHMfloat,

The full width at half maximum of the pulse

freqfloat, optional

The frequency of the pulse, by default 0

freq[source]
FWHM[source]
func(ax)[source]
class autodeer.pulses.FrequencySweptPulse(*, tp, t=None, scale=None, flipangle=None, pcyc=[0], name=None, **kwargs)[source]

Bases: Pulse

A general parent class for Frequency Swept Pulses.

The class for a general pulse.

Parameters:
tpfloat

The pulse length in ns.

scalefloat

The arbitary experimental pulse amplitude, 0-1.

tfloat, optional

The pulse start time in ns.

property Qcrit[source]

The critical Q factor for the pulse.

abstract property sweeprate[source]

The sweep rate of the pulse in GHz/ns

property amp_factor[source]

The B1 amplitude factor (nutation frequency) for the pulse in GHz

class autodeer.pulses.HSPulse(*, tp=128, order1=1, order2=6, beta=20, **kwargs)[source]

Bases: FrequencySweptPulse

Represents a hyperboilc secant frequency-swept pulse.

The class for a general pulse.

Parameters:
tpfloat

The pulse length in ns.

scalefloat

The arbitary experimental pulse amplitude, 0-1.

tfloat, optional

The pulse start time in ns.

property sweeprate[source]

The sweep rate of the pulse in GHz/ns

order1[source]
order2[source]
beta[source]
func(ax)[source]
class autodeer.pulses.ChirpPulse(*, tp=128, **kwargs)[source]

Bases: FrequencySweptPulse

Represents a linear frequency-swept pulse.

The class for a general pulse.

Parameters:
tpfloat

The pulse length in ns.

scalefloat

The arbitary experimental pulse amplitude, 0-1.

tfloat, optional

The pulse start time in ns.

property sweeprate[source]

The sweep rate of the pulse in GHz/ns

func(ax)[source]
class autodeer.pulses.SincPulse(*, tp=128, freq=0, order=6, window=None, **kwargs)[source]

Bases: Pulse

Represents a general experimental pulse.

Represents a sinc shaped monochromatic pulse.

Parameters:
tpint

Pulse length in ns, by default 128

freqint, optional

The frequency of the pulse, by default 0

orderint, optional

The order of this sinc function, by default 6

window_type_, optional

The window function, by default None

freq[source]
order[source]
window[source]
func(ax)[source]
autodeer.pulses.build_default_pulses(AWG=True, SPFU=False, tp=12)[source]