anchor.diff:          integer :: truncation_level, ncycles, rng_seed
           integer, allocatable :: ref_det(:)
           integer :: opts, err
  -        integer, allocatable :: err_arr(:)
           logical :: have_seed
  -        character(10), parameter :: keys(5) = [character(10) :: 'sys', 'ncycles', 'ex_level', 'reference', 'rng_seed']
   
           lua_state = flu_copyptr(L)
           call get_sys_t(lua_state, sys)
   
           opts = aot_table_top(lua_state)
  -
  -        call aot_get_val(ncycles, err, lua_state, opts, 'ncycles')
  -        if (err /= 0) call stop_all('lua_hilbert_space', 'Number of cycles not supplied.')
  -        call aot_get_val(truncation_level, err, lua_state, opts, 'ex_level', default=-1)
  -        call aot_get_val(ref_det, err_arr, sys%nel, lua_state, opts, key='reference')
  -        have_seed = aot_exists(lua_state, opts, 'rng_seed')
  -        call aot_get_val(rng_seed, err, lua_state, opts, 'rng_seed')
  -
  -        call warn_unused_args(lua_state, keys, opts)
  +        call read_hilbert_args(lua_state, opts, sys%nel, ncycles, truncation_level, ref_det, rng_seed, have_seed)
           call aot_table_close(lua_state, opts)
   
           ! AOTUS returns a vector of size 0 to denote a non-existent vector.
  
positive.code: 
      ! --- table-derived type wrappers ---
  
      subroutine read_kinetic_args(lua_state, opts, fermi_temperature, beta, nattempts, ncycles, 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
  
negative.code:         !    L: lua state (bare C pointer).
  
          ! Lua:
          !     hilbert_args = {
          !         ncycles = n,
          !         ex_level = level,
          !         rng_seed = seed,
          !         reference = { ... },  -- nel-dimensional vector.
          !    }
          !
          !    hilbert_space {sys = sys_t, hilbert = hilbert_args}
  
          use, intrinsic :: iso_c_binding, only: c_ptr, c_int, c_f_pointer
  
          use flu_binding, only: flu_State, flu_copyptr
          use aot_table_module, only: aot_table_top, aot_exists, aot_table_close
  
          use errors, only: stop_all
          use lua_hande_system, only: get_sys_t
          use system, only: sys_t
  
          use hilbert_space, only: estimate_hilbert_space
  