Modifies a color by multiplying (1-lightness) by the given amount. Numbers less than 1 result in a lighter color, and numbers greater than 1 result in a darker color.
multiply_lightness("g", 0.3) multiply_lightness("#F034A3", 0.6) multiply_lightness((0.3, 0.55, 0.1), 0.5)
tuple) – A matplotlib color string, hex string, or RGB tuple.
float) – The amount to multiply (1-lightness) of the input color by.
An RGB tuple.
- Return type
plot_mat(mat, xlabels=2, ylabels=2, show_values=True, ax=None)¶
Plots a complex matrix with labeling with the following properties:
Color is dictated by the complex angle of each cell.
Transparency (alpha) is decided by the magnitude of each cell.
Size of plot scales based on shape of
phase = [np.exp(1j * t *np.pi) for t in np.linspace(0, 1, 16)] plot_mat(np.outer(phase, phase))
numpy.ndarray-like) – A real or complex matrix.
None) – Either
None, an iterable of labels for the x-axis, or the dimension of the subsystems where the x axis labels are the computational basis states as inferred from the size of mat. If
None, the axis will be labelled by the numbers that index the columns.
None) – Either
None, an iterable of labels for the y-axis, or the dimension of the subsystems where the x axis labels are the computational basis states as inferred from the size of mat. If
None, the axis will be labelled by the numbers that index the rows.
bool) – Whether to show the numeric values of the matrix in each cell.
matplotlib.Axis) – An existing axis to plot on. If not given, a new figure will be created.