diff --git a/raytracing/matrixgroup.py b/raytracing/matrixgroup.py
index fe54cb8..b34038c 100644
--- a/raytracing/matrixgroup.py
+++ b/raytracing/matrixgroup.py
@@ -10,6 +10,7 @@ class MatrixGroup(Matrix):
     """
 
     def __init__(self, elements=None, label=""):
+        self.iteration = 0
         super(MatrixGroup, self).__init__(1, 0, 0, 1, label=label)
 
         self.elements = []
@@ -36,7 +37,7 @@ class MatrixGroup(Matrix):
         if len(self.elements) != 0:
             lastElement = self.elements[-1]
             if lastElement.backIndex != matrix.frontIndex:
-                if isinstance(matrix, Space): # For Space(), we fix it
+                if isinstance(matrix, Space):  # For Space(), we fix it
                     msg = "Fixing mismatched indices between last element and appended Space(). Use Space(d=someDistance, n=someIndex)."
                     warnings.warn(msg, UserWarning)
                     matrix.frontIndex = lastElement.backIndex
@@ -55,12 +56,6 @@ class MatrixGroup(Matrix):
         self.frontVertex = transferMatrix.frontVertex
         self.backVertex = transferMatrix.backVertex
 
-    def ImagingPath(self):
-        return ImagingPath(elements=self.elements, label=self.label)
-
-    def LaserPath(self):
-        return LaserPath(elements=self.elements, label=self.label)
-
     def transferMatrix(self, upTo=float('+Inf')):
         """ The transfer matrix between front edge and distance=upTo
 
@@ -227,3 +222,16 @@ class MatrixGroup(Matrix):
             axes.annotate(label, xy=(z, 0.0), xytext=(z, -halfHeight * 0.5),
                           xycoords='data', fontsize=12,
                           ha='center', va='bottom')
+
+    def __iter__(self):
+        self.iteration = 0
+        return self
+
+    def __next__(self):
+        if self.elements is None:
+            raise StopIteration
+        if self.iteration < len(self.elements):
+            element = self.elements[self.iteration]
+            self.iteration += 1
+            return element
+        raise StopIteration

ImagingPath and LaserPath methods in MatrixGroup raise exception.
They respectively return a ImagingPath instance and a LaserPath instance, but those classes are in other files not imported. It is also worth mentioning that they both inherit from MatrixGroup, so it is kind of incoherent to use them in MatrixGroup.

Question:
Are those methods really necessary in MatrixGroup?
- Yes: We have to find a way to import them without having a circular import problem.
- No: We should remove them.
diff --git a/raytracing/tests/testsMatrixGroup.py b/raytracing/tests/testsMatrixGroup.py
index 6d587cb..d473aa7 100644
--- a/raytracing/tests/testsMatrixGroup.py
+++ b/raytracing/tests/testsMatrixGroup.py
@@ -319,6 +319,11 @@ class TestMatrixGroup(unittest.TestCase):
         self.assertEqual(mg.D, supposedMatrix.D)
         self.assertEqual(mg.L, supposedMatrix.L)
 
+    def testInitWithAnotherMatrixGroup(self):
+        mg = MatrixGroup([Lens(5)])
+        mg2 = MatrixGroup(mg)
+        self.assertListEqual(mg.elements, mg2.elements)
+
 
 if __name__ == '__main__':
     unittest.main()

pip install -e .
parse_log_pytest
requirements.txt
pytest
3.6
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
cycler==0.11.0
docutils==0.18.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
kiwisolver==1.3.1
MarkupSafe==2.0.1
matplotlib==3.3.4
numpy==1.19.5
packaging==21.3
Pillow==8.4.0
pluggy==1.0.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
pytz==2025.2
-e git+https://github.com/DCC-Lab/RayTracing.git@fe768d07b48df2be9428da6dc3d7f738c652915e#egg=raytracing
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==0.4.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.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
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - 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=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - cycler==0.11.0
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - kiwisolver==1.3.1
      - markupsafe==2.0.1
      - matplotlib==3.3.4
      - numpy==1.19.5
      - packaging==21.3
      - pillow==8.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==0.4.3
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/RayTracing

raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testInitWithAnotherMatrixGroup
raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testAppendNoElementInit raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testAppendNoRefractionIndicesMismatch raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testAppendNotCorrectType raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testAppendRefractionIndicesMismatch raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testAppendSpaceMustAdoptIndexOfRefraction raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testFlipOrientation raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testFlipOrientationEmptyGroup raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testHasFiniteApertutreDiameter raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testIntermediateConjugates raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testIntermediateConjugatesEmptyGroup raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testIntermediateConjugatesNoConjugate raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testIntermediateConjugatesNoThickness raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testLargestDiameter raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testLargestDiameterNoFiniteAperture raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testLargestDiameterWithEmptyGroup raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testMatrixGroup raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testMatrixGroupAcceptsAnything raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testMatrixGroupWithElements raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTrace raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTraceEmptyMatrixGroup raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTraceIncorrectType raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTransferMatrices raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTransferMatricesNoElements raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTransferMatrix raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTransferMatrixNoElements raytracing/tests/testsMatrixGroup.py::TestMatrixGroup::testTransferMatrixUpToInGroup
raytracing/matrixgroup.py
raytracing/matrixgroup.py