function 1: is-mbr


is-mbr:
    description:
        is-mbr(ket) sp
        returns |yes> if the coeff of ket in sp > 0, else |no>
        just a standard, set membership test
        ie, is the given ket a member of the given set represented by sp

    examples:
        is-mbr(|b>) split |abc>
            |yes>

        is-mbr(|c>) (0.3|a> + 2|b> + 9.7|c> + 13|d>)
            |yes>

        is-mbr(|x>) (0.3|a> + 2|b> + 9.7|c> + 13|d>)
            |no>

        friends |Fred> => |Jack> + |Harry> + |Ed> + |Mary> + |Rob> + |Patrick> + |Emma> + |Charlie>

        -- is Ed one of Fred's friends?
        is-mbr(|Ed>) friends |Fred>
            |yes>

        -- is Jane one of Fred's friends?
        is-mbr(|Jane>) friends |Fred>
            |no>

    see also:
        is-subset, union, intersection
Home