Open y-richie-y opened 1 year ago
Bonus: write functions that convert to tket, apply some of the rewrite passes, and convert back to pauliopt.
Do you want the functionality to convert the classes PhaseGadget
, OptimizedPhaseCircuit
and CXCircuit
to pyket.Circuit
and apply the passes described here?
I am really sorry, for the late reply. Take a look at the PauliPolynomial class: https://github.com/sg495/pauliopt/blob/42057f8c971e536d51e70adf8bc9a25c5c7722dd/pauliopt/pauli/pauli_polynomial.py#L7
Could you convert this class into a tket Circuit and apply the optimization passes afterwards?
In general the idea is to provide a reference routing strategy towards the ones we are developing at the moment. So please create a function whit the signature as follows:
def route_using_tket(pp: PauliPolynomial, topology: Topology) -> tket.Circuit:
...
A cool extra would be to return our own circuit with a certain gate set! But keep that optional for now.
Regarding your current PR, please note that unit tests should be in: the tests
folder and be written within the unittest
Framework (I have provided a command in the README and a docker container that can run them.
Also, please note, that we don't import qiskit/tket globally, our current dependencies can be sound in our setup.py
.
If you want to you can create an option pip install pauliopt[all]
, which will also install qiskit and tket for compatibility.
Also FYI:
Here is already a code-snippet, that converts our PauliPolynomial towards tket:
And in one of my older repositorys, there is a way how you can create tket architectures from edges (note that i didn't use the Topology
-object here so it is not STRG+C/V :D
Implement a converter between
pauliopt
andpytket
.pytket
is a popular open-sourced quantum compilation library. It can represent Pauli gadgets usingPauliExpBox
has special compilation passes for these boxes:PauliSimp
PauliSquash
GuidedPauliSimp
There is also phase gadget compilation pass, though there doesn't seem to be an explicit class for representing them:
OptimisePhaseGadgets