fhelium.core.rotation
Rotation-step decomposition helpers.
decompose_power_of_two_rotation
function View source
python
def decompose_power_of_two_rotation(rotation_step: int, num_slots: int) -> list[int]: ...1
Decompose a signed rotation into positive power-of-two steps.
decompose_signed_power_of_two_rotation
function View source
python
def decompose_signed_power_of_two_rotation(rotation_step: int, num_slots: int) -> list[int]: ...1
Decompose a cyclic rotation into a minimal signed power-of-two path.
The result is the non-adjacent form of the canonical rotation in [-num_slots/2, num_slots/2). Unlike decompose_power_of_two_rotation, negative steps are retained, so a key planner can trade a smaller key inventory against composed rotations without turning a short negative rotation into a long positive path.
decompose_rotation_step
function View source
python
def decompose_rotation_step(rotation_step: int, num_slots: int, rotation_keys: Mapping[int, object]) -> list[int]: ...1
Find the shortest cyclic decomposition using installed keys only.