code: def _(
      fermi_operator: FermiSentence, ps=False, wire_map=None, tol=None
  ):
      wires = list(fermi_operator.wires) or [0]
      identity_wire = wires[0]
  
      qubit_operator = (
          PauliSentence()
      )  # Empty PS as 0 operator to add Pws to
  
      for fw, coeff in fermi_operator.items():
          fermi_word_as_ps = jordan_wigner(fw, ps=True)
  
          for pw in fermi_word_as_ps:
              qubit_operator[pw] = (
                  qubit_operator[pw] + fermi_word_as_ps[pw] * coeff
              )
  
              if (
                  tol is not None
                  and abs(qml.math.imag(qubit_operator[pw])) <= tol
              ):
                  qubit_operator[pw] = qml.math.real(qubit_operator[pw])
  
      if not ps:
          qubit_operator = qubit_operator.operation(
              wire_order=[identity_wire]
          )
  
      if wire_map:
          return qubit_operator.map_wires(wire_map)
  
      return qubit_operator
  
file_path: pennylane/pennylane/fermi/conversion.py
imports: from functools import singledispatch
  from typing import Union
  import pennylane
  from pennylane.operation import Operator
  from pennylane.pauli import PauliSentence, PauliWord
  from .fermionic import FermiSentence, FermiWord
label_desc: Use image node_id 4 for calling a global function with example usage: _(fermi_operator, ps, wire_map, tol) and returns: qubit_operator, qubit_operator