Skip to main content

Multiport-Interferometer

This library provides a set of tools for designing multiport interferometer photonic circuits to emulate unitary transformations. Includes generation of complete circuit gds layout and steady-state power and phase simulations of multiport interferometers.

PyPI version Python versions License

Some of the functionalities of the library:

1. Bell type interferometer:
    - Schematic Logic Simulation
    - Automated GDS Layout construction
    - Physical Circuit Simulation (Emulates unitary transformations)

2. Clements type inteferometer:
    - Schematic Logic Simulation
    - Build Circuit Simulation

The library accepts custom files for circuit building blocks gds components and physical simulation models.
Uses GDSfactory for gds file processing and SAX for S-parameter simulations.

This library is part of the Open Source P.I.C Design Workflow Tutorial.
For complete documentation check out Tutorial.

Supporting notebooks:

Installation

pip install multiport-interferometer

Import:

import multiport_interferometer as mi

Usage example

Bell Interferometer Logic Simulation:

import multiport_interferometer as mi
from scipy.stats import unitary_group
import numpy as np
import sax

dimension = 58
U_target = unitary_group(dim=dimension).rvs()
results = mi.decompose_bell(U_target)
mods = mi.ideal_bell_models(results)

netlist = mi.bell_circuit_schematic(dimension)
circuit, info = sax.circuit(netlist=netlist, models = mods) 
S = circuit() #returns a sax S-dict object
S_mat = mi.sdict_to_matrix(S) #converts the sax sdict to a numpy matrix
print('Circuit Matches Target Matrix =', np.allclose(U_target, S_mat))
Circuit Matches Target Matrix = True

Bell Interferometer Physical SImulation:

dim = 5
mymesh = mi.Bell(dim)
U_target = unitary_group(dim).rvs()
S = mymesh.emulate(U_target)
S_mat = mi.sdict_to_matrix(S)
corrected = mymesh.phase_corrected(S)
print('Maximum Magnitude Error % =', np.max((abs(abs(S_mat)-abs(U_target)))*100/abs(S_mat)))
print('Maximum Phase Error = % ', np.max(np.angle(corrected/U_target)*100/np.pi))
mymesh.gds().plot()
Maximum Magnitude Error % = 9.225697420182325
Maximum Phase Error % =  8.080086688873948

alt text

Clements Interferometer Logic Simulation

mesh = Clements(dim)
U = unitary_group.rvs(dim)
simulation_result = sdict_to_matrix(mesh.ideal_emulate(U))
print('Circuit Matches Target Matrix =', np.allclose(U, simulation_result))
Circuit Matches Target Matrix = True

Development setup

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest

Contributing

Contributions are welcome, please open an issue or pull request.

Metadata

Release files for multiport-interferometer 0.0.1

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

Source distribution (sdist)

Source distribution for multiport-interferometer 0.0.1
File Size Uploaded
multiport_interferometer-0.0.1.tar.gz 20.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multiport-interferometer 0.0.1
File Interpreter ABI Platform
multiport_interferometer-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.1 kB

Release files / multiport_interferometer-0.0.1.tar.gz

Download URL multiport_interferometer-0.0.1.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9ef2c336edb9f80c4185a4645de74fa021452be52f092f7927796bfec382afc7
BLAKE2b-256 checksum
How to use checksums
286896f7c9f803843c8183e89705feca00a47adeae283db47c7557a369332fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 15, 2026.

Transparency log

Release files / multiport_interferometer-0.0.1-py3-none-any.whl

Download URL multiport_interferometer-0.0.1-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f5145f24cf38cb51d4a168b6db54ed1611040571a1eb68c4c165a6987140e2e
BLAKE2b-256 checksum
How to use checksums
b7e9057f58540ae975eb25d4f5559ac9f65d5030c9a7af6a7c1df5aad9b8c2a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

This release

0.0.1 This release

2 release files

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