function 2: union


union:
    description:
        union(seq, seq)
        the union function, takes element-wise max of the coefficients
        it generalizes standard set union where the coefficients are either 0 or 1
        ie, it is a fuzzy set union

    examples:
        -- set union of {a,b,c,d} and {b,d,e,f,g}:
        union(split |abcd>, split |bdefg>)
            |a> + |b> + |c> + |d> + |e> + |f> + |g>

        -- fuzzy set union example:
        union(3|a> + 1.2|b>, 3.5|a> + 0.9|b> + 5.13|c>)
            3.500000|a> + 1.200000|b> + 5.130000|c>

        -- sequence union example:
        union( ssplit |abcde>, ssplit |xyz>)
            |a> + |x> . |b> + |y> . |c> + |z> . |d> . |e>

    see also:
        intersection, sum, is-subset, is-mbr, simm

Home