class_docstr: Tests for the var function
class_docstr_tok: ["Tests","for","the","var","function"]
docstr: Test that the variance of an operator with permuted wires is the same.
docstr_tok: ["Test","that","the","variance","of","an","operator","with","permuted","wires","is","the","same","."]
code: def test_permuted_wires(self, mocker):
      """Test that the variance of an operator with permuted wires is the same."""
      obs = qml.prod(
          qml.PauliZ(8),
          qml.s_prod(2, qml.PauliZ(10)),
          qml.s_prod(3, qml.PauliZ("h")),
      )
      obs_2 = qml.prod(
          qml.s_prod(3, qml.PauliZ("h")),
          qml.PauliZ(8),
          qml.s_prod(2, qml.PauliZ(10)),
      )
  
      dev = qml.device("default.qubit.legacy", wires=["h", 8, 10])
      spy = mocker.spy(qml.QubitDevice, "var")
  
      @qml.qnode(dev)
      def circuit():
          qml.RX(1.23, wires=["h"])
          qml.RY(2.34, wires=[8])
          return qml.var(obs)
  
      @qml.qnode(dev)
      def circuit2():
          qml.RX(1.23, wires=["h"])
          qml.RY(2.34, wires=[8])
          return qml.var(obs_2)
  
      assert circuit() == circuit2()
      custom_measurement_process(dev, spy)
  
file_path: pennylane/tests/measurements/legacy/test_var_legacy.py
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Variance, Shots
  from pennylane.devices.qubit.measure import flatten_state
label_desc: Use image node_id 9 for calling the TestVar obj's underlying member method code with example usage: obj.test_permuted_wires(mocker) and returns: qml, qml