Metadata-Version: 2.4
Name: vectorbeam
Version: 0.1.0
Summary: A minimal core for vector-beam simulation
Author-email: Gururaj Kadiri <grajkadiri@gmail.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# VectorBeam

![VectorBeam Logo](placeholder_logo.png)

`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:

```bash
pip install vectorbeam
```

Or install from source:

```bash
git clone https://github.com/yourusername/vectorbeam.git
cd vectorbeam
pip install -e .
```

## Quickstart

```python
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

![Intensity at z=100](intensity_2d_z100.png)
![Polarization Projections](polarization_projections.png)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
