waveforms
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
Metadata
Release files for waveforms 3.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| waveforms-3.3.2.tar.gz | 79.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| waveforms-3.3.2-cp314-cp314t-win_amd64.whl | CPython 3.14 | CPython 3.14 free-threading | Windows x86-64 | Details |
| waveforms-3.3.2-cp314-cp314t-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl | CPython 3.14 | CPython 3.14 free-threading | Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 | Details |
| waveforms-3.3.2-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.3.2-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
| waveforms-3.3.2-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 | Details |
| waveforms-3.3.2-cp314-cp314-macosx_10_15_universal2.whl | CPython 3.14 | CPython 3.14 | macOS 10.15+ universal2 (ARM64, x86-64) | Details |
| waveforms-3.3.2-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| waveforms-3.3.2-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.3.2-cp313-cp313-macosx_10_13_universal2.whl | CPython 3.13 | CPython 3.13 | macOS 10.13+ universal2 (ARM64, x86-64) | Details |
| waveforms-3.3.2-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| waveforms-3.3.2-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.3.2-cp312-cp312-macosx_10_13_universal2.whl | CPython 3.12 | CPython 3.12 | macOS 10.13+ universal2 (ARM64, x86-64) | Details |
| waveforms-3.3.2-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| waveforms-3.3.2-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.3.2-cp311-cp311-macosx_10_9_universal2.whl | CPython 3.11 | CPython 3.11 | macOS 10.9+ universal2 (ARM64, x86-64) | Details |
| waveforms-3.3.2-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| waveforms-3.3.2-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.3.2-cp310-cp310-macosx_10_9_universal2.whl | CPython 3.10 | CPython 3.10 | macOS 10.9+ universal2 (ARM64, x86-64) | Details |
Total release size: 12.9 MB
Release files / waveforms-3.3.2.tar.gz
| Download URL | waveforms-3.3.2.tar.gz |
|---|---|
| Size | 79.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
493cce2036ee3bc8bf122e9c97db29559fa2a37d4f495c291e371e3ef17c1fb8
|
|
BLAKE2b-256 checksum How to use checksums |
e34b4b7adf4539ec13fa5ee70ccbf28954927432196633b64d7be2945734fe23
|
| 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.3.2-cp314-cp314t-win_amd64.whl
| Download URL | waveforms-3.3.2-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 277.7 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9c9bafb1547f74e366714b39f153312ec37007fdb8799cca4267940e61ccf65f
|
|
BLAKE2b-256 checksum How to use checksums |
945a3ab90ccdf262048515298fdfd18d8312375cb6ce82b3ed4fa4540a91e8c4
|
| 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.3.2-cp314-cp314t-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-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 |
ee2d31f8100e465ff099203ff855101899d5bdb668b1523d312a4302baf41834
|
|
BLAKE2b-256 checksum How to use checksums |
32f941444cc96f9f67a0321610d1ad31dbb54878f4fad54684915f6a77f2c266
|
| 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.3.2-cp314-cp314t-macosx_10_15_universal2.whl
| Download URL | waveforms-3.3.2-cp314-cp314t-macosx_10_15_universal2.whl |
|---|---|
| Size | 531.6 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
729f0e12fcc1758e2603acae0272ee5cf5e1bb0ddb6312d7f04938e0f5050fdc
|
|
BLAKE2b-256 checksum How to use checksums |
f430145f032b11cddfada858423fa0e21b6b4a496ab64307005c6a05a7aa33ad
|
| 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.3.2-cp314-cp314-win_amd64.whl
| Download URL | waveforms-3.3.2-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 267.6 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
69711600b47d7b94b873572d9582a0525aa91aaaef8451e5d51c9e2e45ffa32a
|
|
BLAKE2b-256 checksum How to use checksums |
a225534831e68cdd85f2d23fcd32ce7ec7043596b556bae52ff270399a79ce58
|
| 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.3.2-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-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 |
20287d9561255fd4d0bed7c28ac9e067261eca2ba8c044fe561a6aafb12ac06a
|
|
BLAKE2b-256 checksum How to use checksums |
038c5fb820ab790a494f58dbf09e1d44a5abb932cac274bc379d3f80e6f28d6a
|
| 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.3.2-cp314-cp314-macosx_10_15_universal2.whl
| Download URL | waveforms-3.3.2-cp314-cp314-macosx_10_15_universal2.whl |
|---|---|
| Size | 521.1 kB |
| Tags | CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
5fa8c00e7582db5c78b5dea19e76d4b63daa01b13e423e03db886a40d6fcf54c
|
|
BLAKE2b-256 checksum How to use checksums |
f149b1bad0662fdb19749e0672dd49f1759edce4f05c3fc2c264d218cf64c2af
|
| 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.3.2-cp313-cp313-win_amd64.whl
| Download URL | waveforms-3.3.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 261.5 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7cdd09bef4f5ff3565867530d45b77194c98b58371b7c03cee74cfce9bb52b6a
|
|
BLAKE2b-256 checksum How to use checksums |
adab3e9d7dcae3fc62ab5ac82bb6d448b591a478b788549f8aac8307289eed52
|
| 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.3.2-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
54a02258f41e59364555bbaaeadeef338c0836d1e64042cbe86e6b564ce097e2
|
|
BLAKE2b-256 checksum How to use checksums |
8f74c70f5643da53c49e23d2d685dbed2f50b12292fea1bdc6f46b6612372e8e
|
| 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.3.2-cp313-cp313-macosx_10_13_universal2.whl
| Download URL | waveforms-3.3.2-cp313-cp313-macosx_10_13_universal2.whl |
|---|---|
| Size | 519.4 kB |
| Tags | CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
6fc93a11988464aa12c0a5bdab1d3b52dddfebdceb7c4164354b1960f041fc4f
|
|
BLAKE2b-256 checksum How to use checksums |
369df6df87eb29c1e29a017a24bf5a83bc58e001dcb17413c1a810125f571a13
|
| 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.3.2-cp312-cp312-win_amd64.whl
| Download URL | waveforms-3.3.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 261.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
341233dd44e20c8b0fbb5b25170c69fe82abef1477896e2d7e8ba7a03386fe9c
|
|
BLAKE2b-256 checksum How to use checksums |
d2b39f68b23668c98b27747b4a9732da83b1f8f835f058aafa6a1a12b3f2a239
|
| 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.3.2-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-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 |
8c8fe785f2987adb4ee74a59cd3470198e5be38d606c035acd75fe1ccdd3dcca
|
|
BLAKE2b-256 checksum How to use checksums |
f8e2c4e5cde26371ce48b3828d5ca2e938ac41502d30bd191d560aad1c449ec2
|
| 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.3.2-cp312-cp312-macosx_10_13_universal2.whl
| Download URL | waveforms-3.3.2-cp312-cp312-macosx_10_13_universal2.whl |
|---|---|
| Size | 519.2 kB |
| Tags | CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
086c89d5a590dfa7ce2ed209aaff342f65b13cd786861c356819804b772b12e7
|
|
BLAKE2b-256 checksum How to use checksums |
27702b1814d27af272cc5181740c7968d25a26315ed919561a3deba05835f20f
|
| 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.3.2-cp311-cp311-win_amd64.whl
| Download URL | waveforms-3.3.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 273.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
da71f3055bd2d9b3b6903a20b0209beacab7a540d04226114825d62079bffba9
|
|
BLAKE2b-256 checksum How to use checksums |
80b71ab094e286a4243ac1b3f63cfd62685483867eb5f62efa877fd2089ed889
|
| 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.3.2-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-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 |
efb2184d4129f18df8d53f48caf6d4423bb2573999a2917501395a432e57307d
|
|
BLAKE2b-256 checksum How to use checksums |
8ff767bc480220fcd546c53447e4f683e0ed45bfafbe6cbe63439c5fd63a8391
|
| 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.3.2-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | waveforms-3.3.2-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 510.6 kB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
37fc9e61b375445a3e55badec38e56ff758dce1b5a55f8e6370ab38f8fa1784e
|
|
BLAKE2b-256 checksum How to use checksums |
266371dbf75ca604bf6af68dc06857d99d1d6a7e14bb85be51534e23daebd6a8
|
| 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.3.2-cp310-cp310-win_amd64.whl
| Download URL | waveforms-3.3.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 273.6 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9a6673ce8ac08c67991198ad3256e671b40bc876f170c24ec98fb2ddb05ed8e3
|
|
BLAKE2b-256 checksum How to use checksums |
d076c9c02a3151d9add0ca78b7b2a6c6907cd4889a2435b94101c979bcad72b4
|
| 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.3.2-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
| Download URL | waveforms-3.3.2-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 |
6f396a63bd9c2ca37188e80b5f7961755422ff68c9ebfd1b099ef4a06922c63c
|
|
BLAKE2b-256 checksum How to use checksums |
dee90eb988f675f3cae39fce17cf2d4d8bfb6105624778de4f37deadf5fb821f
|
| 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.3.2-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | waveforms-3.3.2-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 515.6 kB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
aad520eb4a3cea22de8b4d86dbb3c772bfa2c37dc6bdb5930c483660303981cc
|
|
BLAKE2b-256 checksum How to use checksums |
5e7187923da67a7a33712b6017b1a9130b13bc0fbc9efc4510348573ba76a676
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|