1 Tutorial : write a program which prints i|H|j for any pair (i, j)
Anthony Scemama edited this page 2018-07-20 10:46:08 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

  1. Create a new module, named PrintHij for example, which needs the module Determinants :
qp_module.py create -n "PrintHij" Determinants
  1. Go into the $QP_ROOT/src/PrintHij module and rename the file PrintHij.main.irp.f as PrintHij.irp.f
cd $QP_ROOT/src/PrintHij
mv PrintHij.main.irp.f PrintHij.irp.f
  1. Edit PrintHij.irp.f as follows
     program print_matrix_element
       use bitmasks
       implicit none

       integer(bit_kind) :: det_i(N_int,2)
       integer(bit_kind) :: det_j(N_int,2)

       double precision  :: hij

       integer           :: i,j

       print *,  'Determinant <i| ?'
       read(*,*) i
       det_i(1:N_int, 1:2) = psi_det(1:N_int, 1:2, i)

       print *,  'Determinant |j> ?'
       read(*,*) j
       det_j(1:N_int, 1:2) = psi_det(1:N_int, 1:2, j)

       call i_H_j(det_i, det_j, N_int, hij)
       print *,  '<i|H|j> = ', hij

     end
  1. Run ninja to compile the PrintHij program

  2. Run make in the $QP_ROOT/ocaml directory such that it rebuilds also the OCaml binaries

  3. Youre done! Take an EZFIO directory containing a wave function and set the read_wf flag to true, then

qp_run PrintHij test.ezfio