Skip to content

Commit 5710ac8

Browse files
committed
Fixed loss in ideal.waveguide
1 parent e7409a0 commit 5710ac8

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55

66
---
77

8-
## [0.7.1](https://github.com/BYUCamachoLab/simphony/tree/v0.7.0) - <small>2024-01-09</small>
8+
## [0.7.2](https://github.com/BYUCamachoLab/simphony/tree/v0.7.2) - <small>2024-01-09</small>
9+
10+
Minor bug fixes.
11+
12+
### Fixed
13+
- Bug in loss of waveguide in ideal library was fixed.
14+
15+
---
16+
17+
## [0.7.1](https://github.com/BYUCamachoLab/simphony/tree/v0.7.1) - <small>2024-01-09</small>
918

1019
Minor bug fixes.
1120

Diff for: simphony/libraries/ideal.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ def waveguide(
8686
dneff_dwl = (ng - neff) / wl0
8787
_neff = neff - dwl * dneff_dwl
8888
phase = 2 * jnp.pi * _neff * length / wl
89-
amplitude = jnp.asarray(10 ** (-loss * length / 20), dtype=complex)
89+
# amplitude = jnp.asarray(10 ** (-loss * length / 20), dtype=complex)
90+
loss_mag = loss / (10 * jnp.log10(jnp.exp(1)))
91+
alpha = loss_mag * 1e-4
92+
amplitude = jnp.asarray(jnp.exp(-alpha * length / 2), dtype=complex)
9093
transmission = amplitude * jnp.exp(1j * phase)
9194
sdict = sax.reciprocal(
9295
{

0 commit comments

Comments
 (0)