code: def test_homomorphism():
      GLZ_B = MG.GLZ(B, "xy")
      GLZ_D = MG.GLZ(D, "ij")
      GLZ_BD = MG.product_homomorphism(GLZ_B, GLZ_D)
  
      assert np.allclose(GLZ_BD.matrix[:2, :2], GLZ_B.matrix)
      assert np.allclose(GLZ_BD.matrix[2:, 2:], GLZ_D.matrix)
      assert np.allclose(GLZ_BD.matrix[2:, :2], 0)
      assert np.allclose(GLZ_BD.matrix[:2, 2:], 0)
  
      GLZ_C = MG.GLZ(D, "xy")
      # have the same axisnames, an exception will be raised
      pytest.raises(ValueError, MG.product_homomorphism, GLZ_C, GLZ_B)
  
      E = np.array([[7, 8], [8, 9]])
      GLZ_E = MG.GLZ(E, "ij")
  
      F = np.array([[6, 7], [5, 6]])
      GLZ_F = MG.GLZ(E, "xy")
  
      GLZ_FE = MG.product_homomorphism(GLZ_F, GLZ_E)
  
      test1 = MG.product(GLZ_FE, GLZ_BD)
      test2 = MG.product_homomorphism(
          MG.product(GLZ_F, GLZ_B), MG.product(GLZ_E, GLZ_D)
      )
      assert np.allclose(test1.matrix, test2.matrix)
  
file_path: nipy/nipy/core/reference/tests/test_matrix_groups.py
imports: import numpy
  import pytest
  from scipy.linalg import expm
  import nipy.core.reference.tests.matrix_groups
  from nipy.core.api import ArrayCoordMap
label_desc: Use image node_id 7 for calling a global function with example usage: test_homomorphism() without return types