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

Full symbolics to input conversion #168

Open
lmondada opened this issue Oct 4, 2023 · 0 comments
Open

Full symbolics to input conversion #168

lmondada opened this issue Oct 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@lmondada
Copy link
Contributor

lmondada commented Oct 4, 2023

In tket1, float variables are expressed through symbolics. In tket2, we'd interpret these as inputs to the computation, so ideally we would convert between symbolic abstract trees and tket2 native operations.

Current status: pure constants from tket1 are parsed and loaded as constants. Anything else is loaded as an opaque symbolic string. These operations can also be recovered when going in the other direction. Additionally, expressions added together using T2Op::AngleAdd are converted into strings with + symbols, so that in such cases tket2->tket1 conversions yield the expected results. See #166.

However, this means that the following tket2 circuit cannot be faithfully recovered after tket2->tket1 conversion:

graph TD
IN --> Rz
IN --> AngleAdd
IN --> AngleAdd --> Rz --> OUT
Loading

will be turned into

graph TD
IN --> Rz
C(const f0 + f1) --> Rz
Rz --> OUT
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants