cosine_pulse
boulderopal.signals.cosine_pulse(duration, amplitude, drag=0.0, start_time=0.0, end_time=None, flat_duration=0.0)
Create a Signal object representing a cosine pulse.
Parameters
- duration (float) – The duration of the pulse.
- amplitude (float or complex) – The amplitude of the pulse, A.
- drag (float , optional) – The DRAG parameter, β. Defaults to 0, in which case there is no DRAG correction.
- start_time (float , optional) – The time at which the cosine pulse starts, tstart. Defaults to 0.
- end_time (float or None , optional) – The time at which the cosine pulse ends, tend. Defaults to the duration.
- flat_duration (float , optional) – The amount of time that the pulse remains constant after the peak of the cosine, tflat. If passed, it must be nonnegative and less than the difference between end_time and start_time. Defaults to 0, in which case no constant part is added to the cosine pulse.
Returns
The cosine pulse.
Return type
SEE ALSO
boulderopal.signals.gaussian_pulse
: Create a Signal object representing a Gaussian pulse.
boulderopal.signals.hann_series
: Create a Signal object representing a sum of Hann window functions.
boulderopal.signals.sech_pulse
: Create a Signal object representing a hyperbolic secant pulse.
boulderopal.signals.sinusoid
: Create a Signal object representing a sinusoidal oscillation.
boulderopal.signals.square_pulse
: Create a Signal object representing a square pulse.
Graph.signals.cosine_pulse_pwc
: Graph operation to create a Pwc representing a cosine pulse.
Notes
The cosine pulse is defined as
Cos(t)=⎩⎨⎧02A[1+cos(ωt−τ−)+iωβsin(ωt−τ−)]A2A[1+cos(ωt−τ+)+iωβsin(ωt−τ+)]0ift<tstartiftstart≤t<τ−ifτ−≤t≤τ+ifτ+<t≤tendift>tend,where ω=2π/(tend−tstart−tflat), τ∓ are the start/end times of the flat segment, with τ∓=(tstart+tend∓tflat)/2.
If the flat duration is zero (the default setting), this reduces to
Cos(t)=2A[1+cos(ωt−τ)+iωβsin(ωt−τ)]θ(t−tstart)θ(tend−t),where now ω=2π/(tend−tstart), τ=(tstart+tend)/2 and θ(t) is the Heaviside step function.
Examples
Define a cosine pulse.
>>> pulse = bo.signals.cosine_pulse(duration=3.0, amplitude=1.0)
>>> pulse.export_with_time_step(time_step=0.5)
array([0.0669873+0.j, 0.5 +0.j, 0.9330127+0.j, 0.9330127+0.j,
0.5 +0.j, 0.0669873+0.j])
Define a flat-top cosine pulse with a DRAG correction.
>>> pulse = bo.signals.cosine_pulse(
... duration=3.0, amplitude=1.0, drag=0.1, flat_duration=0.6
... )
>>> pulse.export_with_sampling_rate(sampling_rate=2.0)
array([0.10332333-0.07968668j, 0.69134172-0.12093555j,
1. +0.j , 1. +0.j ,
0.69134172+0.12093555j, 0.10332333+0.07968668j])