Enabling LogicalQ LogicalCircuit-pytket Circuit compatibility#3
Draft
RasmitDevkota wants to merge 19 commits intomainfrom
Draft
Enabling LogicalQ LogicalCircuit-pytket Circuit compatibility#3RasmitDevkota wants to merge 19 commits intomainfrom
RasmitDevkota wants to merge 19 commits intomainfrom
Conversation
… fragment notebook
…etCircuit demo notebook
Member
Author
|
@benjaminhagan Could you take a look at my changes to Logical.py to verify that the restructuring is correct and not obviously problematic? |
…ation pass constructor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are multiple steps in the process towards running a
LogicalCircuiton Quantinuum hardware:LogicalCircuitsuch that the pytketqiskit_to_tkfunction knows how to handle each step of the processLogicalCircuittoCircuitCircuitdown to lower level representations (notably QIR) based on backendThroughout this process, multiple hiccups occur:
LogicalCircuituses complex conditional operations (viaIfElseOps) which pytket by itself supports in its library, but does not know how to convert from Qiskit to pytketqiskit_to_tkfunction does not allow binary conditionsThis pull request simultaneously resolves all known issues while satisfying the above known constraints via the following:
expr.liftwith simplertupleconditions and splitting especially-heavyif_tests into multiple pieces, thereby getting around the limit on the number of scratch bits withinLogicalCircuit.FlattenIfElseOpsTransformationPass, along with aDoWhileController-basedFlattenIfElseOpsTaskwhich terminates once there are no remainingIfElseOps._append_if_else_circuitQuantinuum/pytket-qiskit#514); I have implemented these locally and created a separate repository for storing them until the fixes are made upstream: https://github.com/RasmitDevkota/pytket. This is a temporary patch - users must modify their local installation of the pytket package until we can merge these changes upstream.I have provided test case for these changes in the demo notebooks FlattenIfElseOps.ipynb and LogicalCircuitToTketCircuit.ipynb. The notebooks run in their entirety (though costing is currently slow, making full debugging difficult).
Currently, I am marking this as a draft pull request because I have not verified that these changes are effective once run on hardware or even emulator. I think a good verification step, at least, would be to run the circuit through both:
AerSimulatorto verify that it replicates the results in LogicalCircuit_Demo.ipynb, andOnce the relevant metrics (e.g. SPAM fidelity, idle QEC fidelity, gate fidelities) are verified, this pull request can be merged.