code: def test_cglb_check_basics() -> None:
      """
      * Quadratic term of CGLB with v=0 is equivalent to the quadratic term of SGPR.
      * Log determinant term of CGLB is less or equal to SGPR log determinant.
          In the test the `logdet_term` method returns negative half of the logdet bound,
          therefore we run the opposite direction of the sign.
      """
  
      rng: np.random.RandomState = np.random.RandomState(999)
      train, z, _ = data(rng)
      noise = 0.2
  
      sgpr = SGPR(
          train,
          kernel=SquaredExponential(),
          inducing_variable=z,
          noise_variance=noise,
      )
  
      # `v_grad_optimization=True` turns off the CG in the quadratic term
      cglb = CGLB(
          train,
          kernel=SquaredExponential(),
          inducing_variable=z,
          noise_variance=noise,
          v_grad_optimization=True,
      )
  
      sgpr_common = sgpr._common_calculation()
      cglb_common = cglb._common_calculation()
  
      sgpr_quad_term = sgpr.quad_term(sgpr_common)
      cglb_quad_term = cglb.quad_term(cglb_common)
      np.testing.assert_almost_equal(sgpr_quad_term, cglb_quad_term)
  
      sgpr_logdet = sgpr.logdet_term(sgpr_common)
      cglb_logdet = cglb.logdet_term(cglb_common)
      assert cglb_logdet >= sgpr_logdet
  
      x = train[0]
      K = SquaredExponential()(x) + noise * tf.eye(
          x.shape[0], dtype=default_float()
      )
      gpr_logdet = -0.5 * tf.linalg.logdet(K)
      assert cglb_logdet <= gpr_logdet
  
file_path: GPflow/tests/gpflow/models/test_cglb.py
imports: from typing import Tuple, cast
  import numpy
  import tensorflow
  from check_shapes import check_shapes
  from gpflow.base import AnyNDArray, RegressionData
  from gpflow.config import default_float
  from gpflow.kernels import SquaredExponential
  from gpflow.models import CGLB, GPR, SGPR
  from gpflow.models.cglb import NystromPreconditioner, cglb_conjugate_gradient
  from gpflow.utilities import to_default_float
label_desc: Use image node_id 2 for calling a global function with example usage: test_cglb_check_basics() without return types