Skip to content

Add array support to QIR bytecode#3219

Open
orpuente-MS wants to merge 4 commits into
mainfrom
oscarpuente/add-arrays-to-rifla
Open

Add array support to QIR bytecode#3219
orpuente-MS wants to merge 4 commits into
mainfrom
oscarpuente/add-arrays-to-rifla

Conversation

@orpuente-MS
Copy link
Copy Markdown
Contributor

@orpuente-MS orpuente-MS commented May 11, 2026

This PR adds array support to the QIR bytecode consumed by the QIR simulators, closing the current gap in functionality for the RIFLA profile.

@orpuente-MS orpuente-MS marked this pull request as ready for review May 13, 2026 15:59
if init is None:
continue
if not isinstance(init, pyqir.ArrayConstant):
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this the right behavior here? Seems it has an initializer, but it's not of the type expected... shouldn't it error? Why is just silently continuing the right behavior?

if (
isinstance(arr_ty, pyqir.ArrayType)
and isinstance(arr_ty.element, pyqir.IntType)
and arr_ty.element.width == 8
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this because we assume these are output recording labels? Can you add comments here as to why these are being ignored silently also.

):
continue

base_addr = len(self.constant_data)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I find this line confusing. The length of the constant data is the address? So if two constant arrays have the same length they will have the same base address? If it's not as it reads, please add comments to explain.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh I see (I think) - the call below to _encode_array_elements moves the value of self.constant_data as it iterates. Maybe a note here on that to save having to read the rest of the file to understand what his is doing. Thanks.

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.

2 participants