Skip to main content

bifrost

bifrost

docs tests

The rainbow bridge between your GDSFactory pipeline and FDTD 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/

Install

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.

pip install bifrost-photonics

To install the latest development version from GitHub instead: pip install "bifrost-photonics @ git+https://github.com/Sephiram591/bifrost.git".

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(
    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
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.3.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.3.0
File Size Uploaded Provenance Actions
bifrost_photonics-0.3.0.tar.gz 656.7 kB With provenance Details for bifrost_photonics-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / bifrost_photonics-0.3.0.tar.gz

Download URL bifrost_photonics-0.3.0.tar.gz
Size 656.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7ab653d1525204dc8fdb20e21c60d1a2ca5215cf647d3e95fdfb4586fa25047c
BLAKE2b-256 checksum
How to use checksums
2561c2959571426d57f08582f0f5d5cd5d9551eb0b11605f1b400d792142e427
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 27, 2026.

Transparency log

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

Download URL bifrost_photonics-0.3.0-py3-none-any.whl
Size 673.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84cca1732241284af36545ffef7e6b55188555454eb7d7b3610cf774b0701672
BLAKE2b-256 checksum
How to use checksums
0c9b5efaede8ecb2b7eb197d8ff942f7a18ac0f31ba38b3cc4845233d896b6f8
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 27, 2026.

Transparency log

Security for bifrost-photonics 0.3.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.3.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 27, 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.

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