### operator: to-coeff

description:
to-coeff ket
replace the ket text with ' '
ie, only keep the coefficient
examples:
-- if the ket is the don't know ket, return the don't know ket:
to-coeff 12|>
|>
to-coeff 26|a: b>
26| >
-- since the ket text is now the same, the coefficients add up:
to-coeff (26|a: b> + 13|x>)
39| >
-- another longer example:
to-coeff (3|a: b: c> + 5|x: y> + 7|fish> + 2.5|animal: mammal: cat>)
17.5| >
see also:

Home