Skip to content

About

Python toolkit for guided-mode analysis and design of circular step-index and multilayer optical fibers.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

PyFiberModes

PyFiberModes logo

Badge Status
Python versions Supported Python versions
Documentation Documentation
Tests Tests Test coverage
PyPI PyPI version Monthly PyPI downloads
Conda Anaconda version Anaconda downloads Latest Anaconda release

Guided-mode analysis and design for circular optical fibers.

Find the modes supported by a circular optical fiber at a given wavelength. Compare effective indices, inspect field profiles, and follow modes as the wavelength or fiber geometry changes.

See the usage guide for further examples and implementation details.

Installation

Requires Python >=3.11.

$ python -m pip install PyFiberModes

Install from the martinpdes Conda channel:

$ conda install -c martinpdes pyfibermodes

For an editable source installation:

$ git clone https://github.com/MartinPdeS/PyFiberModes.git
$ cd PyFiberModes
$ python -m pip install -e .

Discover the guided modes of a fiber

"""
Guided-mode discovery
=====================

Discover the supported linearly polarized modes and compare their effective
indices at one wavelength.
"""
from PyFiberModes.units import ureg

import matplotlib.pyplot as plt

from PyFiberModes.analysis import find_modes
from PyFiberModes.fiber import load_fiber

fiber = load_fiber("SMF28", wavelength=1310e-9 * ureg.meter)
modes = find_modes(fiber, families=("LP",), max_nu=3, max_m=3)
effective_indices = [fiber.get_effective_index(mode) for mode in modes]

figure, axis = plt.subplots()
axis.bar([str(mode) for mode in modes], effective_indices)
axis.set(xlabel="Guided mode", ylabel="Effective index", title="SMF-28 at 1310 nm")
axis.ticklabel_format(axis="y", useOffset=False)
plt.show()

Documentation

Use the PyFiberModes documentation to work through examples and look up the inputs and return values of individual functions.

Citation

Cite the version used in your calculations with the software citation metadata.

Contributing

Bug reports, worked examples, and documentation corrections are welcome. To set up a development checkout and run the tests, follow the contributing guide.

Contact

For questions, contact Martin Poinsinet de Sivry-Houle.

License

See the PyFiberModes license for terms of use.

About

Python toolkit for guided-mode analysis and design of circular step-index and multilayer optical fibers.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages