sech_pulse_stf

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

sech_pulse_stf(amplitude, width, center_time)

Create an Stf representing a hyperbolic secant pulse.

Parameters
  • amplitude (float or complex or Tensor) – The amplitude of the pulse, \(A\). It must either be a scalar or contain a single element.

  • width (float or Tensor) – The characteristic time for the hyperbolic secant pulse, \(t_\mathrm{pulse}\). It must either be a scalar or contain a single element.

  • center_time (float or Tensor) – The time at which the pulse peaks, \(t_\mathrm{peak}\). It must either be a scalar or contain a single element.

Returns

The sampleable hyperbolic secant pulse.

Return type

Stf

See also

pulses.gaussian_pulse_stf()

Create an Stf representing a Gaussian pulse.

pulses.sech_pulse()

Function to create a Pulse object representing a hyperbolic secant pulse.

pulses.sech_pulse_pwc()

Corresponding operation with Pwc output.

Notes

The hyperbolic secant pulse is defined as

\[\mathop{\mathrm{Sech}}(t) = \frac{A}{\cosh\left((t - t_\mathrm{peak}) / t_\mathrm{pulse} \right)} .\]

The full width at half maximum of the pulse is about \(2.634 t_\mathrm{pulse}\).

Examples

Define a sampleable sech pulse.

>>> sech = graph.pulses.sech_pulse_stf(
...     amplitude=1.0, width=0.1, center_time=0.5
... )
>>> sech
<Stf: operation_name="truediv", value_shape=(), batch_shape=()>
>>> graph.sample_stf(stf=sech, sample_times=np.linspace(0, 1, 5), name="sech_samples")
<Tensor: name="sech_samples", operation_name="sample_stf", shape=(5,)>
>>> graph.discretize_stf(stf=sech, duration=1.2, segment_count=100, name="discretized_sech")
<Pwc: name="discretized_sech", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(
...     graph=graph, output_node_names=["sech_samples", "discretized_sech"]
... )
>>> result.output["sech_samples"]["value"]
array([0.013, 0.163, 1.000, 0.163, 0.013])

Define a sampleable sech 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"
... )
>>> graph.pulses.sech_pulse_stf(
...     amplitude=amplitude, width=width, center_time=center_time
... )
<Stf: operation_name="truediv", value_shape=(), batch_shape=()>