microsoft / microsoft/qdk

Allow some updates to "dynamic array" in adaptive profile

Open
#2,072 2 comments 0 reactions 0 assignees View on GitHub
enhancement low-priority
Dominant language
Rust
Stars
1k
Forks
212
Avg merge
3d 8h
Merged PRs (30d)
65

Description

This page describes what we can do with dynamic arrays in adaptive profile.
https://github.com/microsoft/qsharp/wiki/QIR#use-of-dynamically-sized-array
Specifically the following example doesn't work.

![Image](https://github.com/user-attachments/assets/609f202a-6dee-4ed3-9ca5-de403e4a958b)

But replacing this array elements with individual variables works fine.

![Image](https://github.com/user-attachments/assets/efe03cff-dfbd-4d00-96c3-dfba811b21c4)

Consider supporting this scenario as array size doesn't change here. It is useful to have arrays as a way to group qubits and other types into registers of statically known size. In fact, most array sizes are statically known.

Contributor guide

Open the contributing guide

Research direction

Start with the linked QIR wiki section and reproduce the dynamic-array example in an adaptive profile. Compare it with the version using individual variables, then identify the compiler entry point that rejects updates to arrays whose size remains unchanged. Done means the documented dynamic-array scenario works while preserving the existing restriction on changing array size.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, quantum-computing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.