code: def test_lattice():
      """Test lattice object.
      Comparing it's output with it's original implementation in dqc.
      """
      from deepchem.utils.dft_utils import Lattice
  
      a = torch.tensor(
          [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
      )
      lattice = Lattice(a)
  
      assert torch.allclose(lattice.lattice_vectors(), a)
      assert torch.allclose(
          lattice.recip_vectors(),
          torch.inverse(a.transpose(-2, -1)) * (2 * np.pi),
      )
      assert torch.allclose(lattice.volume(), torch.det(a))
  
      assert torch.allclose(
          lattice.get_lattice_ls(1.0),
          torch.tensor(
              [
                  [0.0, 0.0, -1.0],
                  [0.0, -1.0, 0.0],
                  [-1.0, 0.0, 0.0],
                  [0.0, 0.0, 0.0],
                  [1.0, 0.0, 0.0],
                  [0.0, 1.0, 0.0],
                  [0.0, 0.0, 1.0],
              ]
          ),
      )
      assert torch.allclose(
          lattice.get_gvgrids(6.0)[0],
          torch.tensor(
              [
                  [0.0000, 0.0000, -6.2832],
                  [0.0000, -6.2832, 0.0000],
                  [-6.2832, 0.0000, 0.0000],
                  [0.0000, 0.0000, 0.0000],
                  [6.2832, 0.0000, 0.0000],
                  [0.0000, 6.2832, 0.0000],
                  [0.0000, 0.0000, 6.2832],
              ]
          ),
      )
      assert torch.allclose(
          lattice.get_gvgrids(6.0)[1],
          torch.tensor(
              [1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000]
          ),
      )
      assert lattice.estimate_ewald_eta(1e-5) == 1.8
  
file_path: deepchem/deepchem/utils/test/test_dft_utils.py
imports: import pytest
  import numpy
  from typing import Union
label_desc: Use image node_id 4 for calling a global function with example usage: test_lattice() without return types