class_docstr: Test that single-qubit gates can be pushed through controlled gates in all interfaces.
class_docstr_tok: ["Test","that","single-qubit","gates","can","be","pushed","through","controlled","gates","in","all","interfaces","."]
docstr: Test QNode and gradient in JAX interface.
docstr_tok: ["Test","QNode","and","gradient","in","JAX","interface","."]
code: def test_commute_controlled_jax(self):
      """Test QNode and gradient in JAX interface."""
      import jax
      from jax import numpy as jnp
  
      original_qnode = qml.QNode(qfunc_all_ops, dev)
      transformed_qnode = qml.QNode(transformed_qfunc_all_ops, dev)
  
      input = jnp.array([0.3, 0.4], dtype=jnp.float64)
  
      # Check that the numerical output is the same
      assert qml.math.allclose(
          original_qnode(input), transformed_qnode(input)
      )
  
      # Check that the gradient is the same
      assert qml.math.allclose(
          jax.grad(original_qnode)(input),
          jax.grad(transformed_qnode)(input),
      )
  
      # Check operation list
      ops = transformed_qnode.qtape.operations
      compare_operation_lists(
          ops, expected_op_list, expected_wires_list
      )
  
imports: import pytest
  from utils import compare_operation_lists, check_matrix_equivalence
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.optimization import commute_controlled
label_desc: Use image node_id 4 for calling the TestCommuteControlledInterfaces obj's underlying member method code with example usage: obj.test_commute_controlled_jax() without return types