Skip to main content

stim_to_clifft_text

Function stim_to_clifft_text 

Source
pub fn stim_to_clifft_text(text: &str) -> String
Expand description

Rewrite Stim circuit text back into Clifft: every S[HONEST_T] and S_DAG[HONEST_T] becomes the T/T_DAG it stands for.

The inverse of clifft_to_stim_text up to that function’s EXP_VAL loss. Untagged S gates are genuine Cliffords and are left alone — which is the whole reason the tag exists.

§Examples

// The untagged `S` is a real Clifford and survives untouched.
assert_eq!(
    stim_to_clifft_text("S 0\nS_DAG[HONEST_T] 1\n"),
    "S 0\nT_DAG 1\n",
);