operator: rank

    description:
        rank sp
        apply position in superposition to coefficient
        ie, rank them

    examples:
        rank (|a> + |b> + |c>)
            |a> + 2|b> + 3|c>
        
        rank split |a b c d e f>
            |a> + 2|b> + 3|c> + 4|d> + 5|e> + 6|f>
            
        -- NB: designed for superpositions, not sequences
        -- for sequences, you need srank
        -- eg, this doesn't do what you think it might:
        rank ssplit |abcdefg>
            |a> . |b> . |c> . |d> . |e> . |f> . |g>

        -- instead need:
        srank ssplit |abcdefg>
            |a> . 2|b> . 3|c> . 4|d> . 5|e> . 6|f> . 7|g>

    see also:
        srank

Home