quri_parts.qsub.codegen module

class CodeGenerator(ops)

Bases: object

Parameters:

ops (Iterable[AbstractOp])

is_primitive(op)
Parameters:

op (Op)

Return type:

bool

lower(sub, source_op_id=None)

Lower sub to a MachineSub.

Parameters:
  • sub (Sub) – The sub to lower.

  • source_op_id (Ident | None) – Identifier of the op sub implements, recorded on the result so evaluators can name it. Leave None for a sub that does not implement an op, such as an entry sub.

Return type:

MachineSub