Skip to content

QLT IR (qualtran l1) speed improvements - #1939

Open
mpharrigan wants to merge 4 commits into
quantumlib:mainfrom
mpharrigan:2026-08/simple-fast-qlt
Open

QLT IR (qualtran l1) speed improvements#1939
mpharrigan wants to merge 4 commits into
quantumlib:mainfrom
mpharrigan:2026-08/simple-fast-qlt

Conversation

@mpharrigan

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant performance optimizations and feature enhancements to Qualtran's L1 IR serialization and Galois field types. Key improvements include fast-path optimizations for register shape and symbolic checks, a fast hashing and equality mixin for Galois field types, and the implementation of a direct recursive FastL1ASTPrinter to bypass slower visitor patterns. Additionally, L1ModuleBuilder and unique key generation have been optimized, and benchmark scripts have been added. The review feedback suggests that the shape validation in FastL1ASTPrinter is too restrictive as it checks against Python's built-in int instead of numbers.Integral, which fails to support NumPy integer types, and warns against allowing arbitrary sympy.Expr due to serialization limitations.

Comment thread qualtran/l1/_ast_to_code_fast.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant