Return a count of different operation types given a colelction of
    operations, such as a Circuit or DAGCircuit

def count_operations(elements: Iterable[Operation]) \
        -> Dict[Type[Operation], int]:
    """Return a count of different operation types given a colelction of
    operations, such as a Circuit or DAGCircuit
    """
    op_count: Dict[Type[Operation], int] = defaultdict(int)
    for elem in elements:
        op_count[type(elem)] += 1
    return dict(op_count)