Skip to content

Fix missing f-string prefix in Circuit error message#132

Merged
gecrooks merged 1 commit intogecrooks:mainfrom
ddri:fix/issue-128-fstring-error-message
Dec 19, 2025
Merged

Fix missing f-string prefix in Circuit error message#132
gecrooks merged 1 commit intogecrooks:mainfrom
ddri:fix/issue-128-fstring-error-message

Conversation

@ddri
Copy link
Contributor

@ddri ddri commented Dec 19, 2025

Summary

  • Fix missing f prefix on second line of error message string
  • Add missing space before "but"

Problem

The error message for incommensurate qubits showed literal {list(qbs)} instead of the actual qubit list:

ValueError: Incommensurate qubits: Expected [0]but received {list(qbs)}

Fix

Added f prefix and space:

raise ValueError(
    f"Incommensurate qubits: Expected {list(qubits)} "
    f"but received {list(qbs)}"
)

Now produces:

ValueError: Incommensurate qubits: Expected [0] but received [0, 1]

Test plan

  • Verified fix manually
  • All existing circuits_test.py tests pass

Fixes #128

The error message for incommensurate qubits was missing the `f` prefix
on the second line of the string, causing `{list(qbs)}` to appear
literally instead of being interpolated. Also added missing space
before "but".

Fixes gecrooks#128
@gecrooks gecrooks merged commit c92066b into gecrooks:main Dec 19, 2025
9 checks passed
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.

Bug: Missing f-string prefix in Circuit error message

2 participants

Comments