Skip to content

Qualtran-L1: Objectstrings#1823

Merged
mpharrigan merged 14 commits intoquantumlib:mainfrom
mpharrigan:2025-07/l1-objectstring
Mar 9, 2026
Merged

Qualtran-L1: Objectstrings#1823
mpharrigan merged 14 commits intoquantumlib:mainfrom
mpharrigan:2025-07/l1-objectstring

Conversation

@mpharrigan
Copy link
Collaborator

Qualtran defines bloq classes, but we need to provide compile-time classical parameters to instantiate those into bloq objects.

In principle, arbitrary Python values can be used as classical parameters, as long as they are immutable and hashable. For a human readable intermediate representation, qualtran.l1 implements a limited serialization syntax called objectstrings that roughly mimics standard Python object instantiation.

image

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

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

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 objectstrings, a new serialization format for bloq classical parameters, along with the necessary parsing and evaluation infrastructure in a new qualtran.l1 package. A developer tool to generate a manifest of all bloqs using this format is also included. However, the implementation is vulnerable to insecure deserialization, which could lead to Remote Code Execution (RCE) if the 'safe' mode is disabled. The parser and evaluator also lack limits on nesting depth and array size, making them susceptible to Denial of Service (DoS) attacks via recursion depth exhaustion and memory exhaustion. Furthermore, a critical bug in the string parsing logic has been identified that could lead to incorrect behavior when handling strings with special characters.

@mpharrigan mpharrigan merged commit 99fe289 into quantumlib:main Mar 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant