class_docstr: Test the core functionality of the VQE module
class_docstr_tok: ["Test","the","core","functionality","of","the","VQE","module"]
docstr: Tests that the cost function evaluates properly
docstr_tok: ["Tests","that","the","cost","function","evaluates","properly"]
code: def test_cost_evaluate(self, params, ansatz, coeffs, observables):
      """Tests that the cost function evaluates properly"""
      hamiltonian = qml.Hamiltonian(coeffs, observables)
      dev = qml.device("default.qubit", wires=3)
      expval = catch_warn_ExpvalCost(ansatz, hamiltonian, dev)
      assert expval(params).dtype == np.float64
      assert np.shape(expval(params)) == ()
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestVQE obj's underlying member method code with example usage: obj.test_cost_evaluate(params, ansatz, coeffs, observables) without return types