-
Notifications
You must be signed in to change notification settings - Fork 116
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
Remove Tket dependencies for PennyLane model #195
Conversation
… and other backends. Type checks.
… and other backends. Type checks.
… up in future commit.
@neiljdo Another thing we'd like is to make tket an optional dependency, only related to TketModel. |
* main: Include doctests to workflow (CQCL#219)
@dimkart I've reduced the wall time for model creation (see below): There's still some discrepancy between the training times - I'm investigating that next. |
@neiljdo This looks good -- when you finish with the fixes let's attempt another comparison with the previous implementation (sympy symbols + tket in the middle) |
@dimkart here are the new benchmarking results with the updated pennylanemodel-w-native-symbol.pdf The |
@neiljdo Thanks for the report. The training speed of tket model looks a lot worse compared to previous run, is that normal? Also, how is the performance of the model? Do we get the expected results with the new implementation? |
@dimkart I've reran the full benchmark and now the As for the accuracy metrics, it's pretty much the same for all - it's just the wall times that changed. |
@neiljdo Good work, as long as we move tket to the optional dependencies I think this can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
Currently, to make a pennylane circuit, we construct a tket circuit, extract the ops, and then construct the pennylane circuit from that. This requires tket being a middle man for any circuit conversion. Instead, we can convert to a preliminary diagram compatible with all circuits before converting to the particular backend.
make_circuital function - Built. Needs more testing.
Pulls qubits to the top of the diagram.
Pulls measurements to the bottom of the diagram.
Orders qubits and measurements so they are easy to build a circuit.
Type checks each layer to ensure a valid diagram.
Type checking has been tested on all diagrams from the mc_dataset.
is_circuital - Needs built.
Checks if a diagram is a valid circuital diagram.
Verifies qubits, measurements, and gates are all placed correctly and type checks.
started to build in the draft PR.
from_circuit - Needs built.
Function to build a tket, pennylane, or other circuit using the preliminary circuit.
Refactor tket, pennylane, and torch_quantum to use the above functions for building their circuits.