SampledPulse

Contents

SampledPulse#

torchsim.SampledPulse(waveform_rad_per_s, dwell_s, *, phase_rad=0.0, offset_hz=0.0, definition_id=0, shim_id=0)[source]#

Return a pulse played as one hard pulse per sample, with free precession between.

Each sample of the waveform turns the magnetization through its own area at the middle of its dwell, and between two samples the magnetization precesses at each pool’s own frequency, relaxes and exchanges. This is the hard-pulse approximation [1], second order in the dwell with the turns centred; it is what a pulse needs whenever relaxation or exchange during it matters, a saturation pulse above all, which an instantaneous rotation leaves out.

A real waveform turns through its signed area, so the negative lobes of a sinc turn the other way; a complex one turns about the axis its phase names. Played offset_hz off the centre frequency, the axis advances by -2 pi offset_hz radians per second from the start of the pulse, which puts a voxel whose B0 is the offset on resonance. A phase_rad or offset_hz with one value per train plays one train per value.

Every sample names definition_id, which decides what it deposits in a semisolid pool: the ideal definition deposits nothing, and a rectangular one a dwell long deposits what the sample does. A semisolid pool reads its lineshape at the offset, so a definition other than the ideal one takes a single offset for every train.

Parameters:
  • waveform_rad_per_s (array-like or torch.Tensor) – The nutation rate, gamma times B1, one sample per dwell, in rad/s.

  • dwell_s (float) – How long each sample is held, in seconds.

  • phase_rad (float or torch.Tensor, optional) – The phase the whole pulse is played at.

  • offset_hz (float or torch.Tensor, optional) – How far off the centre frequency the pulse is played.

  • definition_id (int, optional) – The definition and transmit shim every sample names.

  • shim_id (int, optional) – The definition and transmit shim every sample names.

Returns:

The pulse, holding the timeline for every sample’s dwell.

Return type:

Operator

Raises:

ValueError – If the waveform is empty or the dwell is not positive, or if a definition other than the ideal one is played at more than one offset.

References