Remove occurrences of the :func:`.circuit_identity` ``cid(n)`` for any
    ``n``. Cf. :func:`filter_neutral`

def filter_cid(cls, ops, kwargs):
    """Remove occurrences of the :func:`.circuit_identity` ``cid(n)`` for any
    ``n``. Cf. :func:`filter_neutral`
    """
    from qnet.algebra.core.circuit_algebra import CircuitZero, circuit_identity
    if len(ops) == 0:
        return CircuitZero
    fops = [op for op in ops if op != circuit_identity(op.cdim)]
    if len(fops) > 1:
        return fops, kwargs
    elif len(fops) == 1:
        # the remaining operand is the single non-trivial one
        return fops[0]
    else:
        # the original list of operands consists only of neutral elements
        return ops[0]