built in operator: sreverse
description:
sreverse seq
reverse the given sequence, leaving the order of the kets in the superpositions unchanged
examples:
sreverse (|a> . |b> . |c>)
|c> . |b> . |a>
sreverse (|a> + |b> . |c> + |d> . |e>)
|e> . |c> + |d> . |a> + |b>
-- reverse the order of the sequence of superpositions:
long-display sreverse (|a> + |b> . |c> + |d> . |e>)
seq |0> => |e>
seq |1> => |c> + |d>
seq |2> => |a> + |b>
|e> . |c> + |d> . |a> + |b>
-- 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:
reverse
Home