Skip to content

Base

Base protocol and types for move generators.

EntropyNode

Bases: Protocol

Minimal node metadata required by HeuristicMoveGenerator.

MoveGenerator

Bases: Protocol

Interface for generating candidate move sets from a configuration.

Implementations yield candidate move sets. Validation and node creation are handled by ConfigurationTree.expand_node.

generate

generate(
    node: ConfigurationNode, tree: ConfigurationTree
) -> Iterator[frozenset[LaneAddress]]

Yield candidate move sets from the given configuration.

Parameters:

Name Type Description Default
node ConfigurationNode

The configuration to generate moves from.

required
tree ConfigurationTree

The configuration tree (provides arch_spec, path_finder).

required

Yields:

Type Description
frozenset[LaneAddress]

frozenset[LaneAddress] — each candidate parallel move set.

Source code in .venv/lib/python3.12/site-packages/bloqade/lanes/search/generators/base.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def generate(
    self,
    node: ConfigurationNode,
    tree: ConfigurationTree,
) -> Iterator[frozenset[LaneAddress]]:
    """Yield candidate move sets from the given configuration.

    Args:
        node: The configuration to generate moves from.
        tree: The configuration tree (provides arch_spec, path_finder).

    Yields:
        frozenset[LaneAddress] — each candidate parallel move set.
    """
    ...