class_docstr: Tests that the spectrum is returned as expected.
docstr: Test that the spectrum is computed for the arguments
  specified by ``encoding_args``.
docstr_tok: ["Test","that","the","spectrum","is","computed","for","the","arguments","specified","by","``","encoding_args","``","."]
code: def test_encoding_args(self):
      """Test that the spectrum is computed for the arguments
      specified by ``encoding_args``."""
      dev = qml.device("default.qubit", wires=2)
      z_0 = 2.1
  
      @qml.qnode(dev)
      def circuit(x, Y, z=z_0):
          qml.RX(z * x, wires=0)
          qml.RY(0.2 * Y[0, 1, 0], wires=0)
          qml.RY(3 * Y[0, 0, 0], wires=1)
          return qml.expval(qml.PauliZ(wires=0))
  
      x = pnp.array(-1.5, requires_grad=True)
      Y = pnp.array(
          [0.2, -1.2, 9.2, -0.2, 1.1, 4, -0.201, 0.8],
          requires_grad=True,
      ).reshape((2, 2, 2))
      z = 1.2
  
      res = qnode_spectrum(circuit, encoding_args={"x"})(x, Y, z=z)
      assert res == {"x": {(): [-z, 0.0, z]}}
  
      res = qnode_spectrum(circuit, encoding_args={"x"})(x, Y)
      assert res == {"x": {(): [-z_0, 0.0, z_0]}}
  
      res = qnode_spectrum(
          circuit, encoding_args={"x": ..., "Y": [(0, 0, 0), (1, 0, 1)]}
      )(x, Y)
      assert res == {
          "x": {(): [-z_0, 0.0, z_0]},
          "Y": {(0, 0, 0): [-3.0, 0.0, 3.0], (1, 0, 1): [0.0]},
      }
  
imports: from collections import OrderedDict
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.fourier.qnode_spectrum import _process_ids, qnode_spectrum
  from pennylane.measurements import SampleMP, StateMP, VarianceMP
label_desc: Use image node_id 4 for calling the TestCircuits obj's underlying member method code with example usage: obj.test_encoding_args() and returns: qml