Skip to content

Fix port impedance and complex voltage reconstruction in 2N AC sweep solver - #45

Merged
cdaunt merged 1 commit into
mainfrom
fix/issue-43-2n-ac-sweep-bugs
Aug 6, 2026
Merged

Fix port impedance and complex voltage reconstruction in 2N AC sweep solver#45
cdaunt merged 1 commit into
mainfrom
fix/issue-43-2n-ac-sweep-bugs

Conversation

@cdaunt

@cdaunt cdaunt commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed port termination impedance missing from imaginary block in _setup_ac_sweep_2n (only real diagonal was set)
  • Fixed complex port voltage reconstruction dropping imaginary component during backsubstitution
  • Both bugs affected all holomorphic=False AC sweeps

Details

  • Port impedance now correctly set for both real block [port, port] and imaginary block [port+N, port+N]
  • Complex voltage reconstruction now uses full state vector: V[port_nodes, :] + 1j * V[port_nodes + N, :]
  • Tightened tests from magnitude-only (jnp.abs) to full complex comparison
  • Added new lossy waveguide test case where |S11| < 1 validates physical correctness

Fixes #43

…in 2N solver

Two bugs in _setup_ac_sweep_2n:
- Port termination impedance was missing from imaginary diagonal block
- Complex port voltage reconstruction silently dropped the imaginary part

Tests tightened to full complex comparison; added lossy waveguide test.

Closes #43
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cdaunt
cdaunt marked this pull request as ready for review July 31, 2026 13:06
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cdaunt
cdaunt merged commit 0ce834d into main Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split 2N complex AC sweep fixes out of feat-time-delay

1 participant