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. It must either be a scalar or contain a single element.
- width (float or Tensor or None , optional) – The standard deviation of the Gaussian pulse, σ. It must either be a scalar or contain a single element. Defaults to T/10 or (T−tflat)/10 if flat_duration is passed.
- center_time (float or None , optional) – The center of the Gaussian pulse, t0. Defaults to half of the given value of the duration, T/2.
- drag (float or Tensor or None , optional) – The DRAG parameter, β. If passed, it must either be a scalar or contain a single element. Defaults to no DRAG correction.
- flat_duration (float or None , optional) – The amount of time to remain constant after the peak of the Gaussian, tflat. If passed, it must be positive and less than the duration. Defaults to None, in which case no constant part is added to the Gaussian pulse.
- 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. If one is passed, the flat part of the pulse is described by one or two segments (depending on the values of center_time and segment_count), and the rest of the pulse is sampled with the remaining segments.
Return type
SEE ALSO
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
Gaussian(t)=⎩⎨⎧A(1−σ2iβ(t−t1))exp(−2σ2(t−t1)2)AA(1−σ2iβ(t−t2))exp(−2σ2(t−t2)2)ift<t1=t0−tflat/2ift0−tflat/2≤t<t0+tflat/2ift>t2=t0+tflat/2.If the flat duration is zero (the default setting), this reduces to
Gaussian(t)=A(1−σ2iβ(t−t0))exp(−2σ2(t−t0)2).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=()>