A minimal core for vector-beam simulation
Project description
VectorBeam
vectorbeam is a minimal, elegant Python library for vector-beam simulation and propagation.
Features
- Vector Fields: Easy creation and manipulation of spatially varying polarization fields (e.g., Full Poincaré beams, vector vortex beams).
- Propagation: Fast scalar and vector propagation algorithms (e.g., Fresnel, Richards-Wolf for high-NA focusing).
- Optical Elements: Simulation of Waveplates, Q-Plates, SLMs, and more.
- Precision Toggle: Support for both single (
complex64) and double (complex128) precision.
Installation
You can install vectorbeam directly via pip:
pip install vectorbeam
Or install from source:
git clone https://github.com/yourusername/vectorbeam.git
cd vectorbeam
pip install -e .
Quickstart
import numpy as np
import matplotlib.pyplot as plt
from vectorbeam import fpb_lambert, propagate_field, plotting
# Create a Full Poincaré beam
extent = 10e-3 # 10 mm
N = 512
lambda0 = 632.8e-9 # 632.8 nm
beam = fpb_lambert(N, extent, lambda0, w0=1e-3)
# Propagate the beam
z = 0.5 # 50 cm
propagated_beam = beam.propagate(z)
# Plot the intensity and polarization ellipses
fig, axes = plt.subplots(1, 2, figsize=(10, 4))
plotting.plot_intensity(propagated_beam, ax=axes[0], title="Intensity")
plotting.plot_polarization_ellipses(propagated_beam, ax=axes[1], step=16)
plt.show()
Gallery
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vectorbeam-0.1.0.tar.gz
(40.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vectorbeam-0.1.0.tar.gz.
File metadata
- Download URL: vectorbeam-0.1.0.tar.gz
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94b827ae25c79aadb0fef207958adc5f4d3f8f4a50d549322838aa1732547e0e
|
|
| MD5 |
d289b9df7e2422352c313741261b994c
|
|
| BLAKE2b-256 |
a640a1c9712c9fe8ce317d5adcd061a6251915804e8fa8e77c9b75c198df23de
|
File details
Details for the file vectorbeam-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vectorbeam-0.1.0-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf8e1dc979894742e2e6e0dfce890e609e5ade41adc745ca99b4eec959cb30e
|
|
| MD5 |
2582cfba7f71d43d335e8e4e190739d3
|
|
| BLAKE2b-256 |
1f52ff6abe09357ab7563564a4c3268fbfdd6e54e78e38a31cae389efa215224
|