Quantum circuit utils

SRV


source

get_element_matching_indices

 get_element_matching_indices (a, b)

Compares (2d) a with b. Returns the indices of b, where a element of a matches with b.


source

get_entanglement_bins

 get_entanglement_bins (num_of_qubits)

Returns all SRV sorted in entangle bins which correspond to a number of entangled qubits.

for srvs,label in zip(*get_entanglement_bins(5)):
    print(label, ":", srvs)
0 qubit entangled : [[1, 1, 1, 1, 1]]
2 qubit entangled : [[1, 1, 1, 2, 2], [1, 1, 2, 1, 2], [1, 1, 2, 2, 1], [1, 2, 1, 1, 2], [1, 2, 1, 2, 1], [1, 2, 2, 1, 1], [2, 1, 1, 1, 2], [2, 1, 1, 2, 1], [2, 1, 2, 1, 1], [2, 2, 1, 1, 1]]
3 qubit entangled : [[1, 1, 2, 2, 2], [1, 2, 1, 2, 2], [1, 2, 2, 1, 2], [1, 2, 2, 2, 1], [2, 1, 1, 2, 2], [2, 1, 2, 1, 2], [2, 1, 2, 2, 1], [2, 2, 1, 1, 2], [2, 2, 1, 2, 1], [2, 2, 2, 1, 1]]
4 qubit entangled : [[1, 2, 2, 2, 2], [2, 1, 2, 2, 2], [2, 2, 1, 2, 2], [2, 2, 2, 1, 2], [2, 2, 2, 2, 1]]
5 qubit entangled : [[2, 2, 2, 2, 2]]
Back to top