quantax.operator.nflips_filter#
- quantax.operator.nflips_filter(opstr: str, indices: Sequence[int]) dict[str, int]#
A filter that assigns the number of flipped sites (
nflips) as the update mode.nflipsis the number of off-diagonal characters inopstr(everything not inDIAGONAL_OPS), which equals the number of single-site flips the term applies to a configuration. Operator terms are then grouped bynflipsso that a model supporting reference updates can size its low-rank update accordingly. The"nflips"key is the update mode requested by such models viarequired_update_modes.- Parameters:
opstr – The operator string.
indices – The site indices the operator acts on.
- Returns:
A dictionary
{"nflips": <number of flipped sites>}.