mindquantum.algorithm.compiler.BasicCompilerRule
- class mindquantum.algorithm.compiler.BasicCompilerRule(rule_name='BasicCompilerRule', log_level=0)[source]
The basic compiler rule class.
Compiler rule will handle a
DAGCircuitand compile it following the rule in thedomethod. You must implement thedomethod when inheritance a child compiler rule. Please make sure that thedomethod will return a bool, which will tell whether the compiler successful compiled the circuit.- Parameters
- abstract do(dag_circuit: DAGCircuit)[source]
Inplace applying this compiler rule to the
DAGCircuit.- Parameters
dag_circuit (
DAGCircuit) – The DAG graph of quantum circuit.
- set_log_level(log_level: int)[source]
Set display log level.
- Parameters
log_level (int) – the display log level. Could be
0,1or2. For more explanation of log level, please refers toBasicCompilerRule.