class_docstr: Unit tests for the ParametrizedEvolution class.
class_docstr_tok: ["Unit","tests","for","the","ParametrizedEvolution","class","."]
docstr: Test that the hash of a ParametrizedEvolution takes all attributes into account.
docstr_tok: ["Test","that","the","hash","of","a","ParametrizedEvolution","takes","all","attributes","into","account","."]
code: def test_hash_with_data(self):
      """Test that the hash of a ParametrizedEvolution takes all attributes into account."""
  
      H_0 = 0.2 * qml.PauliZ(0) + qml.pulse.constant * (
          qml.PauliX(0) @ qml.PauliY(1)
      )
      H_1 = 0.2 * qml.PauliX(0) + qml.pulse.constant * (
          qml.PauliX(0) @ qml.PauliY(1)
      )
  
      params_0 = [np.array(0.4)]
      params_1 = [np.array(0.43)]
  
      t_0 = (0.3, 0.4)
      t_1 = (0.3, 0.5)
  
      atol_0 = 1e-8
      atol_1 = 1e-7
  
      compare_to = ParametrizedEvolution(
          H_0, params_0, t_0, False, False, atol=atol_0
      )
      equal = ParametrizedEvolution(
          H_0, params_0, t_0, False, False, atol=atol_0
      )
      diff_H = ParametrizedEvolution(
          H_1, params_0, t_0, False, False, atol=atol_0
      )
      diff_params = ParametrizedEvolution(
          H_0, params_1, t_0, False, False, atol=atol_0
      )
      diff_t = ParametrizedEvolution(
          H_0, params_0, t_1, False, False, atol=atol_0
      )
      diff_atol = ParametrizedEvolution(
          H_0, params_0, t_0, False, False, atol=atol_1
      )
      diff_ret_intmdt = ParametrizedEvolution(
          H_0, params_0, t_0, True, False, atol=atol_0
      )
      diff_complementary = ParametrizedEvolution(
          H_0, params_0, t_0, False, True, atol=atol_0
      )
  
      assert compare_to.hash == equal.hash
      assert compare_to.hash != diff_H.hash
      assert compare_to.hash != diff_params.hash
      assert compare_to.hash != diff_t.hash
      assert compare_to.hash != diff_atol.hash
      assert compare_to.hash != diff_ret_intmdt.hash
      assert compare_to.hash != diff_complementary.hash
  
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 13 for calling the TestInitialization obj's underlying member method code with example usage: obj.test_hash_with_data() without return types