Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better TK2 Squashing #1738

Open
sjdilkes opened this issue Jan 15, 2025 · 0 comments
Open

Better TK2 Squashing #1738

sjdilkes opened this issue Jan 15, 2025 · 0 comments

Comments

@sjdilkes
Copy link
Contributor

Related to #971.

SynthesiseTK doesn't recognise XXPhase(a,0,1).YYPhase(b,0,1).ZZPhase(c,0,1) == TK2(a,b,c,0,1) and running FullPeepholeOptimise on YYPhase(b,0,1) returns a TK2(b,0,0,0,1) with a bunch of TK1 single qubit gate wrappers, rather than TK2(0,b,0,0,1).

This isn't too disastrous in most circumstances, as if the circuits are submitted with ZZPhase then this would happen anyway. However, if native TK2 gates are being used then these amount to extraneous single qubit gates. Additionally, the original reason I had this come up was for compiling circuits to the Iceberg code. In that case, encoded TK1 are as expensive (~) as encoded TK2, so pre-compiling with FullPeepholeOptimise and then encoding led to large, extraneous gate overhead.

My guess is that if the code here can recognise these improvements then everything else should work: https://github.com/CQCL/tket/blob/a443386f8c3703e6a1afb997d9f44460e59fc3d6/tket/src/Transformations/BasicOptimisation.cpp#L143C3-L152C4

Hopefully that doesn't have to come to improving two_qubit_canonical.

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

No branches or pull requests

1 participant