pyqpanda.Visualization.matplotlib_draw

circuit visualization backend.

Module Contents

Classes

Anchor

MatplotlibDrawer

class pyqpanda.Visualization.matplotlib_draw.Anchor(reg_num, yind, fold)[源代码]
get_fold_info()[源代码]
set_fold_info(target_fold, fold_cnt)[源代码]
update_fold_info(index, gate_width, x_offset, layer_offset)[源代码]
plot_coord(index, gate_width, x_offset, layer_offset, last_h_pos)[源代码]
is_locatable(index, gate_width)[源代码]
set_index(index, gate_width)[源代码]
get_index()[源代码]
class pyqpanda.Visualization.matplotlib_draw.MatplotlibDrawer(qregs, cregs, ops, scale=1.0, style=None, plot_barriers=True, reverse_bits=False, layout=None, fold=25, ax=None)[源代码]
property ast[源代码]
layer_offset_recode = [][源代码]
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)

get_op_color(op_name)[源代码]
set_multi_ctrl_bits(ctrl_state, num_ctrl_qubits, qbit, color_str)[源代码]
draw(filename=None, verbose=False)[源代码]
static param_parse(v)[源代码]
static format_numeric(val, tol=1e-05)[源代码]
static fraction(val, base=np.pi, n=100, tol=1e-05)[源代码]