Skip to content

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable

← Module overview

classIsIfElseSimplifiablesource

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable

class IsIfElseSimplifiable

methodis_rewriteablesource

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable.is_rewriteable

def is_rewriteable(node: scf.IfElse) -> bool

Parameters

NameTypeDescription
nodescf.IfElse

Returns

bool

source

methodcontains_ifelsesource

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable.contains_ifelse

def contains_ifelse(stmt: scf.IfElse) -> bool

Check if the IfElse statement contains another IfElse statement.

Parameters

NameTypeDescription
stmtscf.IfElse

Returns

bool

source

methodis_nested_ifelsesource

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable.is_nested_ifelse

def is_nested_ifelse(stmt: scf.IfElse) -> bool

Check if the IfElse statement is nested.

Parameters

NameTypeDescription
stmtscf.IfElse

Returns

bool

source

methodhas_else_bodysource

bloqade.stim.rewrite.ifs_handling.IsIfElseSimplifiable.has_else_body

def has_else_body(stmt: scf.IfElse) -> bool

Check if the IfElse statement has an else body.

Parameters

NameTypeDescription
stmtscf.IfElse

Returns

bool

source