Skip to content

Commit 8783a9a

Browse files
committed
pre-commit
1 parent 8281d8e commit 8783a9a

3 files changed

Lines changed: 63 additions & 66 deletions

File tree

docs/references.bib

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
@article{ghioneAnalyticalFormulasCoplanar1984,
2+
title = {Analytical Formulas for Coplanar Lines in Hybrid and Monolithic {{MICs}}},
3+
author = {Ghione, G. and Naldi, C.},
4+
year = {1984},
5+
month = feb,
6+
journal = {Electronics Letters},
7+
volume = {20},
8+
number = {4},
9+
pages = {179--181},
10+
publisher = {The Institution of Engineering and Technology},
11+
doi = {10.1049/el:19840120},
12+
abstract = {Some analytical formulas for the parameters of coplanar lines are discussed and validated; a chart is given for the design of coplanar waveguides on GaAs. The formulas discussed here, together with those presented previously by us (1983) represent a suitable set for the design of coplanar lines for hybrid and monolithic MICs (microwave integrated circuits).}
13+
}
14+
@book{guptaMicrostripLinesSlotlines1996,
15+
title = {Microstrip Lines and Slotlines},
16+
author = {Gupta, Kuldip C. and Garg, R. and Bahl, I. and Bhartia, P.},
17+
year = {1996},
18+
edition = {2. ed},
19+
publisher = {Artech House},
20+
address = {Boston},
21+
isbn = {978-0-89006-766-6},
22+
langid = {english}
23+
}
24+
@inproceedings{hammerstadAccurateModelsMicrostrip1980,
25+
title = {Accurate {{Models}} for {{Microstrip Computer-Aided Design}}},
26+
booktitle = {1980 {{IEEE MTT-S International Microwave}} Symposium {{Digest}}},
27+
author = {Hammerstad, E. and Jensen, O.},
28+
year = {1980},
29+
pages = {407--409},
30+
publisher = {IEEE},
31+
address = {Washington, DC, USA},
32+
doi = {10.1109/MWSYM.1980.1124303}
33+
}
134
@misc{numpy-docs,
235
title = {Numpy Documentation},
336
author = {Travis Oliphant},
@@ -33,43 +66,15 @@ @misc{pythonformaths
3366
year = {2021},
3467
url = {https://github.erc.monash.edu.au/andrease/Python4Maths}
3568
}
36-
37-
@article{ghioneAnalyticalFormulasCoplanar1984,
38-
title = {Analytical Formulas for Coplanar Lines in Hybrid and Monolithic {{MICs}}},
39-
author = {Ghione, G. and Naldi, C.},
40-
year = {1984},
41-
month = feb,
42-
journal = {Electronics Letters},
43-
volume = {20},
44-
number = {4},
45-
pages = {179--181},
46-
publisher = {The Institution of Engineering and Technology},
47-
doi = {10.1049/el:19840120},
48-
abstract = {Some analytical formulas for the parameters of coplanar lines are discussed and validated; a chart is given for the design of coplanar waveguides on GaAs. The formulas discussed here, together with those presented previously by us (1983) represent a suitable set for the design of coplanar lines for hybrid and monolithic MICs (microwave integrated circuits).}
49-
}
50-
51-
@book{guptaMicrostripLinesSlotlines1996,
52-
title = {Microstrip Lines and Slotlines},
53-
author = {Gupta, Kuldip C. and Garg, R. and Bahl, I. and Bhartia, P.},
54-
year = {1996},
55-
edition = {2. ed},
56-
publisher = {Artech House},
57-
address = {Boston},
58-
isbn = {978-0-89006-766-6},
59-
langid = {english}
60-
}
61-
62-
@inproceedings{hammerstadAccurateModelsMicrostrip1980,
63-
title = {Accurate {{Models}} for {{Microstrip Computer-Aided Design}}},
64-
booktitle = {1980 {{IEEE MTT-S International Microwave}} Symposium {{Digest}}},
65-
author = {Hammerstad, E. and Jensen, O.},
66-
year = {1980},
67-
pages = {407--409},
68-
publisher = {IEEE},
69-
address = {Washington, DC, USA},
70-
doi = {10.1109/MWSYM.1980.1124303}
69+
@manual{qucs_technical_papers,
70+
title = {Qucs Technical Papers},
71+
author = {Stefan Jahn and Michael Margraf and Vincent Habchi and Raimund Jacob},
72+
organization = {Qucs (Quite Universal Circuit Simulator) Project},
73+
year = {2007},
74+
month = dec,
75+
url = {https://qucs.sourceforge.net/docs/technical/technical.pdf},
76+
urldate = {2026-03-13}
7177
}
72-
7378
@book{simonsCoplanarWaveguideCircuits2001,
7479
title = {Coplanar Waveguide Circuits, Components, and Systems},
7580
author = {Simons, Rainee},
@@ -82,13 +87,3 @@ @book{simonsCoplanarWaveguideCircuits2001
8287
isbn = {978-0-471-22475-4 978-0-471-46393-1},
8388
langid = {english}
8489
}
85-
86-
@manual{qucs_technical_papers,
87-
title = {Qucs Technical Papers},
88-
author = {Stefan Jahn and Michael Margraf and Vincent Habchi and Raimund Jacob},
89-
organization = {Qucs (Quite Universal Circuit Simulator) Project},
90-
year = {2007},
91-
month = dec,
92-
url = {https://qucs.sourceforge.net/docs/technical/technical.pdf},
93-
urldate = {2026-03-13}
94-
}

src/sax/saxtypes/singlemode.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@ def val_instance_port(obj: Any) -> InstancePort:
189189
SCooSM: TypeAlias = tuple[IntArray1D, IntArray1D, ComplexArray, PortMapSM]
190190
"""A sparse S-matrix in COO format (recommended for internal library use only).
191191
192-
An `SCoo` is a sparse matrix based representation of an S-matrix consisting of three
193-
arrays and a port map. The three arrays represent the output port indices [`int`] (rows),
194-
input port indices [`int`] (columns) and the S-matrix values [`ComplexFloat`] of the sparse
195-
matrix. The port map maps a port name [`str`] to a port index [`int`].
192+
An `SCoo` is a sparse matrix based representation of an S-matrix consisting
193+
of three arrays and a port map. The three arrays represent the output port
194+
indices [`int`] (rows), input port indices [`int`] (columns) and the
195+
S-matrix values [`ComplexFloat`] of the sparse matrix. The port map maps a
196+
port name [`str`] to a port index [`int`].
196197
197198
Only these four arrays **together** and in this specific **order** are considered a
198199
valid `SCoo` representation!
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
"""Test S-matrix convention: SDense S[i,j] = output at i for input at j (standard)."""
1+
"""Test S-matrix convention: SDense S[i,j] = output at i for input at j."""
22

3+
import jax.numpy as jnp
34
import numpy as np
45

56
import sax
67

78
# Non-reciprocal reference: forward transmission only (in->out), no reverse
8-
SDICT_REF = {
9-
("in", "in"): 0.0 + 0.0j,
10-
("in", "out"): 1.0 + 0.0j, # from in to out
11-
("out", "in"): 0.0 + 0.0j, # NO reverse path
12-
("out", "out"): 0.0 + 0.0j,
9+
SDICT_REF: sax.SDict = {
10+
("in", "in"): jnp.array(0.0 + 0.0j),
11+
("in", "out"): jnp.array(1.0 + 0.0j), # from in to out
12+
("out", "in"): jnp.array(0.0 + 0.0j), # NO reverse path
13+
("out", "out"): jnp.array(0.0 + 0.0j),
1314
}
1415

1516

1617
# --- SDense convention ---
1718

1819

19-
def test_sdense_convention():
20+
def test_sdense_convention() -> None:
2021
"""S[out_idx, in_idx] should hold the in->out transmission."""
2122
S, pm = sax.sdense(SDICT_REF)
2223
assert float(S[pm["out"], pm["in"]].real) == 1.0
@@ -26,27 +27,27 @@ def test_sdense_convention():
2627
# --- Round-trips: every (source, target) pair ---
2728

2829

29-
def test_sdict_to_scoo_to_sdict():
30+
def test_sdict_to_scoo_to_sdict() -> None:
3031
result = sax.sdict(sax.scoo(SDICT_REF))
3132
for k, v in SDICT_REF.items():
3233
np.testing.assert_allclose(float(result[k].real), float(complex(v).real))
3334

3435

35-
def test_sdict_to_sdense_to_sdict():
36+
def test_sdict_to_sdense_to_sdict() -> None:
3637
result = sax.sdict(sax.sdense(SDICT_REF))
3738
for k, v in SDICT_REF.items():
3839
np.testing.assert_allclose(float(result[k].real), float(complex(v).real))
3940

4041

41-
def test_scoo_to_sdict_to_scoo():
42+
def test_scoo_to_sdict_to_scoo() -> None:
4243
scoo1 = sax.scoo(SDICT_REF)
4344
scoo2 = sax.scoo(sax.sdict(scoo1))
4445
np.testing.assert_array_equal(scoo1[0], scoo2[0]) # Si
4546
np.testing.assert_array_equal(scoo1[1], scoo2[1]) # Sj
4647
np.testing.assert_array_almost_equal(scoo1[2], scoo2[2]) # Sx
4748

4849

49-
def test_scoo_to_sdense_to_scoo():
50+
def test_scoo_to_sdense_to_scoo() -> None:
5051
scoo1 = sax.scoo(SDICT_REF)
5152
sdense = sax.sdense(scoo1)
5253
scoo2 = sax.scoo(sdense)
@@ -56,13 +57,13 @@ def test_scoo_to_sdense_to_scoo():
5657
np.testing.assert_array_almost_equal(S1, S2)
5758

5859

59-
def test_sdense_to_sdict_to_sdense():
60+
def test_sdense_to_sdict_to_sdense() -> None:
6061
sdense1 = sax.sdense(SDICT_REF)
6162
sdense2 = sax.sdense(sax.sdict(sdense1))
6263
np.testing.assert_array_almost_equal(sdense1[0], sdense2[0])
6364

6465

65-
def test_sdense_to_scoo_to_sdense():
66+
def test_sdense_to_scoo_to_sdense() -> None:
6667
sdense1 = sax.sdense(SDICT_REF)
6768
sdense2 = sax.sdense(sax.scoo(sdense1))
6869
np.testing.assert_array_almost_equal(sdense1[0], sdense2[0])
@@ -71,7 +72,7 @@ def test_sdense_to_scoo_to_sdense():
7172
# --- Full chain: sdict -> scoo -> sdense -> sdict ---
7273

7374

74-
def test_full_chain_sdict_scoo_sdense_sdict():
75+
def test_full_chain_sdict_scoo_sdense_sdict() -> None:
7576
scoo = sax.scoo(SDICT_REF)
7677
sdense = sax.sdense(scoo)
7778
result = sax.sdict(sdense)
@@ -82,9 +83,9 @@ def test_full_chain_sdict_scoo_sdense_sdict():
8283
# --- SCoo convention ---
8384

8485

85-
def test_scoo_convention():
86+
def test_scoo_convention() -> None:
8687
"""SCoo Si = row = output port index, Sj = col = input port index."""
87-
Si, Sj, Sx, pm = sax.scoo({("in", "out"): 1.0})
88+
Si, Sj, _Sx, pm = sax.scoo({("in", "out"): jnp.array(1.0)})
8889
# The single entry should have Si = out index (row), Sj = in index (col)
8990
assert int(Si[0]) == pm["out"]
9091
assert int(Sj[0]) == pm["in"]

0 commit comments

Comments
 (0)