diff --git a/pyzx/drawing.py b/pyzx/drawing.py index d9d14ff3..02284a8e 100644 --- a/pyzx/drawing.py +++ b/pyzx/drawing.py @@ -604,6 +604,8 @@ def print_matrix(m: Union[np.ndarray,BaseGraph,Circuit]) -> None: """Display a Label() Jupyter widget with a pretty LaTeX representation of the given matrix. Instead of a matrix, can also give a Circuit or Graph. """ + if get_mode() != "notebook": + raise TypeError("Unsupported mode for print_matrix: '{}'".format(get_mode())) display(get_matrix_label(m))