wy_qcos.transpiler.qiskit package

Submodules

wy_qcos.transpiler.qiskit.generate_openqasm module

wy_qcos.transpiler.qiskit.generate_openqasm.generate_random_qasm(width, depth, max_operands=3, qasm_version='3.0', output_file='qasm_temp.qasm')

Generate a random circuit with width and depth.

参数:
  • width (int) -- number of qubits

  • depth (int) -- depth of quantum circuit

  • max_operands (int) -- maximum qubit operands of each gate

  • qasm_version (str) -- version of openqasm, support "2.0" or "3.0"

  • output_file (str) -- output path for openqasm file

wy_qcos.transpiler.qiskit.transpiler_qiskit module

class wy_qcos.transpiler.qiskit.transpiler_qiskit.TranspilerQiskit(opt_level=Constant.DEFAULT_OPTIMIZATION_LEVEL)

基类:TranspilerBase

Transpiler Class for Qiskit.

参数:

opt_level (int)

init_transpiler()

Init transpiler.

parse(src_code_dict, code_type=Constant.CODE_TYPE_QASM2)

Parse src_code_dict.

参数:
  • src_code_dict (dict) -- src_code_dict

  • code_type (str) -- code type

返回:

parse result

transpile(parse_result, supp_basis_gates)

Transpile codes.

参数:
  • parse_result (QuantumCircuit) -- parse result

  • supp_basis_gates (list) -- supported basis gates

返回:

transpiled quantum circuit

wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd module

wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd.read_qasm_from_file(file_path)
wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd.check_file_args(input_file, output_file)
wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd.main_qiskit_transpiler(input_file, basis_gates='', opt_level=Constant.DEFAULT_OPTIMIZATION_LEVEL, config_file='', output_file='')

qiskit-transpiler performance test.

参数:
  • input_file (str)

  • basis_gates (str)

  • opt_level (int)

  • config_file (str)

  • output_file (str)

wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd.get_parse_args()
wy_qcos.transpiler.qiskit.transpiler_qiskit_cmd.main(argv=None)

Module contents