built in operator: coeff-sort

    description:
        coeff-sort sp
        sort the given superposition by its coefficients

    examples:
        coeff-sort (6|f> + 5|e> + |a> + 2|b> + 4|d> + 3|c>)
            6|f> + 5|e> + 4|d> + 3|c> + 2|b> + |a>
        
        reverse coeff-sort (6|f> + 5|e> + |a> + 2|b> + 4|d> + 3|c>)
            |a> + 2|b> + 3|c> + 4|d> + 5|e> + 6|f>

    see also:
        ket-sort, shuffle, reverse

Home