qpandalite.transpiler package#
Submodules#
qpandalite.transpiler.timeline module#
Compiled circuit timeline analysis and visualization.
This module provides tools for analyzing and visualizing the temporal execution schedule of compiled quantum programs.
- qpandalite.transpiler.timeline.create_time_line_table(layer_dict, qubit_list, time_line)[源代码]
Create a pandas DataFrame timeline table.
- 参数:
layer_dict -- Dict mapping layer index to gate info.
qubit_list -- List of qubit indices.
time_line -- List of time steps.
- 返回:
Timeline table with qubits as rows and time steps as columns.
- 返回类型:
pd.DataFrame
- qpandalite.transpiler.timeline.format_result(compiled_prog)[源代码]
Format compiled program JSON into gate layers and qubit/time lists.
- 参数:
compiled_prog -- JSON string of compiled program.
- 返回:
(gate_layers, qubit_list, time_line)
- 返回类型:
tuple
- qpandalite.transpiler.timeline.plot_time_line(compiled_prog, figure_save_path=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qpanda-lite/checkouts/v0.3.0/docs/timeline_plot'))[源代码]
Plot the quantum circuit timeline and save as PDF.
- 参数:
compiled_prog -- JSON string of compiled program.
figure_save_path -- Directory to save timeline PDF files.
qpandalite.transpiler.converter module#
OriginIR and OpenQASM2 format conversion utilities.
This module provides bidirectional conversion between OriginIR and OpenQASM2 quantum circuit representations.
- qpandalite.transpiler.converter.convert_oir_to_qasm(originir_str)[源代码]
Convert OriginIR to OpenQASM2.
- 参数:
originir_str (str)
- 返回类型:
str
- qpandalite.transpiler.converter.convert_qasm_to_oir(qasm_str)[源代码]
Convert OpenQASM2 to OriginIR.
- 参数:
qasm_str (str)
- 返回类型:
str
qpandalite.transpiler.draw module#
Quantum circuit visualization tools.
This module provides text-based circuit drawing capabilities for quantum programs in OriginIR or QASM format.
- qpandalite.transpiler.draw.draw(ir_str, language='OriginIR')[源代码]
Draw the circuit in text format.
- 参数:
ir_str (str) -- The input circuit in OriginIR or QASM format.
language (str) -- The language of the input circuit. Default is 'OriginIR'.
- 返回:
The QProg object of the input circuit.
- 返回类型:
qprog (QProg)