gaussian_pulse_stf

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

gaussian_pulse_stf(amplitude, width, center_time, drag=None)

Create an Stf representing a Gaussian pulse.

Parameters
  • 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) – The standard deviation of the Gaussian pulse, \(\sigma\). It must either be a scalar or contain a single element.

  • center_time (float or Tensor) – The center of the Gaussian pulse, \(t_0\). It must either be a scalar or contain a single element.

  • 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.

Returns

The sampleable Gaussian pulse.

Return type

Stf

See also

pulses.gaussian_pulse_pwc()

Corresponding operation with Pwc output.

pulses.sech_pulse_stf()

Create an Stf representing a hyperbolic secant pulse.

Notes

The Gaussian pulse is defined as

\[\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 sampleable Gaussian pulse.

>>> gaussian = graph.pulses.gaussian_pulse_stf(
...     amplitude=1.0, width=0.1, center_time=0.5
... )
>>> gaussian
<Stf: operation_name="multiply", value_shape=(), batch_shape=()>
>>> graph.sample_stf(stf=gaussian, sample_times=np.linspace(0, 1, 5), name="gaussian_samples")
<Tensor: name="gaussian_samples", operation_name="sample_stf", shape=(5,)>
>>> graph.discretize_stf(
... gaussian, duration=1, segment_count=100, name="discretized_gaussian"
... )
<Pwc: name="discretized_gaussian", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(
...     graph=graph, output_node_names=["gaussian_samples", "discretized_gaussian"]
... )
>>> result.output["gaussian_samples"]["value"]
array([3.727e-06, 4.394e-02, 1.000e+00, 4.394e-02, 3.727e-06])

Define a sampleable Gaussian with a DRAG correction.

>>> gaussian = graph.pulses.gaussian_pulse_stf(
...     amplitude=1.0, width=0.1, center_time=0.5, drag=0.2
... )
>>> gaussian
<Stf: operation_name="multiply", value_shape=(), batch_shape=()>
>>> graph.sample_stf(
...     stf=gaussian, sample_times=np.linspace(0, 1, 5), name="drag_gaussian_samples"
... )
<Tensor: name="drag_gaussian_samples", operation_name="sample_stf", shape=(5,)>
>>> graph.discretize_stf(
...     gaussian, duration=1, segment_count=100, name="discretized_drag_gaussian"
... )
<Pwc: name="discretized_drag_gaussian", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(
...     graph=graph, output_node_names=["drag_gaussian_samples", "discretized_drag_gaussian"]
... )
>>> result.output["drag_gaussian_samples"]["value"]
array([
    3.727e-06 + 9.317e-06j,
    4.394e-02 + 5.492e-02j,
    1.000e+00 + 0.000e+00j,
    4.394e-02 - 5.492e-02j,
    3.727e-06 - 9.317e-06j,
])

Define a sampleable 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=0.5, name="width"
... )
>>> center_time = graph.optimization_variable(
...     count=1, lower_bound=0.2, upper_bound=0.8, name="center_time"
... )
>>> drag = graph.optimization_variable(
...     count=1, lower_bound=0, upper_bound=0.5, name="drag"
... )
>>> graph.pulses.gaussian_pulse_stf(
...     amplitude=amplitude, width=width, center_time=center_time, drag=drag
... )
<Stf: operation_name="multiply", value_shape=(), batch_shape=()>