QPanda3
Supported by OriginQ
载入中...
搜索中...
未找到
pyqpanda3.profiling.profiling 命名空间参考

函数

 draw_circuit_profile (Union[pq.QCircuit, pq.QProg] circuit, dict gate_times, bool is_show=False, str out_file=None)
 Draw a profile of the quantum circuit's performance.
 
 _find_layers (G)
 
 draw_circuit_DAG (pq.QCircuit circuit, bool is_show=False, save_fn=None)
 Draw the Directed Acyclic Graph (DAG) representation of the quantum circuit.
 
 draw_circuit_features (Union[pq.QCircuit, pq.QProg] circuit, bool is_show=False, str save_fn=None, str title='')
 Draws the features of a quantum circuit and visualizes them as a radar chart.
 

函数说明

◆ _find_layers()

pyqpanda3.profiling.profiling._find_layers ( G)
protected

◆ draw_circuit_DAG()

pyqpanda3.profiling.profiling.draw_circuit_DAG ( pq.QCircuit circuit,
bool is_show = False,
save_fn = None )

Draw the Directed Acyclic Graph (DAG) representation of the quantum circuit.

参数
circuitThe quantum circuit object to be drawn, which contains the structure and details of the circuit.
is_showA boolean flag indicating whether to display the DAG graph after drawing. Defaults to False.
save_fnA function or method to save the generated DAG representation. If provided, the graph will be saved according to the specified function. If None, the graph will not be saved.
返回
None, This function does not return a value but will draw the DAG representation of the quantum circuit and may display it or save it based on the provided parameters.

◆ draw_circuit_features()

pyqpanda3.profiling.profiling.draw_circuit_features ( Union[pq.QCircuit, pq.QProg] circuit,
bool is_show = False,
str save_fn = None,
str title = '' )

Draws the features of a quantum circuit and visualizes them as a radar chart.

This function takes a quantum circuit or program as input, computes various features such as connectivity, liveness, parallelism, entanglement, and depth, and then plots these features in a radar chart.

参数
circuitThe quantum circuit or program to analyze. This can be either an instance of pq.QCircuit or pq.QProg.
is_showA boolean flag indicating whether to display the plot. Defaults to False.
save_fnAn optional string for the filename to save the plot. If None, the plot will not be saved.
titleAn optional title for the plot. Defaults to an empty string.
返回
None This function does not return any value. It directly generates and displays the radar chart based on the computed features.
注解
The function computes the following features:
  • Connectivity
  • Liveness
  • Parallelism
  • Entanglement
  • Critical Depth

◆ draw_circuit_profile()

pyqpanda3.profiling.profiling.draw_circuit_profile ( Union[pq.QCircuit, pq.QProg] circuit,
dict gate_times,
bool is_show = False,
str out_file = None )

Draw a profile of the quantum circuit's performance.

参数
circuitThe quantum circuit object to be drawn, containing the structure and information of the circuit.
gate_timesA dictionary where the keys are the names of the quantum gates and the values are the execution times of each gate (units can be seconds or milliseconds).
is_showA boolean flag indicating whether to display the graph after drawing. Defaults to False.
out_fileThe path and filename to save the output. If provided, the graph will be saved to this file. If None, the graph will not be saved.
返回
None, This function does not return a value but will draw the performance profile of the quantum circuit and may save it to a file or display it based on the provided parameters.