quri_parts.qsub.eval.callgraph module¶
- class CallGraphEvaluatorHooks¶
Bases:
EvaluatorHooks[dict[Ident|None,dict[Ident,int]]]Report the call graph of a sub.
The result maps each sub to the subs it calls directly. Each callee maps to the number of calls in one invocation of the caller. Callees appear in the order of the first call. A sub that calls no sub maps to an empty dict.
Each sub appears as the
Identof the op it implements, the same valueSubwiseProfileEntryreports assource_op. Parametric subs are distinct per parameter:MCX<5>andMCX<6>are two subs. Only the entry sub ofcompile_subhas no op; its key isNone.- reset()¶
- Return type:
None
- enter_sub(sub, qubits, regs, call_stack)¶
- Parameters:
sub (MachineSub)
qubits (Sequence[Qubit])
regs (Sequence[Register])
call_stack (list[qsub.machineinst.SubId])
- Return type:
bool
- primitive(mop, qubits, regs, call_stack)¶
- exit_sub(sub, enter_sub, call_stack)¶
- Parameters:
sub (MachineSub)
enter_sub (bool)
call_stack (list[qsub.machineinst.SubId])
- Return type:
None