def _expand_params(solver, params=None, timing=None):
    """Expand a limited set of user-provided params to a full set, substituting
    missing values with solver defaults.
    """
    if params is None:
        params = {}
    if timing is None:
        timing = {}
    default_annealing_time = solver.properties['default_annealing_time']
    default_programming_thermalization = solver.properties[
        'default_programming_thermalization']
    default_readout_thermalization = solver.properties[
        'default_readout_thermalization']
    if 'qpu_anneal_time_per_sample' in timing:
        annealing_time = timing['qpu_anneal_time_per_sample']
    elif 'annealing_time' in params:
        annealing_time = params['annealing_time']
    elif 'anneal_schedule' in params:
        anneal_schedule = params['anneal_schedule']
        annealing_time = anneal_schedule[-1][0]
    else:
        annealing_time = default_annealing_time
    if 'anneal_schedule' in params:
        anneal_schedule = params['anneal_schedule']
    else:
        anneal_schedule = [[0, 0], [annealing_time, 1]]
    flux_biases = params.get('flux_biases')
    initial_state = params.get('initial_state')
    return {'anneal_offsets': params.get('anneal_offsets'),
        'anneal_schedule': anneal_schedule, 'annealing_time':
        annealing_time, 'answer_mode': params.get('answer_mode',
        'histogram'), 'auto_scale': params.get('auto_scale', True if not
        flux_biases else False), 'beta': params.get('beta', 10 if solver.
        is_vfyc else 1), 'chains': params.get('chains'), 'flux_biases':
        flux_biases, 'flux_drift_compensation': params.get(
        'flux_drift_compensation', True), 'h_gain_schedule': params.get(
        'h_gain_schedule', [[0, 1], [annealing_time, 1]]), 'initial_state':
        initial_state, 'max_answers': params.get('max_answers'),
        'num_reads': params.get('num_reads', 1),
        'num_spin_reversal_transforms': params.get(
        'num_spin_reversal_transforms', 0), 'postprocess': params.get(
        'postprocess', 'sampling' if solver.is_vfyc else ''),
        'programming_thermalization': params.get(
        'programming_thermalization', default_programming_thermalization),
        'readout_thermalization': params.get('readout_thermalization',
        default_readout_thermalization), 'reduce_intersample_correlation':
        params.get('reduce_intersample_correlation', False),
        'reinitialize_state': params.get('reinitialize_state', True if
        initial_state else False)}
