Module matrix_ops

Module matrix_ops 

Source
Expand description

Helper functions for using iterators for matrix multiplication

Functionsยง

apply_op
Apply op to the input, adding the results to output. If either start at a nonzero state index in their 0th index, use input/output_offset.
apply_op_overwrite
Apply op to the input, adding the results to output. If either start at a nonzero state index in their 0th index, use input/output_offset.
apply_op_row
Compute vector element at a given row from op applied to input.
apply_op_row_indices
Compute vector element at a given row from op applied to input.
apply_ops
Apply ops to the input, adding the results to output. If either start at a nonzero state index in their 0th index, use input/output_offset. This is much less efficient as compared to repeated applications of apply_op, if your ops can be applied in sequence, do so with apply_op.
full_to_sub
Get the index for a submatrix indexed by indices given the full_index for the larger 2^n by 2^n matrix.
get_index
Get the ith qubit index for op
sub_to_full
Given the sub_index for the submatrix, and a base to overwrite values, get the full index for the 2^n by 2^n matrix.