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

Enable "symbolic compilation" of QNodes #38

Open
erinaldiq opened this issue Dec 23, 2022 · 0 comments
Open

Enable "symbolic compilation" of QNodes #38

erinaldiq opened this issue Dec 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@erinaldiq
Copy link

Current behavior

In the current pytket.PytketDevice a compilation pass is applied every time the PennyLane circuit is run (in apply()). This results in a compilation pass every time the variational parameters (or trainable parameters) of a circuit are changed i.e. in a hybrid neural network that is being trained with PyTorch or TensorFlow.

New behavior

When a PennyLane QNode is passed to the pytket.PytketDevice, keep track of what parameters are trainable (for example the ones we request gradients for...) and replace them with fresh_symbol equivalents in the construction of the circuit (e.g. at this line as suggested by @kyasci Kentaro Yamamoto)
Then during the apply() function replace the value of the parameters after compilation.

Questions

  • Is this something that can be easily implemented?
  • Would it create problems on some backends?
  • Who needs this feature?
  • Does it make training faster on hardware backends?
@CalMacCQ CalMacCQ added the enhancement New feature or request label Dec 23, 2022
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