Skip to content
MartinPdeSPublic

About

Fast C++-backed Python tools for guided-mode and light-propagation simulation in tapered fiber-optic components.

Topics

Resources

Contributing

Stars

20 stars

Watchers

5 watching

Forks

Repository files navigation

SuPyMode

SuPyMode 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

A package for light propagation in fiber optics.

Compute guided supermodes along a tapered optical component and study how a changing cross-section couples them. Start by comparing taper profiles at fixed stretch before solving for optical propagation.

See the usage guide for further examples and implementation details. Open the project notebook in Colab.

https://raw.githubusercontent.com/MartinPdeS/SuPyMode/HEAD/docs/images/mode_propagation.gif

Mode propagation in a tapered photonic lantern.

Installation

Requires Python >=3.11.

$ python -m pip install SuPyMode

Install from the martinpdes Conda channel:

$ conda install -c martinpdes supymode

For an editable source installation:

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

Compare taper heating lengths

"""
Compare heating lengths
=======================

For the same stretch, a longer hot zone produces a gentler radius reduction.
Distances and heating lengths are in metres; the radius is normalised to its
initial value. This example compares profiles, not optical mode solutions.
"""

import matplotlib.pyplot as plt
from SuPyMode.workflow import AlphaProfile

fig, ax = plt.subplots()
for heating_length in (4e-3, 8e-3, 12e-3):
    profile = AlphaProfile(
        initial_radius=1.0, symmetric=False, add_end_of_taper_section=False
    )
    profile.add_taper_segment(
        alpha=0.2, initial_heating_length=heating_length, stretching_length=4e-3
    )
    profile.initialize()
    ax.plot(
        profile.distance * 1e3, profile.itr_list, label=f"{heating_length * 1e3:g} mm"
    )
ax.set(
    xlabel="Distance (mm)",
    ylabel="Inverse taper ratio",
    title="Effect of heating length",
)
ax.legend(title="Heating length")
plt.show()

Documentation

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

Citation

Cite the SuPyMode paper in Optics Continuum when using the solver in a publication.

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 SuPyMode license for terms of use.

About

Fast C++-backed Python tools for guided-mode and light-propagation simulation in tapered fiber-optic components.

Topics

Resources

Contributing

Stars

20 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages