### sequence function: wif

description:
wif(ket, sp, sp)
a weighted if
works just like standard 'if', but takes into consideration the coefficient of the condition
examples:
wif(0.7|True>, |a>, |b>)
0.7|a> + 0.3|b>
wif(0.8|False>, |a>, |b>)
0.2|a> + 0.8|b>
future:
implement a version that works with sequences
see also:
if

Home