Module utils

Module utils 

Source

Functionsยง

bits_to_int
Calculate the integer representation of a bit string
compute_index
Compute the global index for a multi-qubit system
controlled_flip
Compute the index with a controlled bit flip
flip_bit
Compute the index with a bit flipped at the specified position
gate_vec_to_array2
Convert a matrix representation of a gate (row-major) to a 2D ndarray
int_to_bits
Calculate the bit representation of an integer
kron
Calculate the kronecker product of two matrices
par_indexed_map
Parallel map over state vector elements with index
tensor_product
Calculate the tensor product of two state vectors