[][src]Module qip::iterators

Efficient iterators for sparse kronprod matrices.

Structs

ControlledOpIterator

Iterator which provides the indices of nonzero columns for a given row of a COp

FunctionOpIterator

Iterator which provides the indices of nonzero columns for a given function.

MatrixOpIterator

Iterator which provides the indices of nonzero columns for a given row of a matrix

MultiOpIterator

Iterator which provides the indices of nonzero columns for a given row for a collection of ops.

SparseMatrixOpIterator

Iterator which provides the indices of nonzero columns for a given row of a sparse matrix

SwapOpIterator

Iterator which provides the indices of nonzero columns for a given row of a SwapOp

Enums

PrecisionUnitaryOp

A private version of UnitaryOp with variable precision, this is used so we can change the f64 default UnitaryOp to a variable one at the beginning of execution and not at each operation.

Functions

act_on_iterator

Apply function f to the iterator for op, return result.

fold_for_op_cols

Fold across rows hitting nonzero columns.

par_sum_from_iterator

Sums the outputs of f across all rows and values given by the iterator made from op

precision_get_index

Get the ith qubit index for op

precision_num_indices

Get the number of indices represented by op

sum_for_op_cols

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.

sum_for_ops_cols

Like sum_for_op_cols but takes multiple ops at once.