class_docstr: Immutable dictionary used to represent a Fermi word, a product of fermionic creation and
  annihilation operators, that can be constructed from a standard dictionary.
  
  The keys of the dictionary are tuples of two integers. The first integer represents the
  position of the creation/annihilation operator in the Fermi word and the second integer
  represents the orbital it acts on. The values of the dictionary are one of ``'+'`` or ``'-'``
  symbols that denote creation and annihilation operators, respectively. The operator
  :math:`a^{\dagger}_0 a_1` can then be constructed as
  
  >>> w = FermiWord({(0, 0) : '+', (1, 1) : '-'})
  >>> w
  a⁺(0) a(1)
class_docstr_tok: ["Immutable","dictionary","used","to","represent","a","Fermi","word",",","a","product","of","fermionic","creation","and","annihilation","operators",",","that","can","be","constructed","from","a","standard","dictionary",".","The","keys","of","the","dictionary","are","tuples","of","two","integers",".","The","first","integer","represents","the","position","of","the","creation\/annihilation","operator","in","the","Fermi","word","and","the","second","integer","represents","the","orbital","it","acts","on",".","The","values","of","the","dictionary","are","one","of","``","'+","'","``","or","``","'-","'","``","symbols","that","denote","creation","and","annihilation","operators",",","respectively",".","The","operator",":","math",":","`","a^","{","\\dagger","}","_0","a_1","`","can","then","be","constructed","as",">",">",">","w","=","FermiWord","(","{","(","0",",","0",")",":","'+","'",",","(","1",",","1",")",":","'-","'","}",")",">",">",">","w","a\u207a","(","0",")","a","(","1",")"]
docstr: Multiply a FermiWord with another FermiWord, a FermiSentence, or a constant.
  
  >>> w = FermiWord({(0, 0) : '+', (1, 1) : '-'})
  >>> w * w
  a⁺(0) a(1) a⁺(0) a(1)
docstr_tok: ["Multiply","a","FermiWord","with","another","FermiWord",",","a","FermiSentence",",","or","a","constant",".",">",">",">","w","=","FermiWord","(","{","(","0",",","0",")",":","'+","'",",","(","1",",","1",")",":","'-","'","}",")",">",">",">","w","*","w","a\u207a","(","0",")","a","(","1",")","a\u207a","(","0",")","a","(","1",")"]
code: def __mul__(self, other):
      r"""Multiply a FermiWord with another FermiWord, a FermiSentence, or a constant.
  
      >>> w = FermiWord({(0, 0) : '+', (1, 1) : '-'})
      >>> w * w
      a⁺(0) a(1) a⁺(0) a(1)
      """
  
      if isinstance(other, FermiWord):
          if len(self) == 0:
              return copy(other)
  
          if len(other) == 0:
              return copy(self)
  
          order_final = [
              i[0] + len(self) for i in other.sorted_dic.keys()
          ]
          other_wires = [i[1] for i in other.sorted_dic.keys()]
  
          dict_other = dict(
              zip(
                  [
                      (order_idx, other_wires[i])
                      for i, order_idx in enumerate(order_final)
                  ],
                  other.values(),
              )
          )
          dict_self = dict(zip(self.keys(), self.values()))
  
          dict_self.update(dict_other)
  
          return FermiWord(dict_self)
  
      if isinstance(other, FermiSentence):
          return FermiSentence({self: 1}) * other
  
      if isinstance(other, (Number, ndarray)):
          if isinstance(other, ndarray) and qml.math.size(other) > 1:
              raise ValueError(
                  f"Arithmetic Fermi operations can only accept an array of length 1, "
                  f"but received {other} of length {len(other)}"
              )
          return FermiSentence({self: other})
  
      raise TypeError(f"Cannot multiply FermiWord by {type(other)}.")
  
imports: import re
  from copy import copy
  from numbers import Number
  from numpy import ndarray
  import pennylane
label_desc: Use image node_id 17 for calling the FermiWord obj's underlying member method code with example usage: obj.__mul__(other) and returns: FermiWord, unknown, FermiSentence, copy, copy