35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
---
|
||
title: cos
|
||
description: API reference for qiskit.pulse.library.cos
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: function
|
||
python_api_name: qiskit.pulse.library.cos
|
||
---
|
||
|
||
<span id="qiskit-pulse-library-cos" />
|
||
|
||
# qiskit.pulse.library.cos
|
||
|
||
<Function id="qiskit.pulse.library.cos" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/pulse/library/discrete.py" signature="cos(duration, amp, freq=None, phase=0, name=None)">
|
||
Generates cosine wave [`Waveform`](qiskit.pulse.library.Waveform "qiskit.pulse.library.Waveform").
|
||
|
||
For $A=$ `amp`, $\omega=$ `freq`, and $\phi=$ `phase`, applies the midpoint sampling strategy to generate a discrete pulse sampled from the continuous function:
|
||
|
||
$$
|
||
f(x) = A \cos(2 \pi \omega x + \phi)
|
||
$$
|
||
|
||
**Parameters**
|
||
|
||
* **duration** (*int*) – Duration of pulse. Must be greater than zero.
|
||
* **amp** (*complex*) – Pulse amplitude.
|
||
* **freq** (*float | None*) – Pulse frequency, units of 1/dt. If `None` defaults to single cycle.
|
||
* **phase** (*float*) – Pulse phase.
|
||
* **name** (*str | None*) – Name of pulse.
|
||
|
||
**Return type**
|
||
|
||
[*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform")
|
||
</Function>
|
||
|