diff --git a/raytracing/laserpath.py b/raytracing/laserpath.py
index 4f74727..edcf1b2 100644
--- a/raytracing/laserpath.py
+++ b/raytracing/laserpath.py
@@ -1,6 +1,7 @@
 from .matrixgroup import *
 from .imagingpath import *
 
+
 class LaserPath(MatrixGroup):
     """LaserPath: the main class of the module for coherent
     laser beams: it is the combination of Matrix() or MatrixGroup()
@@ -17,6 +18,7 @@ class LaserPath(MatrixGroup):
     is set to indicate it, but it will propagate nevertheless
     and without diffraction due to that aperture.
     """
+
     def __init__(self, elements=None, label=""):
         self.inputBeam = None
         self.isResonator = False
@@ -33,11 +35,14 @@ class LaserPath(MatrixGroup):
         round trip: you will need to duplicate elements in reverse
         and append them manually. 
         """
+        if not self.hasPower:
+            return None, None
+
         b = self.D - self.A
-        sqrtDelta = cmath.sqrt(b*b + 4.0 *self.B *self.C)
-        
-        q1 = (- b + sqrtDelta)/(2.0*self.C)
-        q2 = (- b - sqrtDelta)/(2.0*self.C)
+        sqrtDelta = cmath.sqrt(b * b + 4.0 * self.B * self.C)
+
+        q1 = (- b + sqrtDelta) / (2.0 * self.C)
+        q2 = (- b - sqrtDelta) / (2.0 * self.C)
 
         return (GaussianBeam(q=q1), GaussianBeam(q=q2))
 
@@ -49,10 +54,10 @@ class LaserPath(MatrixGroup):
 
         (q1, q2) = self.eigenModes()
         q = []
-        if q1.isFinite:
+        if q1 is not None and q1.isFinite:
             q.append(q1)
 
-        if q2.isFinite:
+        if q2 is not None and q2.isFinite:
             q.append(q2)
 
         return q
@@ -133,12 +138,11 @@ class LaserPath(MatrixGroup):
         for element in self.elements:
             if isinstance(element, Space):
                 for i in range(N):
-                    highResolution.append(Space(d=element.L/N, 
+                    highResolution.append(Space(d=element.L / N,
                                                 n=element.frontIndex))
             else:
                 highResolution.append(element)
 
-
         beamTrace = highResolution.trace(beam)
         (x, y) = self.rearrangeBeamTraceForPlotting(beamTrace)
         axes.plot(x, y, 'r', linewidth=1)
@@ -166,11 +170,11 @@ class LaserPath(MatrixGroup):
             position = beam.z + relativePosition
             size = beam.waist
 
-            axes.arrow(position, size+arrowSize, 0, -arrowSize,
-                width=0.1, fc='g', ec='g',
-                head_length=arrowHeight, head_width=arrowWidth,
-                length_includes_head=True)
-            axes.arrow(position, -size-arrowSize, 0, arrowSize,
-                width=0.1, fc='g', ec='g',
-                head_length=arrowHeight, head_width=arrowWidth,
-                length_includes_head=True)
+            axes.arrow(position, size + arrowSize, 0, -arrowSize,
+                       width=0.1, fc='g', ec='g',
+                       head_length=arrowHeight, head_width=arrowWidth,
+                       length_includes_head=True)
+            axes.arrow(position, -size - arrowSize, 0, arrowSize,
+                       width=0.1, fc='g', ec='g',
+                       head_length=arrowHeight, head_width=arrowWidth,
+                       length_includes_head=True)

EigenModes of LaserPath fails with exception when C = 0
When we create a `LaserPath` and its C component is 0, we have a division by 0, which raises an exception. We should check if the laser path has power (`self.hasPower`) before and return `(None, None)`  (maybe?) if not. We then need to change other methods, like `laserModes` and `display`.
diff --git a/raytracing/tests/testsLaserPath.py b/raytracing/tests/testsLaserPath.py
new file mode 100644
index 0000000..6b90b03
--- /dev/null
+++ b/raytracing/tests/testsLaserPath.py
@@ -0,0 +1,26 @@
+import unittest
+import envtest  # modifies path
+from raytracing import *
+
+inf = float("+inf")
+
+
+class TestLaserPath(unittest.TestCase):
+
+    def testEigenModes(self):
+        lp = LaserPath([Space(10)])
+        self.assertTupleEqual(lp.eigenModes(), (None, None))
+
+        lp = LaserPath()
+        self.assertTupleEqual(lp.eigenModes(), (None, None))
+
+        lp = LaserPath([CurvedMirror(-10)])
+        self.assertNotEqual(lp.eigenModes(), (None, None))
+
+    def testLaserModes(self):
+        lp = LaserPath()
+        self.assertListEqual(lp.laserModes(), [])
+
+
+if __name__ == '__main__':
+    unittest.main()

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
contourpy==1.3.0
cycler==0.12.1
exceptiongroup==1.2.2
fonttools==4.56.0
importlib_resources==6.5.2
iniconfig==2.1.0
kiwisolver==1.4.7
matplotlib==3.9.4
numpy==2.0.2
packaging==24.2
pillow==11.1.0
pluggy==1.5.0
pyparsing==3.2.3
pytest==8.3.5
python-dateutil==2.9.0.post0
-e git+https://github.com/DCC-Lab/RayTracing.git@03535abea0f84ad4eeb61c8da671579d95d6217e#egg=raytracing
six==1.17.0
tomli==2.2.1
zipp==3.21.0

name: RayTracing
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - contourpy==1.3.0
      - cycler==0.12.1
      - exceptiongroup==1.2.2
      - fonttools==4.56.0
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - kiwisolver==1.4.7
      - matplotlib==3.9.4
      - numpy==2.0.2
      - packaging==24.2
      - pillow==11.1.0
      - pluggy==1.5.0
      - pyparsing==3.2.3
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - six==1.17.0
      - tomli==2.2.1
      - zipp==3.21.0
prefix: /opt/conda/envs/RayTracing

raytracing/tests/testsLaserPath.py::TestLaserPath::testEigenModes raytracing/tests/testsLaserPath.py::TestLaserPath::testLaserModes
raytracing/laserpath.py
raytracing/laserpath.py