class_docstr: Test the core functionality of the VQE module
class_docstr_tok: ["Test","the","core","functionality","of","the","VQE","module"]
docstr: Test if a ValueError is raised when multiple devices are passed when optimize=True.
docstr_tok: ["Test","if","a","ValueError","is","raised","when","multiple","devices","are","passed","when","optimize=True","."]
code: def test_multiple_devices_opt_true(self):
      """Test if a ValueError is raised when multiple devices are passed when optimize=True."""
      dev = [
          qml.device("default.qubit", wires=2),
          qml.device("default.qubit", wires=2),
      ]
  
      h = qml.Hamiltonian([1, 1], [qml.PauliZ(0), qml.PauliZ(1)])
  
      with pytest.raises(
          ValueError,
          match="Using multiple devices is not supported when",
      ):
          catch_warn_ExpvalCost(
              qml.templates.StronglyEntanglingLayers,
              h,
              dev,
              optimize=True,
          )
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 15 for calling the TestVQE obj's underlying member method code with example usage: obj.test_multiple_devices_opt_true() without return types