Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust DynamicsBackend level 2 result formatting to match BackendSamplerV2's expectations #373

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qiskit_dynamics/backend/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _get_memory_slot_probabilities(
level = str(max_outcome_value)
memory_slot_result[-(idx + 1)] = level

memory_slot_result = "".join(memory_slot_result)
memory_slot_result = hex(int("".join(memory_slot_result), 2))
if memory_slot_result in memory_slot_probs:
memory_slot_probs[memory_slot_result] += prob
else:
Expand Down
2 changes: 1 addition & 1 deletion qiskit_dynamics/backend/dynamics_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def default_experiment_result_function(

# construct results object
exp_data = ExperimentResultData(
counts=counts, memory=memory_samples if backend.options.memory else None
counts=counts, memory=memory_samples.tolist() if backend.options.memory else None
)
return ExperimentResult(
shots=backend.options.shots,
Expand Down
Loading