Skip to main content

simple-to-use optical propagation tool

Project description

Axiprop

A simple tool to compute optical propagation, based on the discrete Hankel and Fourier transforms

Contents

This library contains methods and convenience tools to model propagation of the 3D optical field. Computations can be done using a number of backends:

  • NumPy (CPU) optionally enhanced via mkl_fft or pyfftw
  • CuPy for GPU calculations via Nvidia CUDA API
  • ArrayFire for GPU calculations via CUDA or OpenCL APIs
  • PyOpenCL for GPU calculations via OpenCL API

Currently methods include:

Usage

Consider a laser,

k0 = 2 * np.pi / 0.8e-6            # 800 nm wavelength
tau = 35e-15/ (2*np.log(2))**0.5   # 35 fs FWHM duration
R_las = 10e-3                      # 10 mm radius

def fu_laser(kz, r):
    """
    Gaussian spot with the Gaussian temporal profile
    """
    profile_r = np.exp( -(r/R_las)**2 )
    profile_kz = np.exp( -( (kz-k0) * c * tau / 2 )**2 )
    return profile_r * profile_kz

and some focusing optics,

f_N = 40                      # f-number f/40 
f0 = 2 * R_las * f_N          # focal length

Define the propagator,

prop = PropagatorSymmetric((Rmax, Nr), (k0, L_kz, Nkz), Nr_end)

and setup the laser reflected from the focusing mirror

A0 = laser_from_fu( fu_laser, prop.kz, prop.r )
A0 = A0 * mirror_parabolic( f0, prop.kz, prop.r )

Use AXIPROP to compute the field after propagation of dz distance (e.g. dz=f0 for field at focus):

A0 = prop.step(A0, f0)

or evaluate it at Nsteps along some Distance around the focus,

dz =  Distance / Nsteps
zsteps = Nsteps * [dz,]
zsteps[0] = f0 - Distance/2
A_multi = prop.steps(A0, zsteps)

Plot the results using your favorite tools

example_image

For more info checkout the example notebooks for radial and cartesian cases, and also look for methods documentation.

Installation

Install axiprop by cloning the source

git clone https://github.com/hightower8083/axiprop.git
cd axiprop
python setup.py install

or directly via PiPy

pip install git+https://github.com/hightower8083/axiprop.git

Additional requirements

Note that, while base backend NP requires only NumPy and SciPy, other backends have specific dependencies:

Optional enhancements of utilities are achieved if Numba is installed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axiprop-0.5.5.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axiprop-0.5.5-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file axiprop-0.5.5.tar.gz.

File metadata

  • Download URL: axiprop-0.5.5.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for axiprop-0.5.5.tar.gz
Algorithm Hash digest
SHA256 31f84d8efdfd45f21a3c71d1b46e31a316147e515a426acd25374f20f9e1028f
MD5 18aa4dbe19cbae54546d692b262d3bc6
BLAKE2b-256 196612919eea2da0370d6de8f634294d4451224d8104b5a9df6f941430743b43

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiprop-0.5.5.tar.gz:

Publisher: publish-to-pypi.yml on hightower8083/axiprop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file axiprop-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: axiprop-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for axiprop-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7a2707a45ece31f1c2be13b5c61b2454079d894ba60b46c2bc221e4874c1b8d4
MD5 22fcb75bfe63376360a21d1898e7372b
BLAKE2b-256 6c28a1ca7cf6359a5182bcecaea47a99f1cae6f415d3f8d5b1cade8c871106f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for axiprop-0.5.5-py3-none-any.whl:

Publisher: publish-to-pypi.yml on hightower8083/axiprop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page