anchor.diff:              if (op) dmqmc_calc_type = dmqmc_calc_type + dmqmc_full_r2
               call aot_get_val(op, err, lua_state, table, 'energy', default=.false.)
               if (op) dmqmc_calc_type = dmqmc_calc_type + dmqmc_energy
  +            call aot_get_val(op, err, lua_state, table, 'energy2', default=.false.)
  +            if (op) dmqmc_calc_type = dmqmc_calc_type + dmqmc_energy_squared
               call aot_get_val(op, err, lua_state, table, 'staggered_magnetisation', default=.false.)
               if (op) dmqmc_calc_type = dmqmc_calc_type + dmqmc_staggered_magnetisation
               if (aot_exists(lua_state, table, 'correlation')) then
  
positive.code:             call aot_get_val(dmqmc_in%all_spin_sectors, err, lua_state, table, 'all_spin_sectors')
              call aot_get_val(dmqmc_in%beta_loops, err, lua_state, table, 'beta_loops')
              call aot_get_val(dmqmc_in%find_weights, err, lua_state, table, 'find_weights')
              if (aot_exists(lua_state, table, 'sampling_weights')) then
                  dmqmc_in%weighted_sampling = .true.
                  ! Certainly can't have more excitation levels than basis functions, so that's a handy upper-limit.
  
negative.code:             if (err /= 0) call stop_all('read_dmqmc_in', 'spawned_state_size not specified in rdm table.')
              if (aot_exists(lua_state, table, 'rdms')) then
                  dmqmc_in%rdm%doing_rdm = .true.
                  call aot_table_open(lua_state, table, subtable, 'rdms')
                  dmqmc_in%rdm%nrdms = aot_table_length(lua_state, subtable)
                  allocate(rdm_info(dmqmc_in%rdm%nrdms), stat=err)
                  call check_allocate('rdm_info', dmqmc_in%rdm%nrdms, err)
  