Skip to content

Commit fc8c34a

Browse files
authored
Merge pull request #21 from beamzorg/change
[Fix]: Fix numerical handling in scipy_reference.py
2 parents b3715a4 + 4e5bcfa commit fc8c34a

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# micromode
22

33
An **electromagnetic mode solver** using the **[FDFD method](https://en.wikipedia.org/wiki/Finite-difference_frequency-domain_method)** on a **[rectilinear Yee-grid](https://en.wikipedia.org/wiki/Finite-difference_time-domain_method)**.
4-
MicroMode is a transparent, grid-first SciPy mode solver for rasterized
5-
photonics workflows.
64

75
```bash
86
pip install micromode

python/micromode/scipy_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ def _real_arpack_problem_if_close(matrix, initial_vector: np.ndarray | None, gue
664664
# If the complex part is numerical noise, cast to real to avoid SciPy's
665665
# ComplexWarning path and improve reproducibility.
666666
if np.max(np.abs(matrix_imag)) <= 1e-14 * matrix_scale and guess_is_real:
667-
real_vector = None if initial_vector is None else np.asarray(initial_vector.real, dtype=float)
667+
real_vector = None if initial_vector is None else np.asarray(np.real(initial_vector), dtype=float)
668668
return matrix.real.astype(float), real_vector, float(guess.real)
669669
return matrix, initial_vector, guess
670670

0 commit comments

Comments
 (0)