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

Converter to and from tket #7

Open
y-richie-y opened this issue May 6, 2023 · 3 comments
Open

Converter to and from tket #7

y-richie-y opened this issue May 6, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@y-richie-y
Copy link
Collaborator

Implement a converter between pauliopt and pytket.

pytket is a popular open-sourced quantum compilation library. It can represent Pauli gadgets using PauliExpBox 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
@y-richie-y
Copy link
Collaborator Author

Bonus: write functions that convert to tket, apply some of the rewrite passes, and convert back to pauliopt.

@y-richie-y y-richie-y added the good first issue Good for newcomers label May 6, 2023
@Zshan0
Copy link

Zshan0 commented May 26, 2023

Do you want the functionality to convert the classes PhaseGadget, OptimizedPhaseCircuit and CXCircuit to pyket.Circuit and apply the passes described here?

@daehiff
Copy link
Collaborator

daehiff commented May 28, 2023

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:

https://github.com/sg495/pauliopt/blob/42057f8c971e536d51e70adf8bc9a25c5c7722dd/tests/test_pauli_propagation.py#L33

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

https://github.com/daehiff/divide_fast/blob/0d6600c8fc87b74da1c14d81c11e26f2636d7870/evaluations.py#L198

@y-richie-y y-richie-y assigned Zshan0 and unassigned Zshan0 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants