Skip to content

Add test for add_op_to_circuit unsupported gate#1028

Draft
mhucka wants to merge 3 commits intoquantumlib:mainfrom
mhucka:testing-improvement-unsupported-gate-error-test-9353109264355801897
Draft

Add test for add_op_to_circuit unsupported gate#1028
mhucka wants to merge 3 commits intoquantumlib:mainfrom
mhucka:testing-improvement-unsupported-gate-error-test-9353109264355801897

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Mar 26, 2026

Added a test case for the ValueError raised when an unsupported gate is passed to add_op_to_circuit. Also improved the library code by adding an explicit check for unsupported gates early in the function.

Added a test case for the ValueError raised when an unsupported gate
is passed to add_op_to_circuit. Also improved the library code by
adding an explicit check for unsupported gates early in the function.
@github-actions github-actions bot added the size: S 10< lines changed <50 label Mar 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a validation check in qsimcirq/qsim_circuit.py to ensure that only supported gates are added to a circuit. If an unsupported gate is encountered, a ValueError is now raised. A corresponding test case, test_add_op_to_circuit_unsupported_gate, has been added to qsimcirq_tests/qsimcirq_test.py to verify this new error handling. There is no feedback to provide as no review comments were given.

…ted gate

Added a test case for the ValueError raised when an unsupported gate
is passed to add_op_to_circuit. Refactored the ValueError message to
use an f-string as requested. Improved the library code by adding an
explicit check for unsupported gates early in the function. Corrected
formatting using black to comply with project guidelines.
@github-actions github-actions bot added size: L 250< lines changed <1000 and removed size: S 10< lines changed <50 labels Mar 26, 2026
@mhucka mhucka marked this pull request as draft March 27, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L 250< lines changed <1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant