class_docstr: Testing differentiable ZNE
class_docstr_tok: ["Testing","differentiable","ZNE"]
docstr: Testing the custom diffable _polyfit function
docstr_tok: ["Testing","the","custom","diffable","_polyfit","function"]
code: def test_polyfit(self):
      """Testing the custom diffable _polyfit function"""
      # pylint: disable=protected-access
      x = np.linspace(1, 4, 4)
      y = 3.0 * x**2 + 2.0 * x + 1.0
      coeffs = qml.transforms.mitigate._polyfit(x, y, 2)
      assert qml.math.allclose(qml.math.squeeze(coeffs), [3, 2, 1])
  
imports: from functools import partial
  import pytest
  from packaging import version
  import pennylane
  from pennylane import numpy
  from pennylane.tape import QuantumScript
  from pennylane.transforms import mitigate_with_zne, richardson_extrapolate, fold_global
label_desc: Use image node_id 2 for calling the TestDifferentiableZNE obj's underlying member method code with example usage: obj.test_polyfit() without return types