gaussian_pulse_pwc

The Boulder Opal Toolkits are currently in beta phase of development. Breaking changes may be introduced.

gaussian_pulse_pwc(duration, segment_count, amplitude, width=None, center_time=None, drag=None, flat_duration=None, segmentation='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, 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\) if flat_duration is passed.

  • center_time (float, 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, optional) – The DRAG parameter, \(\beta\). If passed, it must either be a scalar or contain a single element. Defaults to no DRAG correction.

  • flat_duration (float, optional) – The amount of time to remain constant after the peak of the Gaussian, \(t_\mathrm{flat}\). 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, 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

Pwc

See also

signals.cosine_pulse_pwc()

Create a Pwc representing a cosine pulse.

signals.gaussian_pulse_stf()

Corresponding operation with Stf output.

signals.sech_pulse_pwc()

Create a Pwc representing a hyperbolic secant pulse.

signals.square_pulse_pwc()

Create a Pwc representing a square pulse.

Notes

The Gaussian pulse is defined as

\[\begin{split}\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} .\end{split}\]

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 = qctrl.functions.calculate_graph(graph=graph, output_node_names=["gaussian"])
>>> result.output["gaussian"]
[
    {'duration': 0.03, 'value': 4.7791e-06},
    {'duration': 0.03, 'value': 7.8010e-06},
    ...
    {'duration': 0.03, 'value': 7.8010e-06},
    {'duration': 0.03, 'value': 4.7791e-06}
]

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="gaussian_drag",
... )
<Pwc: name="gaussian_drag", operation_name="time_concatenate_pwc", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["gaussian_drag"])
>>> result.output["gaussian_drag"]
[
    {'duration': 0.0285, 'value': (3.7655e-11+1.3044e-10j)},
    {'duration': 0.0285, 'value': (1.0028e-10+3.4026e-10j)},
    ...
    {'duration': 0.0285, 'value': (1.0028e-10-3.4026e-10j)},
    {'duration': 0.0285, 'value': (3.7655e-11-1.3044e-10j)}
]

Define a Gaussian pulse with optimizable parameters.

>>> amplitude = graph.optimization_variable(
...     count=1, lower_bound=0, upper_bound=2.*np.pi, name="amplitude"
... )
>>> width = graph.optimization_variable(
...     count=1, lower_bound=0.1, upper_bound=2., name="width"
... )
>>> drag = graph.optimization_variable(
...     count=1, 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=()>