class_docstr: Tests for the mutual information functions
docstr: Test that the mutual information transform works for QNodes by comparing
  against analytic values, for the JAX-jit interface
docstr_tok: ["Test","that","the","mutual","information","transform","works","for","QNodes","by","comparing","against","analytic","values",",","for","the","JAX-jit","interface"]
code: def test_qnode_relative_entropy_jax_jit(self, param, interface):
      """Test that the mutual information transform works for QNodes by comparing
      against analytic values, for the JAX-jit interface"""
      import jax
      import jax.numpy as jnp
  
      dev = qml.device("default.qubit", wires=2)
  
      param = jnp.array(param)
  
      @qml.qnode(dev, interface=interface)
      def circuit1(params):
          qml.RY(params, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.state()
  
      @qml.qnode(dev, interface=interface)
      def circuit2(params):
          qml.RY(params, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.state()
  
      rel_ent_circuit = qml.qinfo.relative_entropy(
          circuit1, circuit2, [0], [1]
      )
      actual = jax.jit(rel_ent_circuit)((param[0],), (param[1],))
  
      # compare transform results with analytic results
      first_term = (
          0
          if jnp.cos(param[0] / 2) == 0
          else jnp.cos(param[0] / 2) ** 2
          * (
              jnp.log(jnp.cos(param[0] / 2) ** 2)
              - jnp.log(jnp.cos(param[1] / 2) ** 2)
          )
      )
      second_term = (
          0
          if jnp.sin(param[0] / 2) == 0
          else jnp.sin(param[0] / 2) ** 2
          * (
              jnp.log(jnp.sin(param[0] / 2) ** 2)
              - jnp.log(jnp.sin(param[1] / 2) ** 2)
          )
      )
      expected = first_term + second_term
  
      assert np.allclose(actual, expected)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestRelativeEntropy obj's underlying member method code with example usage: obj.test_qnode_relative_entropy_jax_jit(param, interface) and returns: qml, qml