sech_pulse_pwc

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

sech_pulse_pwc(duration, segment_count, amplitude, width=None, center_time=None, *, name=None)

Create a Pwc representing a hyperbolic secant pulse.

Parameters
  • duration (float) – The duration of the signal, \(T\).

  • segment_count (int) – The number of segments in the PWC.

  • 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, optional) – The characteristic time for the hyperbolic secant pulse, \(t_\mathrm{pulse}\). If passed, it must either be a scalar or contain a single element. Defaults to \(T/12\), giving the pulse a full width at half maximum (FWHM) of \(0.22 T\).

  • center_time (float or Tensor, optional) – The time at which the pulse peaks, \(t_\mathrm{peak}\). If passed, it must either be a scalar or contain a single element. Defaults to \(T/2\).

  • name (str, optional) – The name of the node.

Returns

The sampled hyperbolic secant pulse.

Return type

Pwc

See also

pulses.cosine_pulse_pwc()

Create a Pwc representing a cosine pulse.

pulses.gaussian_pulse_pwc()

Create a Pwc representing a Gaussian pulse.

pulses.sech_pulse()

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

pulses.sech_pulse_stf()

Corresponding operation with Stf output.

pulses.square_pulse_pwc()

Create a Pwc representing a square pulse.

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 FWHM of the pulse is about \(2.634 t_\mathrm{pulse}\).

Examples

Define a simple sech PWC pulse.

>>> graph.pulses.sech_pulse_pwc(
...     duration=5, segment_count=50, amplitude=1, name="sech"
... )
<Pwc: name="sech", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["sech"])
>>> result.output["sech"]
[
    {'value': -0.0056, 'duration': 0.1},
    {'value': -0.0071, 'duration': 0.1},
    ...
    {'value': 0.0071, 'duration': 0.1},
    {'value': 0.0056, 'duration': 0.1},
]

Define a displaced sech PWC pulse.

>>> graph.pulses.sech_pulse_pwc(
...     duration=3e-6,
...     segment_count=60,
...     amplitude=20e6,
...     width=0.15e-6,
...     center_time=1e-6,
...     name="sech_displaced",
... )
<Pwc: name="sech_displaced", operation_name="discretize_stf", value_shape=(), batch_shape=()>
>>> result = qctrl.functions.calculate_graph(graph=graph, output_node_names=["sech_displaced"])
>>> result.output["sech_displaced"]
[
    {'value': 60137.43, 'duration': 5.e-08},
    {'value': 83928.37, 'duration': 5.e-08},
    ...
    {'value': 106.8105, 'duration': 5.e-08},
    {'value': 76.53310, 'duration': 5.e-08},
]

Define a sech pulse with optimizable parameters.

>>> amplitude = graph.optimization_variable(
...     count=1, lower_bound=0, upper_bound=10e6, name="amplitude"
... )
>>> width = graph.optimization_variable(
...     count=1, lower_bound=0.1e-6, upper_bound=0.5e-6, name="width"
... )
>>> center_time = graph.optimization_variable(
...     count=1, lower_bound=1e-6, upper_bound=2e-6, name="center_time"
... )
>>> graph.pulses.sech_pulse_pwc(
...     duration=3e-6,
...     segment_count=32,
...     amplitude=amplitude,
...     width=width,
...     center_time=center_time,
...     name="sech_pulse",
... )
<Pwc: name="sech_pulse", operation_name="discretize_stf", value_shape=(), batch_shape=()>