Quantikz circuit export

oracq.infrastructure.backends.quantikz

quantikz circuit export of RIR modules: module structure is preserved, without expanding calls and repeats.

oracq.infrastructure.backends.quantikz.quantikz(source, *, wire_labels=True, name=None)[source]

Draw the entry module of an Operation or Program as quantikz code.

Calls are drawn as boxes carrying the module name (open oracle slots use dashes), Repeat/Adjoint group frames annotate the count and dagger via remember picture overlays, and Controls expand into control points; QRAM Loads are drawn as resource boxes. The structure stays identical to RIR, with no expansion or inlining. name fixes the matrix node name so several circuits can be placed in the same document.

Parameters:
  • source – A Program, an Operation, or an input-model object with an operation attribute.

  • wire_labels – Whether to draw register name and bit index labels on the left of each quantum wire.

  • name – TikZ matrix node name, for placing several circuits in one document; generated from the module name when omitted.

Returns:

The quantikz LaTeX source of the entry module.

Return type:

str