built in operator: measure-currency

    description:
        measure-currency sp
        returns the sum of the coeffs in the given superposition
        in other words, the amount of currency used by that superposition
        
        eg, for a currency preserving operator, op, we have:
            measure-currency sp == measure-currency op sp
        for any superposition sp

    examples:
        measure-currency |>
            |number: 0>

        measure-currency split |a b c d e f g>
            |number: 7>

        measure-currency normalize split |a b c d e f g>
            |number: 1.0>

        measure-currency normalize[10] split |a b c d e f g>
            |number: 10>
                    
        measure-currency (0|a> + 2|b> + 3|c> + 5|d> + 7|e> + 11|f>)
            |number: 28>

    see also:
        how-many, show-many, normalize, rescale, smeasure-currency

Home