qdk_chemistry.utils.zassenhaus_generation module

Symbolic generator for Zassenhaus exponents and evaluation plans.

This module provides utilities for generating symbolic Zassenhaus exponents and building structured commutator evaluation plans. The generated plans identify shared nested commutator sub-expressions, enabling efficient caching and linear-time evaluation of the commutator DAG.

class qdk_chemistry.utils.zassenhaus_generation.CommutatorNode(index)[source]

Bases: object

Reference to a nested commutator in a generated evaluation plan.

Parameters:

index (int)

index: int
__init__(index)
Parameters:

index (int)

Return type:

None

qdk_chemistry.utils.zassenhaus_generation.zassenhaus_commutator_plan(leaves, max_order=5)[source]

Compute Zassenhaus exponents and an explicit nested-commutator DAG.

The returned exponents reference either primitive leaves or CommutatorNode instances. The returned plan maps each CommutatorNode to its left and right child references. Nodes are inserted after their children, so iteration over plan.items() gives a valid evaluation order.

Return type:

tuple[dict[int, dict[Hashable | CommutatorNode, Fraction]], dict[CommutatorNode, tuple[Hashable | CommutatorNode, Hashable | CommutatorNode]]]

Parameters:
qdk_chemistry.utils.zassenhaus_generation.zassenhaus_exponents(leaves=('A', 'B'), max_order=5)[source]

Compute C_2, …, C_max_order for an ordered product of primitive leaves.

Return type:

dict[int, dict[Hashable | tuple[Hashable | tuple[Term, Term], Hashable | tuple[Term, Term]], Fraction]]

Parameters: