def schedule_to_dict(input_list, schedule=None):
    """
    Create a dictionary containing a reference to the optimized schedules.

    Parameters
    ----------
    input_list : list
        List of entities.
    schedule : str or list, optional
           Schedule or list of schedules to save.

           - `None` : Current schedule of entity
           - 'default' : Normal schedule
           - 'ref' : Reference schedule
    """
    if isinstance(schedule, str) or schedule is None:
        schedules = [schedule]
    elif isinstance(schedule, list):
        schedules = schedule
    else:
        raise ValueError("Unknown type for schedule argument.")
    entities = {str(entity): {} for entity in input_list}
    for ent, ent_schedules in zip(input_list, entities.values()):
        for schedule in schedules:
            if schedule is None:
                schedule = ent.current_schedule_active

            sub_schedules = ent.schedules[schedule].copy()
            ent_schedules[schedule] = sub_schedules
    return entities