Repository navigation
tket_wrapper: fix pytket export of single-bit conditions; honour no_reduce - #74
Merged
Merged
Conversation
…uce on the pytket path With pytket installed (2.18.5), 12 tests in test_quantinuum_client.py failed: - circuit_to_qasm_str(qelib1) raises QASMUnsupportedError on single-bit conditions such as if(c[0]==1); retry with Quantinuum's hqslib1 header. - no_reduce / level 0 were ignored on the pytket path (the static path skips all reduction); now both paths behave the same. - Guard: pytket output is rejected (static fallback used) if it changes the number of measurements, resets or conditionals. Text-matching tests now check the lowering output; the compiled output is checked structurally (pytket legitimately rewrites x as u3). Two new tests. Full suite with pytket: 3085 passed, 26 skipped, 0 failed. Quantinuum tests with pytket blocked (as in CI): 26 passed, 1 skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the 12 tests in
tests/test_quantinuum_client.pythat fail onmainwhenever pytket is installed. CI doesn't install pytket, so it only ever exercised the static fallback and didn't catch them.Bugs fixed
circuit_to_qasm_strwith the qelib1 header raisesQASMUnsupportedErroron single-bit conditions (if(c[0]==1) x q[1];), which mid-circuit feed-forward needs. The wrapper now retries with Quantinuum'shqslib1header, which allows them.no_reduceignored.no_reduceandtket_opt_level=0were ignored on the pytket path, soFullPeepholeOptimisestill ran. The static path already skips all reduction in these cases; now both paths behave the same.Test changes: two tests compared exact gate text after compilation. pytket legitimately rewrites
xandhasu3, so those text checks now run on the lowering output, and the compiled output is checked by structure: everyif(syn==k)correction must still target the right qubit. Two new tests cover the pytket path andno_reduce.Verification
bootstrap --verify-only,py_compileandgit diff --checkall pass.🤖 Generated with Claude Code