On this page

SchoonschipSettings

symbolica.community.idenso Class

SchoonschipSettings(*, depth_limit: Optional[int] = 1, mode: Optional[SchoonschipMode] = None, traversal: Optional[SchoonschipTraversal] = None, expand_contracted_sums: bool = False, simplify_chain_like_functions: bool = False, schoonschip_rank1_tensors: bool = True, contraction_order: Optional[SchoonschipContractionOrder] = None)

Immutable configuration for expression and network Schoonschip passes.

Constructor

#

Configure traversal, depth, shorthand expansion, and network-contraction policies.

depth_limit=None removes the recursion-depth limit. traversal is ignored in SinglePass mode. mode=None, traversal=None, and contraction_order=None select Recursive, BreadthFirst, and SmallestDegree, respectively.

Parameters

NameTypeDefaultDescription
depth_limitOptional[int]1—
modeOptional[SchoonschipMode]None—
traversalOptional[SchoonschipTraversal]None—
expand_contracted_sumsboolFalse—
simplify_chain_like_functionsboolFalse—
schoonschip_rank1_tensorsboolTrue—
contraction_orderOptional[SchoonschipContractionOrder]None—

Member details

depth_limit

Property · read-only
#
depth_limit: Optional[int]

Maximum parsing or recursion depth, or None for no limit.

mode

Property · read-only
#
mode: SchoonschipMode

Whether the pass is single-pass or recursive.

traversal

Property · read-only
#
traversal: Optional[SchoonschipTraversal]

Recursive traversal order, or None in single-pass mode.

expand_contracted_sums

Property · read-only
#
expand_contracted_sums: bool

Whether contracted sums are expanded before network execution.

simplify_chain_like_functions

Property · read-only
#
simplify_chain_like_functions: bool

Whether chain-like function payloads are simplified recursively.

schoonschip_rank1_tensors

Property · read-only
#
schoonschip_rank1_tensors: bool

Whether rank-one tensors participate in the Schoonschip pass.

contraction_order

Property · read-only
#
contraction_order: SchoonschipContractionOrder

Heuristic used to choose network contractions.

partial

Static method
#
partial() -> SchoonschipSettings

Apply the default shallow recursive expression pass without rank-one tensors.

full

Static method
#
full() -> SchoonschipSettings

Apply one unrestricted-depth pass and include rank-one tensors.

default_network

Static method
#
default_network() -> SchoonschipSettings

Use the settings applied by schoonschip_net when no settings are supplied.

depth_first

Static method
#
depth_first(depth_limit: Optional[int] = None) -> SchoonschipSettings

Recursively simplify each branch before visiting its siblings.

Parameters

NameTypeDefaultDescription
depth_limitOptional[int]None—

breadth_first

Static method
#
breadth_first(depth_limit: Optional[int] = None) -> SchoonschipSettings

Recursively simplify all branches one level at a time.

Parameters

NameTypeDefaultDescription
depth_limitOptional[int]None—

single_pass

Static method
#
single_pass(depth_limit: Optional[int] = None) -> SchoonschipSettings

Visit each eligible expression once, subject to depth_limit.

Parameters

NameTypeDefaultDescription
depth_limitOptional[int]None—