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

Let FunctionBuilder add new inputs dynamically. #1562

Closed
aborgna-q opened this issue Oct 9, 2024 · 0 comments · Fixed by #1570
Closed

Let FunctionBuilder add new inputs dynamically. #1562

aborgna-q opened this issue Oct 9, 2024 · 0 comments · Fixed by #1570
Assignees

Comments

@aborgna-q
Copy link
Collaborator

Needed for CQCL/tket2#628, where we may need to define new parameter inputs while the circuit is being built.

@aborgna-q aborgna-q self-assigned this Oct 9, 2024
github-merge-queue bot pushed a commit to CQCL/tket2 that referenced this issue Oct 10, 2024
This is an alternative to #635, using pure-rust instead of calling to
python so we can keep the pytket decoder on the `tket2` crate.

Improves parsing of pytket operation parameters by defining a grammar
and parser for sympy expressions using `pest` (based on the [calculator
example](https://pest.rs/book/examples/calculator.html) for infix
operation precedence).

- Unrecognized operations are still put inside an opaque `SympyOp`, but
that should be easy to change in the future.
- I tested multiple sympy expressions to ensure we are able to parse
them, but unrecognized ones will also fallback to `SympyOp`.

This is still missing routing parameters to hugr inputs (#628), as it is
blocked by CQCL/hugr#1562.

drive-by: Move the pytket parameter encoding/decoding routines to
`::serialize::pytket::param::{de,en}code`.

Closes #637.
github-merge-queue bot pushed a commit that referenced this issue Oct 14, 2024
Closes #1562.

It's a chunk of code fiddling with the hugr internals, but it is
something specific to function definitions so I think it should be ok to
have it under `FunctionBuilder`.
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 a pull request may close this issue.

1 participant