class_docstr: Tests that the spectrum is returned as expected.
docstr: Test that the spectrum contains the ids provided in encoding_gates, or
  all ids if encoding_gates is None.
docstr_tok: ["Test","that","the","spectrum","contains","the","ids","provided","in","encoding_gates",",","or","all","ids","if","encoding_gates","is","None","."]
code: def test_encoding_gates(self):
      """Test that the spectrum contains the ids provided in encoding_gates, or
      all ids if encoding_gates is None."""
  
      dev = qml.device("default.qubit", wires=1)
  
      @qml.qnode(dev)
      def _circuit(x):
          qml.RX(x, wires=0, id="x")
          qml.RY(0.4, wires=0, id="other")
          return qml.expval(qml.PauliZ(wires=0))
  
      res = circuit_spectrum(_circuit, encoding_gates=["x"])(0.1)
      assert res == {"x": [-1.0, 0.0, 1.0]}
  
      res = circuit_spectrum(_circuit, encoding_gates=["x", "other"])(
          0.1
      )
      assert res == {"x": [-1.0, 0.0, 1.0], "other": [-1.0, 0.0, 1.0]}
  
      res = circuit_spectrum(_circuit)(0.1)
      assert res == {"x": [-1.0, 0.0, 1.0], "other": [-1.0, 0.0, 1.0]}
  
      res = circuit_spectrum(_circuit, encoding_gates=["a"])(0.1)
      assert res == {"a": []}
  
file_path: pennylane/tests/fourier/test_circuit_spectrum.py
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.fourier.circuit_spectrum import circuit_spectrum
label_desc: Use image node_id 2 for calling the TestCircuits obj's underlying member method code with example usage: obj.test_encoding_gates() and returns: qml