[−][src]Function qip::iterators::sum_for_op_cols
pub fn sum_for_op_cols<P: Precision, F: Fn((u64, Complex<P>)) -> Complex<P>>(
nindices: u64,
row: u64,
op: &PrecisionUnitaryOp<P>,
f: F
) -> Complex<P>
Using the function f
which maps from a column and row
to a complex value for the op matrix,
sums for all nonzero entries for a given op
more efficiently than trying each column between
0 and 2^nindices.
This really needs to be cleaned up, but runs in a tight loop. This makes it hard since Box
is unfeasible and the iterator types aren't the same size.