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.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
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.2.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.2.0
File Size Uploaded Provenance Actions
bifrost_photonics-0.2.0.tar.gz 507.0 kB With provenance Details for bifrost_photonics-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / bifrost_photonics-0.2.0.tar.gz

Download URL bifrost_photonics-0.2.0.tar.gz
Size 507.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5d6e7128f394973bad773d0a49ea4771e6433c5559f18668345d808259393603
BLAKE2b-256 checksum
How to use checksums
a65760c115e98f377ef5f6a847c0d5087da5ce71bcc87dce1ee55bef2a7c6068
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 7, 2026.

Transparency log

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

Download URL bifrost_photonics-0.2.0-py3-none-any.whl
Size 518.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a05f49343a99052f8ac0328bc1dac18ea892d582ac120309c1cce63a810904b
BLAKE2b-256 checksum
How to use checksums
f98b901ff25da150da5c2a6cb4458b4a84a50718e0ea9f3ca9697371fe9b58f5
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 7, 2026.

Transparency log

Security for bifrost-photonics 0.2.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.2.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 7, 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.2.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