qml.ftqc.convert_to_mbqc_formalism

convert_to_mbqc_formalism(tape, diagonalize_mcms=False)[source]

Convert a circuit to the textbook MBQC formalism based on the procedures outlined in Raussendorf et al. 2003, https://doi.org/10.1103/PhysRevA.68.022312. The circuit must be decomposed to the gate set {CNOT, H, S, RotXZX, RZ, X, Y, Z, Identity, GlobalPhase} before applying the transform.

Note that this transform leaves all Paulis and Identities as physical gates, and applies all byproduct operations online immediately after their respective measurement procedures.

Parameters:

diagonalize_mcms (bool, optional) – When set, the transform inserts diagonalizing gates before arbitrary-basis mid-circuit measurements. Defaults to False.