wy_qcos.transpiler.common package

Subpackages

Submodules

wy_qcos.transpiler.common.errors module

exception wy_qcos.transpiler.common.errors.DecomposeException

基类:Exception

Decompose Exception.

exception wy_qcos.transpiler.common.errors.OptException

基类:Exception

Optimization Exception.

exception wy_qcos.transpiler.common.errors.MappingException

基类:Exception

Mapping Exception.

exception wy_qcos.transpiler.common.errors.TranspilerException

基类:Exception

Transpiler Exception.

exception wy_qcos.transpiler.common.errors.CircuitException

基类:Exception

Circuit Exception.

wy_qcos.transpiler.common.transpiler_cfg module

class wy_qcos.transpiler.common.transpiler_cfg.TranspilerCfg(decomp_rule=None, qpu_cfg=None, max_qubits=0, tech_type=None, driver_name=None)

基类:object

Transpiler Config Class.

get_decompose_rule()

Get decompose rule.

set_decompose_rule(decomp_rule)

Set decompose rule.

参数:

decomp_rule -- decomposition rule

get_qpu_cfg()

Get qpu cfg.

set_qpu_cfg(qpu_cfg)

Set qpu cfg.

参数:

qpu_cfg -- qpu config

get_max_qubits()

Get max qubits.

返回:

max qubits

set_max_qubits(max_qubits)

Set qpu cfg.

参数:

max_qubits -- max qubits

get_tech_type()

Get tech type.

返回:

tech type

set_tech_type(tech_type)

Set tech type.

参数:

tech_type -- tech type

get_driver_name()

Get driver name.

返回:

driver name

set_driver_name(driver_name)

Set driver name.

参数:

driver_name -- driver name

wy_qcos.transpiler.common.utils module

class wy_qcos.transpiler.common.utils.TransLogger(logfile=None, allowed_tags=None)

基类:object

log_perf(msg)

Performance log (INFO level).

log_error(msg)

Error log (ERROR level).

log_warning(msg)

Warning log (WARNING level).

log_debug(msg)

DEBUG log (DEBUG level).

set_allowed_tags(tags)
set_log_file(log_file)

Set log file path for output.

Description: Output content will be written to the output file.

If None, logs will only be output to console.

参数:

log_file -- Path to the log file.

class wy_qcos.transpiler.common.utils.Timer

基类:object

class wy_qcos.transpiler.common.utils.TranspilePerfConstant

基类:object

QASM_FILE = 'qasm文件'
NUM_QUBITS = '比特数'
DEPTH = '电路深度'
TECH_TYPE = 'qpu类型'
OPT_LEVEL = '优化级别'
PARSE_TIME = '解析时间(s)'
OPT_TIME1 = '优化1(s)'
DECOMPOSE_RULE_TIME = '分解规则(s)'
DECOMPOSE_1Q2Q_TIME = '分解1q2q(s)'
MAPPING_TIME = '映射时间(s)'
DECOMPOSE_APPLY_TIME = '分解应用(s)'
DECOMPOSED_TIME = '分解总时间(s)'
OPT_TIME2 = '优化2(s)'
TRANSPILE_TIME = '转译时间(s)'
TOTAL_TIME = '总时间(s)'
CONS_DICT = {'qasm文件': 0, 'qpu类型': 3, '优化1(s)': 6, '优化2(s)': 12, '优化级别': 4, '分解1q2q(s)': 8, '分解应用(s)': 10, '分解总时间(s)': 11, '分解规则(s)': 7, '总时间(s)': 14, '映射时间(s)': 9, '比特数': 1, '电路深度': 2, '解析时间(s)': 5, '转译时间(s)': 13}
class wy_qcos.transpiler.common.utils.TranspileRuntime

基类:object

add_runtime(runtime)
参数:

runtime (TranspileRuntime)

avg_runtime(run_count)

Module contents