class_docstr: Test that the Mottonen state preparation ensures the compatibility with
  interfaces by using casting'
class_docstr_tok: ["Test","that","the","Mottonen","state","preparation","ensures","the","compatibility","with","interfaces","by","using","casting","'"]
docstr: Test that MottonenStatePreparation can be correctly used with the JAX interface.
docstr_tok: ["Test","that","MottonenStatePreparation","can","be","correctly","used","with","the","JAX","interface","."]
code: def test_jax(self, inputs, expected):
      """Test that MottonenStatePreparation can be correctly used with the JAX interface."""
      from jax import numpy as jnp
  
      inputs = jnp.array(inputs)
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit(inputs):
          qml.MottonenStatePreparation(inputs, wires=[0, 1])
          return qml.probs(wires=[0, 1])
  
      inputs = inputs / jnp.linalg.norm(inputs)
      res = circuit(inputs)
      assert np.allclose(res, expected, atol=1e-6, rtol=0)
  
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 TestCasting obj's underlying member method code with example usage: obj.test_jax(inputs, expected) and returns: qml