mqt.qudits.visualisation.mini_quantum_information¶

Module Contents¶

get_density_matrix_from_counts(results, circuit)[source]¶
partial_trace(rho, qudits2keep, dims, optimize=False)[source]¶

Calculate the partial trace

p_a = Tr_b(p)

Parameters¶

p2D array

Matrix to trace

qudits2keeparray

An array of indices of the spaces to keep after being traced. For instance, if the space is A x B x C x D and we want to trace out B and D, keep = [0,2]

dimsarray

An array of the dimensions of each space. For instance, if the space is A x B x C x D, dims = [dim_A, dim_B, dim_C, dim_D]

Returns¶

p_a2D array

Traced matrix