Skip to content

Add default dim=2 to Cirq QRE qubit manager qalloc APIs#3293

Merged
msoeken merged 3 commits into
mainfrom
copilot/fix-qalloc-default-dim
Jun 5, 2026
Merged

Add default dim=2 to Cirq QRE qubit manager qalloc APIs#3293
msoeken merged 3 commits into
mainfrom
copilot/fix-qalloc-default-dim

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

Cirq interop qubit allocation failed during decomposition/resource-estimation flows when qalloc(...) was called without an explicit dim, raising a missing-argument error. This updates the affected manager APIs to match expected qubit-default behavior.

  • Scope

    • Updated qalloc signatures in /source/qdk_package/qdk/qre/interop/_cirq.py for:
      • _TypedQubitManager
      • PeakUsageGreedyQubitManager
  • Behavioral change

    • Both methods now default dim to 2, allowing call sites that omit dim to allocate standard qubits without error.
  • Result

    • Existing callers that pass dim explicitly are unchanged.
    • Callers that invoke qalloc(n) now work as intended.
# before
def qalloc(self, n: int, dim: int, ...)

# after
def qalloc(self, n: int, dim: int = 2, ...)

Co-authored-by: fedimser <14271071+fedimser@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing default parameter dim=2 in qalloc method Add default dim=2 to Cirq QRE qubit-manager qalloc APIs Jun 4, 2026
Copilot AI requested a review from fedimser June 4, 2026 17:33
Co-authored-by: fedimser <14271071+fedimser@users.noreply.github.com>
Copilot AI changed the title Add default dim=2 to Cirq QRE qubit-manager qalloc APIs Add default dim=2 to Cirq QRE qubit manager qalloc APIs Jun 4, 2026
@fedimser fedimser marked this pull request as ready for review June 4, 2026 20:07
@msoeken msoeken added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit 63725ce Jun 5, 2026
13 checks passed
@msoeken msoeken deleted the copilot/fix-qalloc-default-dim branch June 5, 2026 11:19
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.

Missing default parameter dim=2 in qalloc in PeakUsageGreedyQubitManager in QRE Cirq interop

3 participants