amazon-braket-sdk-python icon indicating copy to clipboard operation
amazon-braket-sdk-python copied to clipboard

ProgramSet num_executables incorrectly assigned with non-indexed TensorProduct

Open sesmart opened this issue 1 month ago • 0 comments

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.

sesmart avatar Nov 19 '25 19:11 sesmart