wy_qcos.transpiler.cmss package

Subpackages

Submodules

wy_qcos.transpiler.cmss.transpiler_cmd_line module

class wy_qcos.transpiler.cmss.transpiler_cmd_line.TranspileParams

基类:object

Transpile prameters for a single run.

class wy_qcos.transpiler.cmss.transpiler_cmd_line.CMSSTranspilerPerf

基类:object

static init_output_head(output_file_path, file_path, opt_level, tech_type, config_file, mapping_options)

Init output log head.

参数:
  • output_file_path (str) -- The output file path.

  • file_path (str) -- The input file path.

  • opt_level (int) -- The optimization level.

  • tech_type (str) -- The technology type.

  • config_file (str) -- The technology config file.

  • mapping_options (dict) -- The mapping options.

static check_file_args(input_file, output_file)

Check whether the input file and output file exist.

参数:
  • input_file (str) -- The input file path.

  • output_file (str) -- The output file path.

返回:

The resolved input file path. output_file_path(Path): The resolved output file path.

返回类型:

file_path(Path)

static read_qasm_from_file(file_path)
init_transpile_params(extra_configs)

Init transpile parameters.

parse_file_args()

Parse input arguments from config file.

main_cmss_transpiler(config_file='')
参数:

config_file (str)

get_transpile_result()
cmss_transpiler_perf_exec(input_file='', opt_level=Constant.DEFAULT_OPTIMIZATION_LEVEL, base_gates=[], tech_type='', config_file='', mapping_options={})

cmss-transpiler performance test for single run.

参数:
  • input_file (str) -- input qasm file path

  • opt_level (int) -- optimization level

  • base_gates (list) -- base gates for technology type

  • tech_type (str) -- technology type

  • config_file (str) -- config file path of technology type

  • mapping_options (dict) -- mapping options

返回:

the runtime of phase of transpile

返回类型:

TranspileRuntime

wy_qcos.transpiler.cmss.transpiler_cmd_line.get_parse_args()
wy_qcos.transpiler.cmss.transpiler_cmd_line.main(argv=None)

wy_qcos.transpiler.cmss.transpiler_cmss module

class wy_qcos.transpiler.cmss.transpiler_cmss.TranspilerCmss(optimization_level=Constant.DEFAULT_OPTIMIZATION_LEVEL, enable_na_move=False)

基类:TranspilerBase

Transpiler Class for CMSS.

参数:
  • optimization_level (int)

  • enable_na_move (bool)

init_transpiler()

Init transpiler.

mapping(qpu_cfg, opt_result_dict)

Mapping.

参数:
  • qpu_cfg -- qpu_cfg

  • opt_result_dict -- opt_result_dict

返回:

mapping result. mapping_dict; mapping dict. init_layout_dict: initial layout dict. final_layout_dict: final layout dict.

返回类型:

mapping_res

parse(src_code_dict, code_type=Constant.CODE_TYPE_QASM)

Parse src_code_dict.

参数:
  • src_code_dict (dict) -- src_code_dict

  • code_type (str) -- code type

返回:

quantum circuit parsed by cmss

返回类型:

parse result(QuantumCircuit)

transpile(parse_result, supp_basis_gates)

CMSS transpiler function.

参数:
  • parse_result -- parse result

  • supp_basis_gates (list) -- supported basis gates

返回:

basis gate list by cmss transpiler mapping_dict(dict): mapping dict by cmss mapping. only for neutral atom now

返回类型:

basis gate list(list)

Module contents