class_docstr: Integration test to ensure that the optimizer
  minimizes simple examples
docstr: Test that a simple VQE circuit can be optimized
docstr_tok: ["Test","that","a","simple","VQE","circuit","can","be","optimized"]
code: def test_vqe_optimization(self):
      """Test that a simple VQE circuit can be optimized"""
      dev = qml.device("default.qubit", wires=2, shots=100)
      coeffs = [0.1, 0.2]
      obs = [qml.PauliZ(0), qml.PauliX(0)]
      H = qml.Hamiltonian(coeffs, obs)
  
      def ansatz(x, **kwargs):
          qml.Rot(*x[0], wires=0)
          qml.Rot(*x[1], wires=1)
          qml.CNOT(wires=[0, 1])
          qml.Rot(*x[2], wires=0)
          qml.Rot(*x[3], wires=1)
          qml.CNOT(wires=[0, 1])
  
      cost = catch_warn_ExpvalCost(ansatz, H, dev)
      params = np.random.random((4, 3), requires_grad=True)
      initial_loss = cost(params)
  
      min_shots = 10
      loss = initial_loss
      opt = qml.ShotAdaptiveOptimizer(min_shots=10)
  
      for _ in range(100):
          params = opt.step(cost, params)
          loss = cost(params)
  
      assert loss < initial_loss
      assert np.allclose(
          loss, -1 / (2 * np.sqrt(5)), atol=0.1, rtol=0.2
      )
      assert opt.shots_used > min_shots
  
imports: import pytest
  from flaky import flaky
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestOptimization obj's underlying member method code with example usage: obj.test_vqe_optimization() without return types