[][src]Module qip::state_ops

Enums

QubitOp

Types of unitary ops which can be applied to a state.

Functions

apply_op

Apply op to the input, storing the results in output. If either start at a nonzero state index in their 0th index, use input/output_offset.

from_reals

Make a vector of complex numbers whose reals are given by data

from_tuples

Make a vector of complex numbers whose reals are given by the first tuple entry in data and whose imaginaries are from the second.

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

make_control_op

Make a ControlOp

make_op_matrix

Make the full op matrix from ops. Not very efficient, use only for debugging.

num_indices

Get the number of indices represented by op

select_matrix_coords

Given the full matrix row and col, find the given op's row and column using the full n, the op's nindices, the op's `indices'.

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.