Skip to content

Add unit test for random circuit generation#1056

Merged
mhucka merged 6 commits into
tensorflow:masterfrom
kenya-sk:test-random-circuit-shape
May 12, 2026
Merged

Add unit test for random circuit generation#1056
mhucka merged 6 commits into
tensorflow:masterfrom
kenya-sk:test-random-circuit-shape

Conversation

@kenya-sk
Copy link
Copy Markdown
Contributor

@kenya-sk kenya-sk commented Apr 27, 2026

I have addressed Issue #1037.
This test case check the output shape and type from random_circuit_resolver_batch and random_symbol_circuit_resolver_batch.

The following are the results of test cases.

$ bazel test //tensorflow_quantum/python:util_test

INFO: Elapsed time: 19.225s, Critical Path: 14.43s
INFO: 204 processes: 3 internal, 201 local.
INFO: Build completed successfully, 204 total actions
//tensorflow_quantum/python:util_test                                    PASSED in 8.0s

Executed 1 out of 1 test: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

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 unit tests for random_circuit_resolver_batch and random_symbol_circuit_resolver_batch to verify their output types and shapes. The review feedback suggests expanding the test coverage to include cases where include_channels=True, as well as adding more rigorous assertions to ensure circuits are correctly parameterized or non-parameterized as expected.

Comment thread tensorflow_quantum/python/util_test.py Outdated
Comment thread tensorflow_quantum/python/util_test.py
Comment thread tensorflow_quantum/python/util_test.py
@mhucka mhucka self-assigned this May 6, 2026
@mhucka mhucka changed the title add: unit test for random circuit generation Add unit test for random circuit generation May 11, 2026
@mhucka mhucka added area/tests Involves tests and testing of the TFQ codebase labels May 11, 2026
Copy link
Copy Markdown
Member

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@mhucka mhucka added this pull request to the merge queue May 12, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 12, 2026
@mhucka mhucka added this pull request to the merge queue May 12, 2026
Merged via the queue into tensorflow:master with commit bb83806 May 12, 2026
8 of 9 checks passed
@kenya-sk kenya-sk deleted the test-random-circuit-shape branch May 13, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tests Involves tests and testing of the TFQ codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants