waveform

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package waveform provides standard pulse envelope shapes for the pulse package.

Five waveform constructors are provided: Constant (flat amplitude), Gaussian (bell curve), DRAG (Derivative Removal by Adiabatic Gate), GaussianSquare (flat-top with Gaussian edges), and Arbitrary (user-provided samples).

Each constructor returns a pulse.Waveform that lazily samples at the requested time resolution. Each also has a Must variant that panics on error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arbitrary

func Arbitrary(samples []complex128, dt float64) (pulse.Waveform, error)

Arbitrary creates a waveform from pre-computed samples at the given dt. The samples slice is defensively copied.

func Constant

func Constant(amplitude complex128, duration float64) (pulse.Waveform, error)

Constant returns a flat-amplitude waveform.

func DRAG

func DRAG(amplitude float64, duration, sigma, beta float64) (pulse.Waveform, error)

DRAG returns a Derivative Removal by Adiabatic Gate (DRAG) waveform. The real part is a Gaussian envelope; the imaginary part is its derivative scaled by beta, which corrects for leakage to non-computational states.

func Gaussian

func Gaussian(amplitude float64, duration, sigma float64) (pulse.Waveform, error)

Gaussian returns a Gaussian-shaped waveform. amplitude is the peak amplitude, duration is the total length in seconds, and sigma is the standard deviation in seconds.

func GaussianSquare

func GaussianSquare(amplitude float64, duration, sigma, width float64) (pulse.Waveform, error)

GaussianSquare returns a Gaussian-square waveform: a flat-top pulse with Gaussian rise and fall edges. width is the flat-top duration in seconds; sigma controls the Gaussian edges.

func MustArbitrary

func MustArbitrary(samples []complex128, dt float64) pulse.Waveform

MustArbitrary is like Arbitrary but panics on error.

func MustConstant

func MustConstant(amplitude complex128, duration float64) pulse.Waveform

MustConstant is like Constant but panics on error.

func MustDRAG

func MustDRAG(amplitude float64, duration, sigma, beta float64) pulse.Waveform

MustDRAG is like DRAG but panics on error.

func MustGaussian

func MustGaussian(amplitude float64, duration, sigma float64) pulse.Waveform

MustGaussian is like Gaussian but panics on error.

func MustGaussianSquare

func MustGaussianSquare(amplitude float64, duration, sigma, width float64) pulse.Waveform

MustGaussianSquare is like GaussianSquare but panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL