code: def test_val_grad():
      """Test ValGrad object."""
      from deepchem.utils.dft_utils import ValGrad
  
      dens = torch.ones(1)
      grad = torch.zeros(1)
      lapl = torch.ones(1)
      kin = torch.ones(1)
      vg = ValGrad(value=dens, grad=grad, lapl=lapl, kin=kin)
  
      assert torch.allclose(vg.value, dens)
      assert torch.allclose(vg.grad, grad)
      assert torch.allclose(vg.lapl, lapl)
      assert torch.allclose(vg.kin, kin)
  
      vg2 = vg + vg
      assert torch.allclose(vg2.value, torch.tensor([2.0]))
      assert torch.allclose(vg2.grad, torch.tensor([0.0]))
      assert torch.allclose(vg2.lapl, torch.tensor([2.0]))
      assert torch.allclose(vg2.kin, torch.tensor([2.0]))
  
      vg5 = vg * 5
      assert torch.allclose(vg5.value, torch.tensor([5.0]))
      assert torch.allclose(vg5.grad, torch.tensor([0.0]))
      assert torch.allclose(vg5.lapl, torch.tensor([5.0]))
      assert torch.allclose(vg5.kin, torch.tensor([5.0]))
  
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 7 for calling a global function with example usage: test_val_grad() without return types