pyqpanda.Visualization.matplotlib_draw

circuit visualization backend.

Module Contents

Classes

Anchor

MatplotlibDrawer

class pyqpanda.Visualization.matplotlib_draw.Anchor(reg_num, yind, fold)[source]
get_fold_info()[source]
set_fold_info(target_fold, fold_cnt)[source]
update_fold_info(index, gate_width, x_offset, layer_offset)[source]
plot_coord(index, gate_width, x_offset, layer_offset, last_h_pos)[source]
is_locatable(index, gate_width)[source]
set_index(index, gate_width)[source]
get_index()[source]
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)[source]
property ast[source]
layer_offset_recode = [][source]
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)[source]
set_multi_ctrl_bits(ctrl_state, num_ctrl_qubits, qbit, color_str)[source]
draw(filename=None, verbose=False)[source]
static param_parse(v)[source]
static format_numeric(val, tol=1e-05)[source]
static fraction(val, base=np.pi, n=100, tol=1e-05)[source]