# gaussian_pulse_pwc

signals.gaussian_pulse_pwc(duration, segment_count, amplitude, width=None, center_time=None, drag=None, flat_duration=None, segmentation=SegmentationType.UNIFORM, *, name=None)

Create a Pwc representing a Gaussian pulse.

### Parameters

• duration (float) – The duration of the signal, $T$
• segment_count (int) – The number of segments in the PWC. Must be at least four.
• amplitude (float or complex or Tensor) – The amplitude of the Gaussian pulse, $A$
• width (float or Tensor or None , optional) – The standard deviation of the Gaussian pulse, $\sigma$. It must either be a scalar or contain a single element. Defaults to $T/10$ or $(T-t_\mathrm{flat})/10$
• center_time (float or None , optional) – The center of the Gaussian pulse, $t_0$. Defaults to half of the given value of the duration, $T/2$
• drag (float or Tensor or None , optional) – The DRAG parameter, $\beta$
• flat_duration (float or None , optional) – The amount of time to remain constant after the peak of the Gaussian, $t_\mathrm{flat}$
• segmentation (SegmentationType) – The type of segmentation for the signal. With a “MINIMAL” segmentation, most of the segments are placed in the non-constant parts of the signal. Defaults to “UNIFORM”, in which case the segments are uniformly distributed along the signal’s duration.
• name (str or None , optional) – The name of the node.

### Returns

The sampled Gaussian pulse. If no flat duration is passed then the pulse is evenly sampled between $0$ and $T$

### Return type

Pwc

Graph.signals.cosine_pulse_pwc : Create a Pwc representing a cosine pulse.

Graph.signals.gaussian_pulse_stf : Corresponding operation with Stf output.

Graph.signals.sech_pulse_pwc : Create a Pwc representing a hyperbolic secant pulse.

Graph.signals.square_pulse_pwc : Create a Pwc representing a square pulse.

## Notes

The Gaussian pulse is defined as

$\mathop{\mathrm{Gaussian}}(t) = \begin{cases} A \left(1-\frac{i\beta (t-t_1)}{\sigma^2}\right) \exp \left(- \frac{(t-t_1)^2}{2\sigma^2} \right) &\mathrm{if} \quad t < t_1=t_0- t_\mathrm{flat}/2\\ A &\mathrm{if} \quad t_0-t_\mathrm{flat}/2 \le t < t_0+t_\mathrm{flat}/2 \\ A \left(1-\frac{i\beta (t-t_2)}{\sigma^2}\right) \exp \left(- \frac{(t-t_2)^2}{2\sigma^2} \right) &\mathrm{if} \quad t > t_2=t_0+t_\mathrm{flat}/2 \end{cases} .$

If the flat duration is zero (the default setting), this reduces to

$\mathop{\mathrm{Gaussian}}(t) = A \left(1-\frac{i\beta (t-t_0)}{\sigma^2}\right) \exp \left(- \frac{(t-t_0)^2}{2\sigma^2} \right) .$

## Examples

Define a Gaussian PWC pulse.

>>> graph.signals.gaussian_pulse_pwc(
...     duration=3.0,
...     segment_count=100,
...     amplitude=1.0,
...     name="gaussian",
... )
<Pwc: name="gaussian", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = bo.execute_graph(graph=graph, output_node_names="gaussian")
>>> result["output"]["gaussian"]
{
'durations': array([0.03, 0.03, ..., 0.03, 0.03]),
'values': array([4.77913973e-06, 7.80106730e-06, ..., 7.80106730e-06, 4.77913973e-06]),
'time_dimension': 0
}

Define a flat-top Gaussian PWC pulse with a DRAG correction with minimal segmentation.

>>> graph.signals.gaussian_pulse_pwc(
...     duration=3.0,
...     segment_count=100,
...     amplitude=1.0,
...     width=0.2,
...     center_time=1.5,
...     drag=0.1,
...     flat_duration=0.2,
...     segmentation="MINIMAL",
...     name="drag",
... )
<Pwc: name="drag", operation_name="time_concatenate_pwc", value_shape=(), batch_shape=()>
>>> result = bo.execute_graph(graph=graph, output_node_names="gaussian_drag")
>>> result["output"]["gaussian_drag"]
{
'durations': array([0.02857143, 0.02857143, ..., 0.02857143, 0.02857143]),
'values': array([3.76551948e-11+1.30448351e-10j, 1.00289674e-10+3.40268532e-10j, ...,
1.00289593e-10-3.40268262e-10j, 3.76551637e-11-1.30448246e-10j]),
'time_dimension': 0
}

Define a Gaussian pulse with optimizable parameters.

>>> amplitude = graph.optimizable_scalar(
...     lower_bound=0, upper_bound=2.*np.pi, name="amplitude"
... )
>>> width = graph.optimizable_scalar(
...     lower_bound=0.1, upper_bound=2., name="width"
... )
>>> drag = graph.optimizable_scalar(
...     lower_bound=0, upper_bound=1., name="drag"
... )
>>> graph.signals.gaussian_pulse_pwc(
...     duration=3.0,
...     segment_count=100,
...     amplitude=amplitude,
...     width=width,
...     drag=drag,
...     name="gaussian",
... )
<Pwc: name="gaussian", operation_name="discretize_stf", value_shape=(), batch_shape=()>