pyqpanda.Visualization
QPanda Python
Copyright (C) Origin Quantum 2017-2020
Licensed Under Apache Licence 2.0
Submodules
- pyqpanda.Visualization.bloch
- pyqpanda.Visualization.bloch_plot
- pyqpanda.Visualization.circuit_composer
- pyqpanda.Visualization.circuit_draw
- pyqpanda.Visualization.circuit_info
- pyqpanda.Visualization.circuit_style
- pyqpanda.Visualization.draw_probability_map
- pyqpanda.Visualization.exceptions
- pyqpanda.Visualization.matplotlib_draw
- pyqpanda.Visualization.parameterexpression
- pyqpanda.Visualization.pi_check
- pyqpanda.Visualization.quantum_state_plot
- pyqpanda.Visualization.utils
Functions
|
Draw a quantum circuit to different formats (set by output parameter): |
|
|
|
Draw a quantum state probaility dict |
|
Draw a quantum state probaility dict |
|
plot quantum state city |
|
plot quantum state density matrix |
|
convert quantum state to density matrix |
|
Draw a quantum circuit bloch view , only support one qubit |
|
Draw a quantum state bloch view |
|
Draw a quantum state bloch view |
Package Contents
- pyqpanda.Visualization.draw_qprog(prog, output=None, scale=0.7, fold=30, filename=None, with_logo=False, line_length=100, NodeIter_first=None, NodeIter_second=None, console_encode_type='utf8')[源代码]
Draw a quantum circuit to different formats (set by output parameter):
text: ASCII art TextDrawing that can be printed in the console. text: ASCII art TextDrawing that can be printed in the console.
pic: images with color rendered purely in Python.
latex: latex source code of circuit
- Args:
prog : the quantum circuit to draw scale (float): scale of image to draw (shrink if < 1). Only used by the
pic
outputs. flod (int): x_max_size of image to draw. dOnly used by thepic
outputs. Default is 30. filename (str): file path to save image to NodeIter_first: circuit printing start position. NodeIter_second: circuit printing end position. console_encode_type(str): Target console encoding type.Mismatching of encoding types may result in character confusion, 'utf8' and 'gbk' are supported. Only used by the
pic
outputs.line_length (int): Sets the length of the lines generated by text output type.
- Returns:
no return
- pyqpanda.Visualization.draw_probability(list)[源代码]
Draw a quantum state probaility dict
- Args:
list : the quantum state probaility dict
- Returns:
no return
- pyqpanda.Visualization.draw_probability_dict(prob_dict)[源代码]
Draw a quantum state probaility dict
- Args:
list : the quantum state probaility dict
- Returns:
no return
- pyqpanda.Visualization.plot_state_city(state, title='', figsize=None, color=None, ax_real=None, ax_imag=None)[源代码]
plot quantum state city
- Args:
quantum state: complex list title : string for figure color : color for figure
- Returns:
matplot figure
- Raises:
RuntimeError: if input is not a valid quantum state.
- pyqpanda.Visualization.plot_density_matrix(M, xlabels=None, ylabels=None, title=None, limits=None, phase_limits=None, fig=None, axis_vals=None, threshold=None)[源代码]
plot quantum state density matrix
- Args:
quantum state: complex list title : string for figure color : color for figure
- Returns:
matplot figure
- Raises:
RuntimeError: if input is not a valid quantum state.
- pyqpanda.Visualization.state_to_density_matrix(quantum_state)[源代码]
convert quantum state to density matrix
- Args:
quantum state: complex list
- Returns:
density matrix
- Raises:
RuntimeError: if input is not a valid quantum state.
- pyqpanda.Visualization.plot_bloch_circuit(circuit, trace=True, saveas=None, fps=20, secs_per_gate=1)[源代码]
Draw a quantum circuit bloch view , only support one qubit
- Args:
circuit : the quantum circuit trace : whether shows the trace fps : flash fps
- Returns:
bloch figure shows quantum circuit