Skip to content

馃悰 Classical bits are not cleared by the CLI's reset command#464

Description

@rturrado

馃 AI text below 馃

Problem statement

resetSimulationState in src/backend/dd/DDSimDebug.cpp rebuilds the quantum state on reset but leaves ddsim->variables (the map of classical bit values) untouched. After a first run followed by reset, reading c[k] returns the value from the previous run rather than the initial false, and the next measure on the same bit looks like a no-op because the bit already holds the value it would receive.

Surfaced during the follow-up work on issue #168 (PR #456) and again during the review of PR #463.

Proposed solution

resetSimulationState should return the classical side to its initial state (all bits to false), the same way the quantum side is rebuilt to zero.

Out of scope

  • Persisting classical bit values across code reloads.
  • Restoring classical bits when stepping backward past a measurement (tracked in a separate issue).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions