def collect_quadrature_rules(integrals, default_scheme, default_degree):
    """Collect quadrature rules found in list of integrals."""
    rules = set()
    for integral in integrals:
        md = integral.metadata() or {}
        scheme = md.get('quadrature_rule', default_scheme)
        degree = md.get('quadrature_degree', default_degree)
        rule = scheme, degree
        rules.add(rule)
    return rules
