mqt.qudits.visualisation¶

Submodules¶

Package Contents¶

draw_qudit_local(circuit: QuantumCircuit) None[source]¶
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

plot_counts(result, circuit: QuantumCircuit) None[source]¶
plot_state(result: ndarray, circuit: QuantumCircuit, errors=None) None[source]¶