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

FullPeepholeOptimise can increase the 2-qubit gate count for symbolic circuits #1150

Open
cqc-alec opened this issue Nov 29, 2023 · 1 comment
Labels
bug Something isn't working stale

Comments

@cqc-alec
Copy link
Collaborator

from sympy import Symbol
from pytket.circuit import Circuit, OpType
from pytket.passes import FullPeepholeOptimise

a, b, c = Symbol("a"), Symbol("b"), Symbol("c")
c = Circuit(2).TK2(a, b, c, 0, 1)
FullPeepholeOptimise(target_2qb_gate=OpType.TK2).apply(c)
print(c.n_gates_of_type(OpType.TK2))

Output:

3

The reason is that inside FullPeepholeOptimise is a clifford_simp transform, and inside that there is a step to decompose all multi-qubit gates to CX. The later squashing step cannot squash these back again because they contain symbolic gates in between.

@cqc-alec cqc-alec added the bug Something isn't working label Nov 29, 2023
Copy link

github-actions bot commented Jun 8, 2024

This issue has been automatically marked as stale.

@github-actions github-actions bot added the stale label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant