class_docstr: Tests kernel matrix computations.
class_docstr_tok: ["Tests","kernel","matrix","computations","."]
docstr: Test that the square kernel matrix of a data set containing a single
  data point is computed correctly for the _mock_kernel above.
docstr_tok: ["Test","that","the","square","kernel","matrix","of","a","data","set","containing","a","single","data","point","is","computed","correctly","for","the","_mock_kernel","above","."]
code: def test_square_kernel_single_datapoint(self):
      """Test that the square kernel matrix of a data set containing a single
      data point is computed correctly for the _mock_kernel above."""
      X = [0.1]
  
      hist = []
  
      K1 = kern.square_kernel_matrix(
          X, partial(_mock_kernel, history=hist), True
      )
      assert not hist
      assert qml.math.array_equal(K1, np.eye(1))
      K2 = kern.square_kernel_matrix(
          X, partial(_mock_kernel, history=hist), False
      )
      assert hist == [(0.1, 0.1)]
      assert qml.math.array_equal(K2, np.eye(1))
      # When not using assume_normalized_kernel, also test batching
      hist = []
      K3 = kern.square_kernel_matrix(
          X, partial(_mock_kernel, history=hist, batch=4), False
      )
      assert hist == [(0.1, 0.1)]
      assert qml.math.array_equal(
          K3, np.array([[[val]] for val in np.linspace(1, 5, 4)])
      )
  
imports: import math
  import sys
  from functools import partial
  import pytest
  import numpy
  import pennylane
  import pennylane.kernels
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestKernelMatrix obj's underlying member method code with example usage: obj.test_square_kernel_single_datapoint() without return types