mindquantum.algorithm.compiler.SequentialCompiler
- class mindquantum.algorithm.compiler.SequentialCompiler(compilers: List[BasicCompilerRule], rule_name='SequentialCompiler', log_level=0)[source]
A sequential of compiler.
Every compiler rule in this sequence will be execute one by one.
- Parameters
compilers (List[
BasicCompilerRule
]) – all compiler rules you want.rule_name (str) – name of this compiler. Default:
"SequentialCompiler"
.log_level (int) – the display log level. Could be
0
,1
or2
. For more explanation of log level, please refers toBasicCompilerRule
. Default:0
.
- do(dag_circuit: DAGCircuit)[source]
Apply sequential compiler to dag circuit.
- Parameters
dag_circuit (
DAGCircuit
) – The DAG graph of quantum circuit.
- set_all_log_level(log_level: int)[source]
Set log level for all compiler rule in this sequence.
- Parameters
log_level (int) – the display log level. Could be
0
,1
or2
. For more explanation of log level, please refers toBasicCompilerRule
.