Metadata-Version: 2.4
Name: gds2openEMS
Version: 0.6.7
Summary: Create and run openEMS FDTD model from RFIC GDSII layout file
Author-email: Volker Muehlhaus <volker@muehlhaus.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/VolkerMuehlhaus/gds2openEMS
Project-URL: Repository, https://github.com/VolkerMuehlhaus/gds2openEMS
Project-URL: Changelog, https://github.com/VolkerMuehlhaus/gds2openEMS/blob/main/doc/CHANGES.md
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gdspy>1.6.0
Requires-Dist: CSXCAD
Requires-Dist: openEMS
Requires-Dist: numpy
Requires-Dist: shapely
Requires-Dist: PySide6
Dynamic: license-file

# gds2openEMS: FDTD simulation workflow for RFIC

The files provided here enable openEMS EM simulation with layouts
created for the IHP SG13G2 RFIC technology.

![Intro](https://raw.githubusercontent.com/VolkerMuehlhaus/gds2openEMS/main/doc/png/gds2openEMS_banner.png)

## Install

    pip install gds2openEMS

**Full documentation, installation guide, and usage walkthrough:**
https://github.com/VolkerMuehlhaus/gds2openEMS

## Recent changes

## 31-Oct-2026 (0.6.7)

**Ports with several polygons:** several separate polygons on one port layer are now the elements of one port, in parallel, e.g. for a terminal on several transistor fingers. Each element gets N·Z0, so the port is terminated with Z0; the port voltage is the mean of the element voltages, the port current their sum. Touching polygons are one element. Before, every polygon became a port of its own with the same number: openEMS stopped with "a probe named port_ut_1 already exists", or, in older openEMS versions, ran with the port terminated by Z0/N and wrong S-parameters. Resonance estimation and `deembed_openEMS.py` (element inductances in parallel) know the elements. See "Ports with several polygons" in the user's guide.

## 31-Oct-2026 (0.6.6)

**Bugfix:** `direction='-z'` did not reverse a via port: the sign only swapped the port's x and y extent, and the port
kept the polarity of `'z'`. A via port with `'-z'` now runs from its upper to its lower metal, the opposite polarity of
`'z'`. In-plane ports (`'-x'`, `'-y'`) are unchanged. Models that use `'-z'` get the opposite sign for that port's
S-parameters than before.

The `core_transistor_3port_bce` example now explains how to use the 5-port result in a circuit simulator: the
transistor model at ports 3, 4 and 5, inductors for the DC bias, and the 0 Hz point. See
[its README](../more_examples/core_transistor_3port_bce/README.md#using-the-result-in-a-circuit-simulator).

## 26-Oct-2026

New option `settings['engine']` to choose the openEMS engine, e.g. the new GPU engine of openEMS (Metal on macOS, HIP on AMD and NVIDIA GPUs):

```python
settings['engine'] = 'gpu'
```

Without it, nothing changes: openEMS uses its default multithreaded CPU engine. The GPU engine is not in an openEMS release yet (v0.37.0 doesn't have it): openEMS has to be built from its current source code. openEMS without the GPU engine ignores `'gpu'` and runs on the CPU; gds2openEMS warns about that. See [Running on the GPU](userguide_md_format/Using_OpenEMS_Python_with_IHP_SG13G2_v3.md#running-on-the-gpu) in the user's guide.

New tool `convert2settings`: converts model scripts in the older loose-variable syntax (`fstart = 0e9`, ..., `setupSimulation(excite_ports, simulation_ports, FDTD, ...)`) to the `settings[]` syntax of the current examples, and switches the imports of a local `modules` folder to the installed gds2openEMS package.

It is installed together with gds2openEMS. Run it in a terminal (Windows: Command Prompt or PowerShell) in which the Python environment with gds2openEMS is active, the same one you use to run your models, for example:

```
convert2settings my_model.py
convert2settings my_model.py --engine gpu       # also run on the GPU
convert2settings models_folder --dry-run        # show the changes, write nothing
convert2settings --gui my_model.py              # preview side by side in a window, then convert
```

The converted model is written to `my_model_settings.py` next to the original; the original and existing files are never overwritten. A variable is only moved into `settings[]` when its meaning is certain, everything else stays a variable, and models that can't be converted safely are refused with the reason. See [Converting older models](userguide_md_format/Using_OpenEMS_Python_with_IHP_SG13G2_v3.md#converting-older-models-to-the-settings-syntax) in the user's guide.

**Bugfix:** if openEMS failed during setup, gds2openEMS still reported "FDTD simulation completed successfully". It now stops with an error.

**Bugfix:** with `settings['resonance_estimation'] = True`, numpy could print "RuntimeWarning: overflow encountered in power" during a run. The results were not affected. The warning no longer appears.

Version 0.6.5 (the GPU option and both bugfixes were already in 0.6.4).

Full history: [CHANGES.md](https://github.com/VolkerMuehlhaus/gds2openEMS/blob/main/doc/CHANGES.md)

---

**Note:** the `gds2openEMS` PyPI package itself only requires:

- gdspy>1.6.0
- CSXCAD
- openEMS
- numpy
- shapely
- PySide6

(Other Python modules mentioned above are only needed to run the example/model scripts in this repository, not to use the installed package.)
