qiboteam / qibo

A full-stack framework for quantum computing.
https://qibo.science
Apache License 2.0
294 stars 60 forks source link

Transpiler wishlist #1085

Open stavros11 opened 1 year ago

stavros11 commented 1 year ago

Moved from qiboteam/qibolab#606 with some updates:

This list is sorted in terms of priorities with lab usability in mind.

To clarify the second point (originally requested by @MatteoRobbiati ), take for example

import networkx as nx
from qibo import Circuit, gates
from qibo.transpiler.pipeline import Passes

# define transpiler on usual 5-qubit star connectivity
topology = nx.Graph()
topology.add_nodes_from([0, 1, 2, 3, 4])
topology.add_edges_from([(0, 2), (1, 2), (2, 3), (2, 4)])
transpiler = Passes(connectivity=topology)

circuit = Circuit(1)
circuit.add(gates.H(0))

transpiled_circuit, qubit_map = transpiler(circuit)

currently transpiled_circuit will be a 5-qubit circuit with a gate on qubit-0. We would like an easy way to use a different qubit. A potential way would be transpiler(circuit, qubits=[2]).

@renatomello if you have any other transpiler related issues in mind, please add them here or open new issues. We can mark them with the transpiler label to distinguish from the rest of qibo.

### Tasks
- [ ] https://github.com/qiboteam/qibo/pull/1084
- [ ] https://github.com/qiboteam/qibo/pull/1095
Simone-Bordoni commented 1 year ago

Currently fixing the point 4 (Fix Sabre transpiler to work with measurements) in #1084

Simone-Bordoni commented 12 months ago

currently fixing point 1 in #1095

BrunoLiegiBastonLiegi commented 11 months ago

One thing that is still missing, I believe, is some documentation for the transpiler. It would probably be good to have an example in advanced code examples detailing how to use the transpiler, and a section in api-reference illustrating its structure.

Simone-Bordoni commented 11 months ago

One thing that is still missing, I believe, is some documentation for the transpiler. It would probably be good to have an example in advanced code examples detailing how to use the transpiler, and a section in api-reference illustrating its structure.

There is already an example in "advanced code examples". have a look at it and tell me if it is necessary to change something. With the new PR we can also add a section in API

BrunoLiegiBastonLiegi commented 11 months ago

There is already an example in "advanced code examples". have a look at it and tell me if it is necessary to change something. With the new PR we can also add a section in API

Where is it exactly? I couldn't find it in the advanced examples

MatteoRobbiati commented 11 months ago

Where is it exactly? I couldn't find it in the advanced examples

I also was searching for it yesterday. I think there is no example for now :)

stavros11 commented 11 months ago

Where is it exactly? I couldn't find it in the advanced examples

It's here https://github.com/qiboteam/qibo/blob/master/doc/source/code-examples/advancedexamples.rst#how-to-modify-the-transpiler. You probably cannot find it in the stable documentation online as we have not released qibo after moving the transpiler here. I guess the only way to view it for now is to compile the docs locally (or just read directly from the link above).

Also, I agree that transpiler should also be added in the API reference.

BrunoLiegiBastonLiegi commented 11 months ago

ah yeah that's right

MatteoRobbiati commented 11 months ago

It's here https://github.com/qiboteam/qibo/blob/master/doc/source/code-examples/advancedexamples.rst#how-to-modify-the-transpiler. You probably cannot find it in the stable documentation online as we have not released qibo after moving the transpiler here. I guess the only way to view it for now is to compile the docs locally (or just read directly from the link above).

Many thanks. Anyway, I think it should be better to have a notebook as a proper tutorial (like the ones we have for algorithms). As soon as I find some time to read this documentation, I can try to do it.