code: def test_building_hamiltonian(
      charge,
      mult,
      package,
      nact_els,
      nact_orbs,
      mapping,
      tmpdir,
      op_arithmetic,
  ):
      r"""Test that the generated Hamiltonian `built_hamiltonian` is an instance of the PennyLane
      Hamiltonian class and the correctness of the total number of qubits required to run the
      quantum simulation. The latter is tested for different values of the molecule's charge and
      for active spaces with different size"""
  
      args = (test_symbols, test_coordinates)
      kwargs = {
          "charge": charge,
          "mult": mult,
          "method": package,
          "active_electrons": nact_els,
          "active_orbitals": nact_orbs,
          "mapping": mapping,
          "outpath": tmpdir.strpath,
      }
      if op_arithmetic:
          enable_new_opmath()
  
      built_hamiltonian, qubits = qchem.molecular_hamiltonian(
          *args, **kwargs
      )
  
      if op_arithmetic:
          disable_new_opmath()
          assert not isinstance(built_hamiltonian, Hamiltonian)
      else:
          assert isinstance(built_hamiltonian, Hamiltonian)
      assert qubits == 2 * nact_orbs
  
file_path: pennylane/tests/qchem/of_tests/test_molecular_hamiltonian.py
imports: import pytest
  from pennylane import Identity, PauliX, PauliY, PauliZ
  from pennylane import numpy
  from pennylane import qchem
  from pennylane.ops import Hamiltonian
  from pennylane.ops.functions import dot
  from pennylane.pauli import pauli_sentence
  from pennylane.operation import enable_new_opmath, disable_new_opmath
label_desc: Use image node_id 1 for calling a global function with example usage: test_building_hamiltonian(charge, mult, package, nact_els, nact_orbs, mapping, tmpdir, op_arithmetic) without return types