function 1: xor


xor:
    description:
        xor(ket1, ket2)
        returns |yes> if ket1 xor ket2 are |yes>, |no> otherwise.

    examples:
        xor(|yes>, |yes>)
            |no>

        xor(|yes>, |no>)
            |yes>

        xor(|no>, |no>)
            |no>

    see also:
        and, or

xor:
    description:
        xor(ket) input-seq
        applies xor(ket, x) for each x in input-seq
        as such, it preserves input-seq structure
        but, because it preserves input-seq structure, it is slower than the above version.

    examples:
        xor(|yes>) (|no> . |yes>)
            |yes> . |no>

        xor(|no>) (|no> . |yes>)
            |no> . |yes>

    see also:
        and, or
Home