Skip to main content

waveforms

View build status Coverage Status PyPI version

Form waveforms used in experiment.

Installation

We encourage installing waveforms via the pip tool (a python package manager):

python -m pip install waveforms

To install from the latest source, you need to clone the GitHub repository on your machine.

git clone https://github.com/feihoo87/waveforms.git

Then dependencies and waveforms can be installed in this way:

cd waveforms
python -m pip install numpy
python -m pip install -e .

Usage

import numpy as np
import matplotlib.pyplot as plt

from waveforms import *

pulse = cosPulse(20e-9)

x_wav = zero()
y_wav = zero()

I, Q = mixing(0.5*pulse, freq=-20e6, DRAGScaling=0.2)
x_wav += I
y_wav += Q

I, Q = mixing(pulse >> 1e-6, freq=-20e6, phase=np.pi/2, DRAGScaling=0.2)
x_wav += I
y_wav += Q

I, Q = mixing((0.5 * pulse) >> 2e-6, freq=-20e6, DRAGScaling=0.2)
x_wav += I
y_wav += Q


t = np.linspace(-1e-6, 9e-6, 10001)
plt.plot(t, x_wav(t))
plt.plot(t, y_wav(t))
plt.show()

Unified binary representation

Waveform is the common base class for every signal object. RealWaveform and ComplexWaveform are concrete waveforms; WaveVStack is the common stack base, with RealWaveVStack and ComplexWaveVStack as its concrete forms. The original construction style remains unchanged and automatically selects the compact C core for common pulses and repeated-pulse stacks:

import waveforms as wf

# The default tick is already the period of 120 GHz (1 / 120e9 seconds).
# To use another global tick, override it before constructing/loading waveforms:
# wf.set_time_resolution(1e-12)

pulse = (wf.gaussian(12e-9) >> 20e-9) * wf.cos(2 * wf.pi * 5e9)
data = pulse.to_bytes()
restored = wf.Waveform.from_bytes(data)

assert isinstance(pulse, wf.Waveform)
stack = wf.WaveVStack([pulse, pulse >> 40e-9])
assert isinstance(stack, wf.RealWaveVStack)
assert isinstance(stack, wf.WaveVStack)

The C block format stores signed 64-bit ticks using a process-wide clock. The default is 120 GHz. A different process-wide time resolution may be selected before the first waveform is constructed; the same C representation and evaluator continue to be used. The setting is locked by the first object.

sample() has integer-grid fast paths for 500 MHz, 1 GHz, 1.2 GHz, 2 GHz, 2.4 GHz, 2.5 GHz, 4 GHz, 6 GHz, 8 GHz, and 10 GHz. Real waveforms can be quantized directly to signed DAC buffers:

pulse.start = 0
pulse.stop = 100e-9
dac16 = pulse.sample(2_400_000_000, dtype=np.int16, full_scale=1.0)

The low-level cores store and evaluate real-valued signals only. Complex signals are represented in Python as independent real and imaginary channels:

z = (1 + 0.25j) * wf.gaussian(12e-9)
assert isinstance(z, wf.ComplexWaveform)

stack = wf.ComplexWaveVStack([z, z >> 20e-9])
samples = stack(t)  # complex NumPy array

Real waveforms and stacks therefore avoid complex storage and arithmetic for the common real-valued case. ComplexWaveform.real and .imag expose the two real channel waveforms.

Reporting Issues

Please report all issues on github.

License

MIT

Metadata

Release files for waveforms 3.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waveforms 3.4.0
File Size Uploaded
waveforms-3.4.0.tar.gz 80.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for waveforms 3.4.0
File
waveforms-3.4.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
waveforms-3.4.0-cp314-cp314t-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details
waveforms-3.4.0-cp314-cp314t-macosx_10_15_universal2.whl CPython 3.14 CPython 3.14 free-threading macOS 10.15+ universal2 (ARM64, x86-64) Details
waveforms-3.4.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
waveforms-3.4.0-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details
waveforms-3.4.0-cp314-cp314-macosx_10_15_universal2.whl CPython 3.14 CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) Details
waveforms-3.4.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
waveforms-3.4.0-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 Details
waveforms-3.4.0-cp313-cp313-macosx_10_13_universal2.whl CPython 3.13 CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) Details
waveforms-3.4.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
waveforms-3.4.0-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details
waveforms-3.4.0-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details
waveforms-3.4.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
waveforms-3.4.0-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details
waveforms-3.4.0-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details
waveforms-3.4.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
waveforms-3.4.0-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details
waveforms-3.4.0-cp310-cp310-macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 13.0 MB

Release files / waveforms-3.4.0.tar.gz

Download URL waveforms-3.4.0.tar.gz
Size 80.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f66f1009084e7003316d4b2d64df29af88eb14934ba1752cc6b1f39409cf2c88
BLAKE2b-256 checksum
How to use checksums
06ef6e89e3ca31cd534e2dc0c82dce68f9ef155994b2a55b235370399ad324e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314t-win_amd64.whl

Download URL waveforms-3.4.0-cp314-cp314t-win_amd64.whl
Size 279.5 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
3b65e0a397a491f2cf50c853c0ae6c1d4484aa0ef696a548a61c19e5f3c213c8
BLAKE2b-256 checksum
How to use checksums
4c2a14415c5c9eb136820670d829dd9f966c649232d401bae54ad80330413d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314t-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp314-cp314t-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.3 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
52449ea65bd03dea74b6dfe33d6ab9f3abede0d83bf3b9d668e706eca143f794
BLAKE2b-256 checksum
How to use checksums
997dd32565cf6a3a7d25dfe36ac618b214564c82792ea0c3f2127bbf7847b2aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314t-macosx_10_15_universal2.whl

Download URL waveforms-3.4.0-cp314-cp314t-macosx_10_15_universal2.whl
Size 535.2 kB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
83c094a9a42d77a61da332a23421d5c5ae13447ed6aaff4549256b111fdfc113
BLAKE2b-256 checksum
How to use checksums
8238bebc3346e301178bd8aaae540f2a2fe7033a1a00ea6b8f6bf3990b5af716
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314-win_amd64.whl

Download URL waveforms-3.4.0-cp314-cp314-win_amd64.whl
Size 269.3 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
913efeb17303a3e1f37441556f7784515499a4a22f5d2f64e27cb63dd1281570
BLAKE2b-256 checksum
How to use checksums
9193daa1b5e430bc68f715454e47ae92a4f5b70bad024ab78718de90ee3626a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.3 MB
Tags CPython 3.14 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
2f141d1ac06a7a00f94a8a3be10a177ccd010335d32480e61d3f5cc2a26c2986
BLAKE2b-256 checksum
How to use checksums
c4ea30fa677b5d1721f42bbc01a7535b83a165c3b63785fe1003c3b925ba014b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp314-cp314-macosx_10_15_universal2.whl

Download URL waveforms-3.4.0-cp314-cp314-macosx_10_15_universal2.whl
Size 525.6 kB
Tags CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
7fd0792628370ea814967e3cfcb3b47057db6f93b2bf1dabe11a31c2ca731ab8
BLAKE2b-256 checksum
How to use checksums
8c4e048a6deb5b52660f3837dc75c43f5bbce1298173ac35c2e0e0ec86863b5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp313-cp313-win_amd64.whl

Download URL waveforms-3.4.0-cp313-cp313-win_amd64.whl
Size 263.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
c48682696b51386b2144b2704eca0ad6377cc8a733b036a7e0e9e0ec9529dd84
BLAKE2b-256 checksum
How to use checksums
b7a4a9b7f892c84316db44a0e093a8b50aa2fb8ebee8b22ce3081a33c820462f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.13 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f87ca95577c7af2060cef9fa6e268fc8a65be5712a40a625c588b3c3dc065b0a
BLAKE2b-256 checksum
How to use checksums
12ba57378aabe047dc00e1ac8ecf44b62b44461751fe422f3cbf3ad6e2c3cb63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp313-cp313-macosx_10_13_universal2.whl

Download URL waveforms-3.4.0-cp313-cp313-macosx_10_13_universal2.whl
Size 524.0 kB
Tags CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
1b3fb230e2bff0b619a0f195c2da66ff0f7d63c6a82d3df1a0f1cc1a2c9c17ba
BLAKE2b-256 checksum
How to use checksums
45c6d368c1d46f5564a16d43a7b6d3b55e6d9edf248083a78277134612d08c74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp312-cp312-win_amd64.whl

Download URL waveforms-3.4.0-cp312-cp312-win_amd64.whl
Size 263.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0c0ca6466768c2af4c8ba1e01aff71750675ed8d5a2e6ea9b858e312c0e64dbf
BLAKE2b-256 checksum
How to use checksums
5cbd642b7f34156acc143c44b4db8890b61291d9973654b7d839017dc65d0bc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
bb8f8f5aa4451c96b2328954e818f539b5c0ad8e3dba21946ec74f33210d378c
BLAKE2b-256 checksum
How to use checksums
b39c9600f78a18657e580524057ef469510bc9f1a6c917adeac0889144143a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp312-cp312-macosx_10_13_universal2.whl

Download URL waveforms-3.4.0-cp312-cp312-macosx_10_13_universal2.whl
Size 523.8 kB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
3e1841172976ac084fe697809d3042bfe2b6e2069360e82791a1aa5bdfbcffa2
BLAKE2b-256 checksum
How to use checksums
13d607addf3f39290b6936f6f53ad3939a03a9373d030d0180be19e025255462
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp311-cp311-win_amd64.whl

Download URL waveforms-3.4.0-cp311-cp311-win_amd64.whl
Size 274.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
4d173c0040b26987a2fa2f72837ef5fc726fd5e2bf5e804c5cfaa7e76c737c79
BLAKE2b-256 checksum
How to use checksums
0483876d4b9042dd978d464ed1a432887823efd9e227427c1d50c9c41cf46c75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.11 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e27396a87989fd1ccd979c767bde32152b082fb162fdbd03d70a9822c7b6822d
BLAKE2b-256 checksum
How to use checksums
ad227bc5c0a0a92047693a70dad35bf31ff331fc242ac85c4f112fbead1e9eb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp311-cp311-macosx_10_9_universal2.whl

Download URL waveforms-3.4.0-cp311-cp311-macosx_10_9_universal2.whl
Size 514.8 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
8f766ac903e1a78b3971fa2a27890710a4cbfd9793ca43e5f7446567fa84a885
BLAKE2b-256 checksum
How to use checksums
3d23f9d7e342b5057d18c750ce7f686caaefef2142861d44dbac8ebc8c5e205e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp310-cp310-win_amd64.whl

Download URL waveforms-3.4.0-cp310-cp310-win_amd64.whl
Size 275.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
29e330047de7d6981097c47c3fb17ed5d8aaebc95faed6d9a03aeecde4eb87aa
BLAKE2b-256 checksum
How to use checksums
7c9a4be01ac763db0caecd045091697b99a34c8857c77e356b17330618c4d7bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL waveforms-3.4.0-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 1.4 MB
Tags CPython 3.10 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
38919866f34b08f8d95d2490504add531cc15d6c8ebf742809d5365f96b55465
BLAKE2b-256 checksum
How to use checksums
74ca311d5eee91f35ebfe5d3bc3e7fbaea63b05ee1218ada88fd92af8a122f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / waveforms-3.4.0-cp310-cp310-macosx_10_9_universal2.whl

Download URL waveforms-3.4.0-cp310-cp310-macosx_10_9_universal2.whl
Size 520.0 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
cf02921b02c412dafa2239357b12c987593671916ed824f354beae31416a3880
BLAKE2b-256 checksum
How to use checksums
c21d45498a2a4205101e82737e2a06f766c6f05b8a87bdc83bb122bcaef14fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

3.7.0

19 release files

This release

3.4.0 This release

19 release files

3.3.2

19 release files

3.3.0

19 release files

3.2.0

19 release files

3.1.0

19 release files

3.0.0

19 release files

2.3.0

19 release files

2.2.3

19 release files

2.2.2

19 release files

2.2.0

13 release files

2.1.0

13 release files

2.0.1

13 release files

1.9.4

10 release files

1.9.1

10 release files

1.8.9

10 release files

1.8.8

10 release files

1.8.7

10 release files

1.8.6

10 release files

1.8.5

10 release files

1.8.4

10 release files

1.8.1

10 release files

1.8.0

10 release files

1.7.9

10 release files

1.7.8

10 release files

1.7.7

10 release files

1.7.6

7 release files

1.7.5

7 release files

1.7.4

7 release files

1.7.3

7 release files

1.7.2

7 release files

1.7.1

7 release files

1.7.0

7 release files

1.6.11

7 release files

1.6.10

7 release files

1.6.9

7 release files

1.6.8

4 release files

1.6.7

7 release files

1.6.6

7 release files

1.6.5

7 release files

1.6.4

7 release files

1.6.3

7 release files

1.6.2

7 release files

1.6.1

7 release files

1.6.0

7 release files

1.5.99

7 release files

1.5.98

7 release files

1.5.97

9 release files

1.5.93

7 release files

1.5.92

7 release files

1.5.90

7 release files

1.5.89

7 release files

1.5.87

7 release files

1.5.86

7 release files

1.5.85

7 release files

1.5.84

7 release files

1.5.83

7 release files

1.5.81

7 release files

1.5.80

7 release files

1.5.79

7 release files

1.5.78

7 release files

1.5.77

7 release files

1.5.76

7 release files

1.5.75

5 release files

1.5.74

5 release files

1.5.63

7 release files

1.5.62

7 release files

1.5.61

5 release files

1.5.60

2 release files

1.5.59

2 release files

1.5.57

2 release files

1.5.56

5 release files

1.5.55

5 release files

1.5.54

7 release files

1.5.53

7 release files

1.5.52

7 release files

1.5.51

7 release files

1.5.50

7 release files

1.5.47

7 release files

1.5.42

2 release files

1.5.38

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page