pyqpanda.Visualization.matplotlib_draw ====================================== .. py:module:: pyqpanda.Visualization.matplotlib_draw .. autoapi-nested-parse:: circuit visualization backend. Classes ------- .. autoapisummary:: pyqpanda.Visualization.matplotlib_draw.Anchor pyqpanda.Visualization.matplotlib_draw.MatplotlibDrawer Module Contents --------------- .. py:class:: Anchor(reg_num, yind, fold) .. py:attribute:: gate_anchor :value: 0 .. py:attribute:: b_fold :value: False .. py:attribute:: last_h_pos :value: 0.0 .. py:attribute:: max_x_pos .. py:method:: get_fold_info() .. py:method:: set_fold_info(target_fold, fold_cnt) .. py:method:: update_fold_info(index, gate_width, x_offset, layer_offset) .. py:method:: plot_coord(index, gate_width, x_offset, layer_offset, last_h_pos) .. py:method:: is_locatable(index, gate_width) .. py:method:: set_index(index, gate_width) .. py:method:: get_index() .. py:class:: MatplotlibDrawer(qregs, cregs, ops, scale=1.0, style=None, plot_barriers=True, reverse_bits=False, layout=None, fold=25, ax=None) .. py:attribute:: plot_barriers :value: True .. py:attribute:: reverse_bits :value: False .. py:attribute:: layout :value: None .. py:attribute:: layer_offset :value: 0.0 .. py:attribute:: layer_offset_recode :value: [] if style: if isinstance(style, dict): self._style.set_style(style) elif isinstance(style, str): with open(style, 'r') as infile: dic = json.load(infile) self._style.set_style(dic) .. py:attribute:: fold :value: 25 .. py:attribute:: x_offset :value: 0 .. py:property:: ast .. py:method:: get_op_color(op_name) .. py:method:: set_multi_ctrl_bits(ctrl_state, num_ctrl_qubits, qbit, color_str) .. py:method:: draw(filename=None, verbose=False) .. py:method:: param_parse(v) :staticmethod: .. py:method:: format_numeric(val, tol=1e-05) :staticmethod: .. py:method:: fraction(val, base=np.pi, n=100, tol=1e-05) :staticmethod: