built in operator: reverse

    description:
        reverse sp
        reverse the given superposition

    examples:
        reverse (|a> + |b> + |c>)
            |c> + |b> + |a>

        reverse (|a> + |b> . |c> + |d> . |e>)
            |b> + |a> . |d> + |c> . |e>

        -- reverse the order of the superpositions, but leave the sequence unchanged:
        long-display reverse (|a> + |b> . |c> + |d> . |e>)
            seq |0> => |b> + |a>
            seq |1> => |d> + |c>
            seq |2> => |e>
            |b> + |a> . |d> + |c> . |e>
      
        -- reverse both the superpositions and the sequence:
        long-display sreverse reverse (|a> + |b> . |c> + |d> . |e>)
            seq |0> => |e>
            seq |1> => |d> + |c>
            seq |2> => |b> + |a>
            |e> . |d> + |c> . |b> + |a>

    see also:
        sreverse

Home