Skip to main content

bifrost

bifrost

docs tests

The rainbow bridge between your GDSFactory(X) pipeline and FDTD(X) simulation.

bifrost turns a gdsfactory component and its layer stack into a differentiable fdtdx simulation, and ships a 3D viewer for setting up the run and inspecting its fields. It builds on gdsfactoryx, the JAX port of gdsfactory.

Documentation: https://sephiram591.github.io/bifrost/ (with a live viewer demo)

Install

Python 3.12 to 3.14. fdtdx is a required dependency, so one command installs everything. Use a fresh environment: gdsfactoryx (installed from PyPI as a dependency) provides the gdsfactory import package, so it cannot share an environment with upstream gdsfactory.

python -m venv bifrost-env && source bifrost-env/bin/activate
pip install bifrost-photonics

The distribution is named bifrost-photonics: the name bifrost on PyPI belongs to an unrelated project (OpenStack), so do not pip install bifrost. You still import bifrost as bf. To install the latest development version from GitHub instead: pip install "bifrost-photonics @ git+https://github.com/Sephiram591/bifrost.git".

For GPU simulations also install a CUDA build of JAX (see the installation page).

Quick start

A straight silicon waveguide in the viewer (in a Jupyter or marimo cell, end the cell with viewer):

import fdtdx
import gdsfactory as gf
import bifrost as bf
from gdsfactory.technology import LayerLevel, LayerStack

gf.gpdk.PDK.activate()

component = gf.components.straight(length=5)  # a 5 um long, 500 nm wide waveguide with ports o1 and o2

# one 220 nm thick level on the waveguide layer; silicon core in a silica cladding
layer_stack = LayerStack(
    layers={"core": LayerLevel(layer=gf.gpdk.LAYER.WG, zmin=0.0, thickness=0.22, material="core", mesh_order=1)}
)
materials = {
    "core": fdtdx.Material(permittivity=3.48**2),
    "clad": fdtdx.Material(permittivity=1.444**2),
}

stack = bf.StackDevice.from_layer_stack(
    component, layer_stack, materials,
    background="clad",                               # fills everything the core does not
    zrange_layers=["core"],                          # the box's z range is the core's
    extend_ports=(("o1", 1.0), ("o2", 1.0)),         # 1 um straight leads out of both ports
    boundary_offset=(0, 0, 1.5, -1.5, 1.5, -1.5),    # 1.5 um of cladding in y and z
    name="stack",
)
viewer = bf.view(stack)  # the interactive 3D viewer

Next: run your first simulation, a 90 degree bend from an empty file to a transmission value and a field image.

Metadata

Release files for bifrost-photonics 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bifrost-photonics 0.1.0
File Size Uploaded Provenance Actions
bifrost_photonics-0.1.0.tar.gz 505.9 kB With provenance Details for bifrost_photonics-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bifrost-photonics 0.1.0
File Interpreter ABI Platform Actions
bifrost_photonics-0.1.0-py3-none-any.whl Python 3 none any Details for bifrost_photonics-0.1.0-py3-none-any.whl

Total release size: 1.0 MB

Release files / bifrost_photonics-0.1.0.tar.gz

Download URL bifrost_photonics-0.1.0.tar.gz
Size 505.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bae07de410d6815b1898d2c2519c0dfbb0d8780563e831e7c7e2391326751aa4
BLAKE2b-256 checksum
How to use checksums
e835cf0c7e7a6bdd6d97cba73613ba0e6540c0d1e1c2f7588b236baa5ef95c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / bifrost_photonics-0.1.0-py3-none-any.whl

Download URL bifrost_photonics-0.1.0-py3-none-any.whl
Size 516.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a824d15156956a1cab4727c60ab1a42191d004f1c5e7671354cd55a9c84f4662
BLAKE2b-256 checksum
How to use checksums
4bf2a50ef5ea2b103332c68d436681216369686d6d488babb07de2a30cae40a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for bifrost-photonics 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bifrost_photonics-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page