code: def mathematics_linsolver_cg(matrix=mtx, max_iter=1000, seed=10):
      # Create a Hermitian sparse matrix
      from scipy.sparse import eye
  
      rows = matrix.shape[0]
      cols = matrix.shape[1]
      A = matrix.transpose() * matrix + eye(rows, cols)
  
      # Create a random vector (b) of the system Ax=b
      numpy.random.seed(seed)
      b = numpy.array(numpy.random.randn(rows))
  
      # create linear system with linear operator and vector
      from scipy.sparse import csc_matrix
  
      try:
          from shogun.Mathematics import RealSparseMatrixOperator
          from shogun.Mathematics import ConjugateGradientSolver
  
          op = RealSparseMatrixOperator(A.tocsc())
          solver = ConjugateGradientSolver()
  
          # set the iteration limit higher for poorly conditioned matrices
          solver.set_iteration_limit(max_iter)
          x = solver.solve(op, b)
  
          # verifying the solution via direct solving
          from scipy.sparse.linalg import spsolve, eigsh
  
          y = spsolve(A, b)
          print(numpy.linalg.norm(x - y))
  
          return x
  
      except ImportError:
          print("Shogun not installed with Eigen3!")
  
label_desc: Use image node_id 1 for calling a global function with example usage: mathematics_linsolver_cg(matrix, max_iter, seed) and returns: x