class_docstr: Test the core functionality of the VQE module
class_docstr_tok: ["Test","the","core","functionality","of","the","VQE","module"]
docstr: Test that an error is raised if attempting to use ExpvalCost to measure
  variances
docstr_tok: ["Test","that","an","error","is","raised","if","attempting","to","use","ExpvalCost","to","measure","variances"]
code: def test_variance_error(self):
      """Test that an error is raised if attempting to use ExpvalCost to measure
      variances"""
      dev = qml.device("default.qubit", wires=4)
      hamiltonian = big_hamiltonian
  
      with pytest.raises(
          ValueError, match="sums of expectation values"
      ):
          catch_warn_ExpvalCost(
              qml.templates.StronglyEntanglingLayers,
              hamiltonian,
              dev,
              measure="var",
          )
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 16 for calling the TestVQE obj's underlying member method code with example usage: obj.test_variance_error() without return types