Skip to content

Conversation

@anurudhp
Copy link
Contributor

Fixes the nightly test fail (qualtran/bloqs/block_encoding/chebyshev_polynomial_test.py::test_scaled_chebyshev_even_tensors)

Added two cost tests to ensure that no C[And] etc are in the call graph.

@mpharrigan
Copy link
Collaborator

Thanks for doing this. When I investigated, I traced the ultimate problem to trying to do Controlled(LessThanEqual) as the proximate operation that tries to do C[And]. Would implementing LessThanEqual.controlled() fix the bug or is there something else wrong that requires the fix to be at the level of LinearCombination ?

(note that we do have CLinearDepthGreaterThan)

@mpharrigan mpharrigan self-requested a review March 13, 2025 23:05
@anurudhp
Copy link
Contributor Author

I think so, but LinearCombination uses StatePreparationAliasSampling (which uses LessThanEqual) in a compute-uncompute pair, so this override (i.e. only control the select) results in a lower cost.

@mpharrigan
Copy link
Collaborator

Very well, thank you!

@mpharrigan mpharrigan enabled auto-merge (squash) March 14, 2025 20:48
@mpharrigan mpharrigan merged commit b8776a5 into quantumlib:main Mar 14, 2025
8 checks passed
@anurudhp anurudhp deleted the 2025/03/13-fix-ctrl-chebyshev branch March 14, 2025 21:19
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.

2 participants