class_docstr: Tests gradients.
class_docstr_tok: ["Tests","gradients","."]
docstr: Test that the gradient is successfully calculated for a simple example. This test only
  checks that the gradient is calculated without an error.
docstr_tok: ["Test","that","the","gradient","is","successfully","calculated","for","a","simple","example",".","This","test","only","checks","that","the","gradient","is","calculated","without","an","error","."]
code: def test_gradient_evaluated(self, state_vector):
      """Test that the gradient is successfully calculated for a simple example. This test only
      checks that the gradient is calculated without an error."""
      dev = qml.device("default.qubit", wires=1)
  
      @qml.qnode(dev)
      def circuit(state_vector):
          qml.MottonenStatePreparation(state_vector, wires=range(1))
          return qml.expval(qml.PauliZ(0))
  
      qml.grad(circuit)(state_vector)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.templates.state_preparations.mottonen import gray_code, _get_alpha_y
label_desc: Use image node_id 1 for calling the TestGradient obj's underlying member method code with example usage: obj.test_gradient_evaluated(state_vector) and returns: qml