Skip to content

Speed up hamiltonian_simulation_by_gqsp_test and mark slow tests#1878

Open
mpharrigan wants to merge 4 commits into
quantumlib:mainfrom
mpharrigan:2026-06/gqsp-tensor
Open

Speed up hamiltonian_simulation_by_gqsp_test and mark slow tests#1878
mpharrigan wants to merge 4 commits into
quantumlib:mainfrom
mpharrigan:2026-06/gqsp-tensor

Conversation

@mpharrigan

Copy link
Copy Markdown
Collaborator

By using full_flatten=False, we avoid contracting a tensor network with hundreds of tensors by short circuiting Controlled as well as SU2Rotation. Per #1336 #1763 -- flattening the tensor network took seconds

I also ran through --durations=10 on pytest-quick running serially and marked two tests as "slow"

@mpharrigan mpharrigan added the devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics label Jun 18, 2026

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

Copy link
Copy Markdown
Contributor

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 replaces Cirq-based unitary calculation with bloq_to_dense in the Hamiltonian simulation GQSP tests, removing Cirq imports and associated performance-related TODO comments. Additionally, it marks slow-running test cases with pytest.mark.slow in both prepare_uniform_superposition_test.py and _roudtrip_test.py. I have no feedback to provide.

@mpharrigan

Copy link
Copy Markdown
Collaborator Author

Marginal improvement on the CI, but on my workstation (with parallelization) it goes from 2:52 to to 1:22

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

Labels

devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant