Skip to content

feat: Merge program set task results#1254

Open
speller26 wants to merge 2 commits into
splitfrom
merge
Open

feat: Merge program set task results#1254
speller26 wants to merge 2 commits into
splitfrom
merge

Conversation

@speller26

Copy link
Copy Markdown
Member

Introduce merge method to ProgramSetQuantumTaskResult that combines multiple results into one.

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Introduce `merge` method to `ProgramSetQuantumTaskResult` that combines multiple results into one.
@speller26 speller26 requested a review from a team as a code owner May 10, 2026 21:47
@speller26 speller26 mentioned this pull request May 10, 2026
5 tasks
@speller26

Copy link
Copy Markdown
Member Author

If this is approved before #1249, we can merge this cleanly into the split branch and assume the files are reviewed in that PR.

Comment thread src/braket/tasks/program_set_quantum_task_result.py Outdated
Comment thread src/braket/tasks/program_set_quantum_task_result.py
return num_ps * num_obs


def _buffer_result(

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.

Can we add a description to this function? The other ones are straightforward but this has more complexity and _buffer_result is a bit vague.

Comment thread src/braket/tasks/program_set_quantum_task_result.py
Comment thread src/braket/tasks/program_set_quantum_task_result.py
Comment thread src/braket/tasks/program_set_quantum_task_result.py Outdated
Comment thread src/braket/tasks/program_set_quantum_task_result.py
Comment thread src/braket/tasks/program_set_quantum_task_result.py Outdated
And other minor changes
Comment thread src/braket/tasks/program_set_quantum_task_result.py
Comment thread src/braket/tasks/program_set_quantum_task_result.py
start = 0
for binding_idx, binding in enumerate(program_set.entries):
count = _count_executables(binding)
program = programs[binding_idx]

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.

Why don't we just calculate the ir on the fly here? I.e. _binding_to_program(binding)? Feel like you don't need programs variable above.

for b in program_set.entries
],
deviceParameters=None, # TODO: find a way to fill this in
createdAt=min(m.createdAt for m in metas if m.createdAt),

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.

This apparently fails on local sim, i.e. when this list is empty?
ValueError: min() iterable argument is empty

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is only really intended for AwsDevice; the local simulator doesn't actually need splitting

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.

Hm....it might still be nice for validating / emulator usage, or use in other routines? Is it easy enough to catch?

],
deviceParameters=None, # TODO: find a way to fill this in
createdAt=min(m.createdAt for m in metas if m.createdAt),
endedAt=max(m.endedAt for m in metas if m.endedAt),

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.

Same as above

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