Malus RF Works

Technical Notes

Solving Pixelated Circuits — the Corner-Contact Problem Found While Reproducing a Paper

After building the electromagnetic simulator, I set myself a concrete goal: reproduce a figure from a paper.

The subject was Dall-EM by Guo et al. (Princeton University) at IMS 2025. It uses diffusion models — the same kind used for image generation — to generate circuit patterns that meet a target set of S-parameters. Each pattern is represented as 18×18 pixels, each pixel either metal or empty. Fig. 3 of the paper shows the generated low-pass, band-stop and band-pass filters together with their 10–30 GHz responses computed in HFSS.

18×18 pixels maps directly onto this simulator's grid. Here I take the low-pass filter of Fig. 3(a) (pass 10–15 GHz, reject 16–30 GHz).

Choosing the conditions

The paper's text gives neither the substrate thickness and permittivity nor the overall size (it says only "Rogers substrate"). I divided the 2 mm dimension drawn in the figure by 18 pixels to get one cell = 111.1 µm, and assumed a typical Rogers board (εr = 3.66, 167.64 µm thick, 35 µm copper).

To suit this situation, where the physical size comes first, I added "Length" as a way to enter the cell size directly in µm. Originally the cell size had to be worked back from the frequency and the cells per wavelength.

The pattern was read off the paper's figure and entered as is.

No signal at all

The first result was S21 ≈ −77 dB across 10–15 GHz, which should have been the pass band. Never mind a filter — input and output were not connected.

Looking at the pattern, the cause was obvious. There were 32 places where cells touch only at a corner, and every path from P1 to P2 had to pass through one of them.

■ □
□ ■    ← the top-left and bottom-right cells touch only at one corner point

The method of moments' rooftop basis functions carry current between two cells that share an edge. Between cells that meet at a single corner point there is no edge, so no basis function is formed and no current flows. The contact has zero width, and physically a conductor of zero width cannot carry current either.

So this is not a problem with the solver but with a degenerate shape. Another method such as HFSS would have the same issue unless it treated the contact as having some width. On a real board, etching either leaves a narrow neck that connects, or cuts it open. The paper's response assumes a connection, so the neck has to be treated as surviving.

A square of metal at each corner

So I added a square of metal of side s, centred on each corner contact, to the shape, and solved it with the same method of moments. The positions of the mesh lines are adjusted so that the edges of each square lie on them.

A diamond, rotated by 45°, might look like a more natural neck than a square. Comparing them on a line of 18 cells along a diagonal (17 corner contacts in series):

  • The diamond (centre to vertex s) and the square (side s) differ in S21 by no more than 0.13 dB. Both have the same width s√2 at their narrowest point
  • The diamond approximates its slanted edges with steps, which adds mesh lines across the whole board, and the unknowns grow from 286 to 2938 (with four steps)

So s can be thought of as "the effective width of the neck", and with the current meshing scheme the square is the better choice.

How wide should it be?

The real width of the neck is set by fabrication, so strictly you need information from the manufacturing side. To see how much the result changes when you do not know it, I varied the width (automatic mesh, 201 points).

Width ss / cellUnknownsS21 at −3 dBS21 at −10 dB
20 µm0.18622716.97 GHz18.27 GHz
26.7 µm0.24622717.17 GHz18.47 GHz
27.8 µm0.25622717.17 GHz18.47 GHz
35 µm0.32622716.95 GHz18.22 GHz
44.4 µm0.40215716.83 GHz18.09 GHz

From 0.18 to 0.4 times the cell size, the cut-off moved by about ±1 %. Making the width narrower (0.12 times) makes the mesh finer and pushes the unknowns up to 10957, making the computation heavy.

On the strength of this, the default is now a quarter of the cell size, filled in automatically. It intrudes only a little into the neighbouring empty cells, and its edges line up with the innermost layer of the automatic mesh, so the unknowns barely grow. If you know the real width, untick "Auto width (Δ/4)" and enter it.

How far did the reproduction get?

Here is the result with the current version (automatic mesh, automatic width of 27.8 µm, 6227 unknowns). The run took 11.5 s for 201 points (Apple M1, using the GPU).

Paper (read from the figure)This simulator
ShapeSharp low-passSharp low-pass
Frequency where S21 reaches −10 dBAbout 16.8 GHz18.5 GHz
S21 in the pass bandAbout −1.3 dB at 10 GHz−2.8 dB at 10 GHz, −0.4 dB at 14 GHz
S21 over 20–30 GHzStrongly attenuated−23 to −59 dB

The shape is reproduced well, but the cut-off comes out about 10 % high. The likely causes:

  • The mesh near the corner contacts: for the same shape, the way the mesh is cut moves the −10 dB point between 17.4 and 18.4 GHz. The current passes through 32 necks, so the result depends strongly on the mesh around them; this alone accounts for an uncertainty of about ±5 %
  • The port model: the paper feeds from the edge through 50 Ω feed lines and a narrow neck, while this simulator feeds vertically from the end cell of the pattern straight down to ground
  • Assumed dimensions and substrate: both the cell size and the substrate are estimates from the figure and from typical values
  • Model approximations: the formulation is quasi-static, with no dispersion and no dielectric loss. Together with the different feed, I think these explain why the pass-band loss does not match the paper

At one point I was ready to conclude that "with 111 µm cells the difference is 3.5 %", but refining the mesh showed the result swinging, and I withdrew it. Matching at one setting is not a match while the result still moves when the mesh changes.

What I learned

  • Treat a degenerate spot as a problem with the shape, not with the solver. In pixelated designs corner contacts are not exceptions but routine. The band-stop filter (b) in the same figure also has 35 corner contacts, and its ports are not connected without them
  • Where the model leaves you a choice, measure the sensitivity. The neck width moved the result by only about ±1 %, while the mesh around the necks moved it by ±5 %. Which one dominated was not clear until I measured
  • If you manufacture a generated design, decide how the necks are treated. Unless the simulation's assumption (connected) matches the real board (neck survives or is cut), both the computation and the board lose their meaning

On the grid, connected corner contacts are drawn as squares of metal at true size, and with the width set to 0 they show as red ○ marks. Change the width with "Corner-contact width" on the left. Keep an eye on these marks when you draw pixelated patterns.

Reference: Y. Guo, E. A. Karahan, Z. Li, Z. Shao, Z. Zhang, M. Wang, K. Sengupta, "Dall-EM: Generative AI with Diffusion Models for New Design Space Discovery and Target-to-Electromagnetic Structure Synthesis," IEEE/MTT-S International Microwave Symposium (IMS), 2025. DOI: 10.1109/IMS40360.2025.11103838

Back to all notes