anchor.diff:  
       ! --- table-derived type wrappers ---
   
  -    subroutine read_kinetic_args(lua_state, opts, fermi_temperature, beta, nattempts, ncycles, seed, have_seed)
  +    subroutine read_hilbert_args(lua_state, opts, nel, ncycles, ex_level, ref_det, rng_seed, have_seed)
  +
  +        use flu_binding, only: flu_State
  +        use aot_table_module, only: aot_get_val, aot_exists, aot_table_open, aot_table_close
  +        use aot_vector_module, only: aot_get_val
  +
  +        use const, only: p
  +        use errors, only: stop_all
  +        use lua_hande_utils, only: warn_unused_args
  +
  +        type(flu_State), intent(inout) :: lua_state
  +        integer, intent(in) :: opts, nel
  +        integer, intent(out) :: ncycles, ex_level, rng_seed
  +        integer, allocatable :: ref_det(:)
  +        logical, intent(out) :: have_seed
  +
  +        integer :: hilbert_table, err
  +        integer, allocatable :: err_arr(:)
  +        character(10), parameter :: keys(5) = [character(10) :: 'sys', 'ncycles', 'ex_level', 'reference', 'rng_seed']
  +
  +        if (.not. aot_exists(lua_state, opts, 'hilbert')) call stop_all('read_hilbert_args','"hilbert" table not present.')
  +        call aot_table_open(lua_state, opts, hilbert_table, 'hilbert')
  +
  +        call aot_get_val(ncycles, err, lua_state, hilbert_table, 'ncycles')
  +        if (err /= 0) call stop_all('read_hilbert_args', 'Number of cycles not supplied.')
  +        call aot_get_val(ex_level, err, lua_state, hilbert_table, 'ex_level', default=-1)
  +        call aot_get_val(ref_det, err_arr, nel, lua_state, hilbert_table, key='reference')
  +        have_seed = aot_exists(lua_state, hilbert_table, 'rng_seed')
  +        call aot_get_val(rng_seed, err, lua_state, hilbert_table, 'rng_seed')
  +
  +        call warn_unused_args(lua_state, keys, hilbert_table)
  +        call aot_table_close(lua_state, hilbert_table)
  +
  +    end subroutine read_hilbert_args
  +
  +    subroutine read_kinetic_args(lua_state, opts, fermi_temperature, beta, nattempts, ncycles, rng_seed, have_seed)
   
           use flu_binding, only: flu_State
           use aot_table_module, only: aot_get_val, aot_exists, aot_table_open, aot_table_close
  
positive.code:                                                            'chem_pot: chemical potential not supplied.')
  
          opts = aot_table_top(lua_state)
          call read_kinetic_args(lua_state, opts, fermi_temperature, beta, nattempts, ncycles, seed, have_seed)
          call aot_table_close(lua_state, opts)
  
          if (have_seed) then
              call estimate_kinetic_energy(sys, fermi_temperature, beta, nattempts, ncycles, seed)
          else
              call estimate_kinetic_energy(sys, fermi_temperature, beta, nattempts, ncycles)
          end if
  
negative.code: 
          type(c_ptr) :: sys_ptr
          type(sys_t), pointer :: sys
          integer :: opts, err, rng_seed, ncycles, nattempts
          logical :: fermi_temperature, have_seed
          real(p) :: beta
  
  