code: def checkLobpcgMonotonicity(self, matrix_name, n, k, m, tol, dtype):
      del tol
      A, eigs = _concrete_generators(dtype)[matrix_name](n, k)
      X = self.rng().standard_normal(size=(n, k)).astype(dtype)
  
      _theta, _U, _i, info = linalg._lobpcg_standard_matrix(
          A, X, m, tol=0, debug=True
      )
      self.assertArraysEqual(
          info["X zeros"], jnp.zeros_like(info["X zeros"])
      )
  
      # To check for any divergence, make sure that the last 20% of
      # steps have lower worst-case relerr than first 20% of steps,
      # at least up to an order of magnitude.
      #
      # This is non-trivial, as many implementations have catastrophic
      # cancellations at convergence for residual terms, and rely on
      # brittle locking tolerance to avoid divergence.
      eigs = eigs[:k]
      relerrs = np.abs(np.array(info["lambda history"]) - eigs) / eigs
      few_steps = max(m // 5, 1)
      self.assertLess(
          relerrs[-few_steps:].max(axis=1).mean(),
          10 * relerrs[:few_steps].max(axis=1).mean(),
      )
  
      self._possibly_plot(A, eigs, X, m, matrix_name)
  
imports: import functools
  import re
  import os
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import scipy.linalg
  import scipy.sparse
  import jax
  from jax import config
  from jax._src import test_util
  from jax.experimental.sparse import linalg, bcoo
  import jax.numpy
label_desc: Use image node_id 2 for calling the LobpcgTest obj's underlying member method code with example usage: obj.checkLobpcgMonotonicity(matrix_name, n, k, m, tol, dtype) without return types