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

[QHC-700] Add qibo routing #821

Merged
merged 92 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
635bdc7
major refactor to simplify things
fedonman Oct 15, 2024
c1dea67
Merge branch 'main' into qhc-777-add-channel_ids-for-all-instruments-…
fedonman Oct 15, 2024
503f82a
various fixes
fedonman Oct 15, 2024
6b461fc
Merge branch 'qhc-777-add-channel_ids-for-all-instruments-connected-t…
fedonman Oct 15, 2024
c83fd11
various changes
fedonman Oct 16, 2024
c438d10
merge from main
fedonman Oct 17, 2024
248c1bb
update tests
fedonman Oct 17, 2024
eb0364d
update tests
fedonman Oct 17, 2024
2b3a270
fix circuit_transpiler tests
fedonman Oct 18, 2024
e2a500d
add decorators to instrument methods
fedonman Oct 18, 2024
36e348f
delete obsolete Pulsar
fedonman Oct 18, 2024
42a7171
refactor qblox_module tests
fedonman Oct 18, 2024
f49e84f
Add qibo routing
GuillermoAbadLopez Oct 18, 2024
4d02e53
Solving bugs in tranpiler
GuillermoAbadLopez Oct 21, 2024
070721b
Update circuit_transpiler.py
GuillermoAbadLopez Oct 21, 2024
39c9abb
Adding in cascade up, the placer and router freedom and the final_layout
GuillermoAbadLopez Oct 21, 2024
1dc6a3a
Update circuit_transpiler.py
GuillermoAbadLopez Oct 21, 2024
805621e
Typo
GuillermoAbadLopez Oct 21, 2024
ac4540a
test_typo and general improvements
GuillermoAbadLopez Oct 21, 2024
5b9b553
Adding trivial topology for PulseSchedule in `compile()`
GuillermoAbadLopez Oct 21, 2024
dc93998
Solving tests
GuillermoAbadLopez Oct 21, 2024
5e38eaf
Solve mapping of qubits in tests
GuillermoAbadLopez Oct 21, 2024
ffca2a5
fix instruments tests
fedonman Oct 21, 2024
3b46192
fix tests
fedonman Oct 21, 2024
4dbc788
fix tests
fedonman Oct 22, 2024
abad77f
fix tests
fedonman Oct 22, 2024
f663725
fix documentation
fedonman Oct 22, 2024
8679655
fix runcard for calibration tests
fedonman Oct 22, 2024
6e7b5a3
delete obsolete files, fix mypy
fedonman Oct 22, 2024
ce23239
improve codecov
fedonman Oct 22, 2024
1fe3a14
improve codecov
fedonman Oct 22, 2024
14ee3fb
Creating class CircuitRouter
GuillermoAbadLopez Oct 23, 2024
7a0f9f7
add changelog entry
fedonman Oct 23, 2024
d99f918
add changelog entry
fedonman Oct 23, 2024
b284878
Update transpiler.rst
GuillermoAbadLopez Oct 23, 2024
cfadbfd
re-enable mypy in precommit
fedonman Oct 23, 2024
36ee35a
rename circuit_transpiler module to digital
fedonman Oct 23, 2024
f3faf21
Merge Vyron Chip removal
GuillermoAbadLopez Oct 23, 2024
e95dc3c
Update circuit_transpiler.py
GuillermoAbadLopez Oct 23, 2024
e6f08c4
delete drivers module
fedonman Oct 23, 2024
50dadf1
add topology to digital_compilation_settings
fedonman Oct 23, 2024
fe19ad8
update changelog
fedonman Oct 23, 2024
c220180
fix documentation
fedonman Oct 23, 2024
a89b1f0
Merge
GuillermoAbadLopez Oct 23, 2024
54e7cfd
Update data.py
GuillermoAbadLopez Oct 23, 2024
664ecd3
fix is_awg/is_adc docstrings
fedonman Oct 23, 2024
9da2783
Supress errors. for specific one
GuillermoAbadLopez Oct 23, 2024
fd14136
Improve error handling
GuillermoAbadLopez Oct 23, 2024
e5cac00
Improve error handling
GuillermoAbadLopez Oct 23, 2024
2a767c0
Improving erro handling
GuillermoAbadLopez Oct 23, 2024
b5543c6
Adding routing_iterations, to get best stochastic routing
GuillermoAbadLopez Oct 23, 2024
c4e1dea
Improving the best routing finding
GuillermoAbadLopez Oct 23, 2024
41b6026
Make routing iteration, more readable
GuillermoAbadLopez Oct 23, 2024
4ac0802
improve qblox_compiler tests
fedonman Oct 24, 2024
30b39f3
improve tests
fedonman Oct 24, 2024
6993af3
improve tests
fedonman Oct 24, 2024
b40b6ea
improve QCM/QRM RF modules and relevant tests
fedonman Oct 24, 2024
d92fb67
improve qblox tests
fedonman Oct 24, 2024
f9bfd0d
improve qblox tests
fedonman Oct 24, 2024
ecfb3c1
improve tests
fedonman Oct 24, 2024
11d249d
improve tests
fedonman Oct 24, 2024
49f4436
improve tests
fedonman Oct 24, 2024
40342e5
improve tests
fedonman Oct 24, 2024
47d421d
improve tests
fedonman Oct 24, 2024
0ce50e1
improve tests
fedonman Oct 25, 2024
76f59d2
add ignore to codecov
fedonman Oct 25, 2024
b137afd
improve tests
fedonman Oct 25, 2024
44ee399
Make `_iterate_routing` method private
GuillermoAbadLopez Oct 28, 2024
b4aa644
Merge branch 'qhc-777-add-channel_ids-for-all-instruments-connected-t…
GuillermoAbadLopez Oct 28, 2024
28064a8
Solving code quality
GuillermoAbadLopez Oct 28, 2024
d9e7b7a
Remove duplicated method
GuillermoAbadLopez Oct 28, 2024
d50e676
Add initialization test
GuillermoAbadLopez Oct 28, 2024
96c62b3
Add basic routing test
GuillermoAbadLopez Oct 28, 2024
80dd02d
Adding unit tests
GuillermoAbadLopez Oct 28, 2024
4263571
Improve unit testing
GuillermoAbadLopez Oct 28, 2024
8ccd3cb
Expand unit tests
GuillermoAbadLopez Oct 29, 2024
dd4e8d3
Update test_platform.py
GuillermoAbadLopez Oct 29, 2024
9c0354a
Update platform.py
GuillermoAbadLopez Oct 29, 2024
670084a
Adding more test, and improve type checking
GuillermoAbadLopez Oct 29, 2024
46ab052
Improving tests
GuillermoAbadLopez Oct 29, 2024
265a433
Addint `transpile_circuits` test
GuillermoAbadLopez Oct 29, 2024
a383de6
Adding route_circuit test
GuillermoAbadLopez Oct 29, 2024
150bf42
Improving coverage to 100
GuillermoAbadLopez Oct 29, 2024
3b24989
Merge remote-tracking branch 'origin/main' into qibo_routing
GuillermoAbadLopez Oct 30, 2024
73eeced
Improve tests
GuillermoAbadLopez Oct 31, 2024
0ce9a57
Adding release and Improving docstrings
GuillermoAbadLopez Oct 31, 2024
2cc2dd3
Update changelog-dev.md
GuillermoAbadLopez Oct 31, 2024
fda12cc
Merge branch 'main' into qibo_routing
GuillermoAbadLopez Nov 6, 2024
c732761
Merge branch 'main' into qibo_routing
GuillermoAbadLopez Nov 6, 2024
9589df9
Merge branch 'main' into qibo_routing
GuillermoAbadLopez Nov 7, 2024
ab1862a
Indent changelog
GuillermoAbadLopez Nov 7, 2024
0f0eaa9
[QHC-700] Expand transpiler (#823)
GuillermoAbadLopez Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/code/transpiler.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ql.transpiler
===============
ql.circuit_transpiler
=========================

.. automodule:: qililab.digital
51 changes: 51 additions & 0 deletions docs/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,57 @@

[#816](https://github.com/qilimanjaro-tech/qililab/pull/816)

- Added routing algorithms to `qililab` in function of the platform connectivity. This is done passing `Qibo` own `Routers` and `Placers` classes,
and can be called from different points of the stack.

The most common way to route, will be automatically through `qililab.execute_circuit.execute()`, or also from `qililab.platform.execute/compile()`. Another way, would be doing the transpilation/routing directly from an instance of the Transpiler, with: `qililab.digital.circuit_transpiler.transpile/route_circuit()` (with this last one, you can route with a different topology from the platform one, if desired, defaults to platform)

Example:

```python
from qibo import gates
from qibo.models import Circuit
from qibo.transpiler.placer import ReverseTraversal, Trivial
from qibo.transpiler.router import Sabre
from qililab import build_platform
from qililab.circuit_transpiler import CircuitTranspiler

# Create circuit:
c = Circuit(5)
c.add(gates.CNOT(1, 0))

### From execute_circuit:
# With defaults (ReverseTraversal placer and Sabre routing):
probabilities = ql.execute(c, runcard="./runcards/galadriel.yml", placer= Trivial, router = Sabre, routing_iterations: int = 10,)
# Changing the placer to Trivial, and changing the number of iterations:
probabilities = ql.execute(c, runcard="./runcards/galadriel.yml",

### From the platform:
# Create platform:
platform = build_platform(runcard="<path_to_runcard>")
# With defaults (ReverseTraversal placer, Sabre routing)
probabilities = platform.execute(c, num_avg: 1000, repetition_duration: 1000)
# With non-defaults, and specifying the router with kwargs:
probabilities = platform.execute(c, num_avg: 1000, repetition_duration: 1000, placer= Trivial, router = (Sabre, {"lookahead": 2}), routing_iterations: int = 20))
# With a router instance:
router = Sabre(connectivity=None, lookahead=1) # No connectivity needed, since it will be overwritten by the platform's one
probabilities = platform.execute(c, num_avg: 1000, repetition_duration: 1000, placer=Trivial, router=router)

### Using the transpiler directly:
### (If using the routing from this points of the stack, you can route with a different topology from the platform one)
# Create transpiler:
transpiler = CircuitTranspiler(platform)
# Default Transpilation (ReverseTraversal, Sabre and Platform connectivity):
routed_circ, final_layouts = transpiler.route_circuit([c])
# With Non-Default Trivial placer, specifying the kwargs, for the router, and different coupling_map:
routed_circ, final_layouts = transpiler.route_circuit([c], placer=Trivial, router=(Sabre, {"lookahead": 2}, coupling_map=<some_different_topology>))
# Or finally, Routing with a concrete Routing instance:
router = Sabre(connectivity=None, lookahead=1) # No connectivity needed, since it will be overwritten by the specified in the Transpiler:
routed_circ, final_layouts = transpiler.route_circuit([c], placer=Trivial, router=router, coupling_map=<connectivity_to_use>)
```

[#821](https://github.com/qilimanjaro-tech/qililab/pull/821)
GuillermoAbadLopez marked this conversation as resolved.
Show resolved Hide resolved

- Added a timeout inside quantum machines to control the `wait_for_all_values` function. The timeout is controlled through the runcard as shown in the example:

```
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pandas==1.5.3
qibo==0.2.8
qibo==0.2.12
qblox-instruments==0.11.2
qcodes==0.42.0
qcodes_contrib_drivers==0.18.0
Expand Down
11 changes: 3 additions & 8 deletions src/qililab/digital/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,16 @@
"""
This module contains all the decomposition and transpilation methods used within qililab.
.. currentmodule:: qililab
Transpilation
~~~~~~~~~~~~~
.. autosummary::
:toctree: api
Gate Decomposition
~~~~~~~~~~~~~~~~~~
.. currentmodule:: qililab.digital
.. autosummary::
:toctree: api
~CircuitTranspiler
"""

from .circuit_transpiler import CircuitTranspiler
Expand Down
Loading
Loading