Skip to content

ProgramSet num_executables incorrectly assigned with non-indexed TensorProduct #1167

@sesmart

Description

@sesmart

Describe the bug

Running a variant of #1166, with input parameters specified, leads to a modulo division error in running a ProgramSet. Apparently num_executables is registered as 0 without non-zero programs.

To reproduce

device.run(ProgramSet(
    CircuitBinding(
        circuit=Circuit().h(0).h(1),
        observables= [Z() @ Z()],
        input_sets=[{"alp":0}]
    ), shots_per_executable=100)).result()

Expected behavior

Should run okay?

Screenshots or logs

--> 690 shots_per_executable, remainder = divmod(shots, program_set.num_executables)
691 if remainder:
692 raise ValueError("Total shots must be divisible by number of executables.")

ZeroDivisionError: integer division or modulo by zero

System information
A description of your system. Please provide:

  • Amazon Braket Python SDK version: 1.103.0
  • Amazon Braket Python Schemas version: 1.26.1
  • Amazon Braket Python Default Simulator version: 1.32.0
  • Python version: 3.12.10

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions