# gradient

`psi4.driver.``gradient`(name, **kwargs)

  Function complementary to :py:func:~driver.optimize(). Carries out one gradient pass, deciding analytic or finite difference.

  Returns: | `Matrix` – Total electronic gradient in Hartrees/Bohr.
  Returns: | (`Matrix`, `Wavefunction`) – gradient and wavefunction when return_wfn specified.
  Examples: |

      >>> # [1] Single-point dft gradient getting the gradient
      >>> #     in file, core.Matrix, and np.array forms
      >>> set gradient_write on
      >>> G, wfn = gradient('b3lyp-d', return_wfn=True)
      >>> wfn.gradient().print_out()
      >>> np.array(G)