class_docstr: Integration tests for the ParametrizedEvolution class.
class_docstr_tok: ["Integration","tests","for","the","ParametrizedEvolution","class","."]
docstr: Test that the unitary can be differentiated with and without jitting using sparse matrices
docstr_tok: ["Test","that","the","unitary","can","be","differentiated","with","and","without","jitting","using","sparse","matrices"]
code: def test_jitted_unitary_differentiation_sparse(self):
      """Test that the unitary can be differentiated with and without jitting using sparse matrices"""
      import jax
      import jax.numpy as jnp
  
      jax.config.update("jax_enable_x64", True)
  
      def U(params):
          H = jnp.polyval * qml.PauliZ(0)
          Um = qml.evolve(H, dense=False)(params, t=10.0)
          return qml.matrix(Um)
  
      params = jnp.array([[0.5]], dtype=complex)
      jac = jax.jacobian(U, holomorphic=True)(params)
      jac_jit = jax.jacobian(jax.jit(U), holomorphic=True)(params)
  
      assert qml.math.allclose(jac, jac_jit)
  
imports: from functools import reduce
  import numpy
  import pytest
  import pennylane
  from pennylane.operation import AnyWires
  from pennylane.ops import QubitUnitary
  from pennylane.pulse import ParametrizedEvolution, ParametrizedHamiltonian
  from pennylane.tape import QuantumTape
  from pennylane.devices import DefaultQubit, DefaultQubitLegacy
label_desc: Use image node_id 7 for calling the TestIntegration obj's underlying member method code with example usage: obj.test_jitted_unitary_differentiation_sparse() and returns: qml