General utilities and frequent minor life saving little functions.

is_exact_simulation[source]

is_exact_simulation(quantum_instance:QuantumInstance)

Determines whether the quantum instance is to perform a noiseless exact simulation.

sym_from_triu[source]

sym_from_triu(x:ndarray, n:int)

Creates an n x n symmetric matrix from the upper triangular data x.

statevector_basis[source]

statevector_basis(n:int)

Creates a statevector basis with the binary encodings from 0 to n.

hamming_distance[source]

hamming_distance(x:ndarray, y:ndarray)

Hamming distance between arrays x and y.