-
Notifications
You must be signed in to change notification settings - Fork 26
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
📝 Documentation for Search Space Limitation Feature #280
Conversation
Codecov Report
@@ Coverage Diff @@
## main #280 +/- ##
=====================================
Coverage 92.0% 92.0%
=====================================
Files 45 45
Lines 3888 3888
Branches 650 650
=====================================
Hits 3580 3580
Misses 308 308
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for the addition. Seems like the script doesn't run without errors though. Please request a review once the script is fixed. |
…n' into LimitingSearchSpace_Documentation # Conflicts: # docs/source/LimitingSearchSpace.ipynb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the first draft. Unfortunately, this PR feels really unfinished.
At the moment this is not even included in the documentation.
Please see the comments below for a couple of remarks.
"Many quantum computing architectures limit the pairs of qubits that two-qubit operations can be applied to.\n", | ||
"This is commonly described by a device's *coupling map*.\n", | ||
"To further speed up the mapping process, there are several ways to limit the pairs of qubits that need to be considered, in ways of limiting the whole search space for the exact mapping problem.\n", | ||
"\n", | ||
"Consider the following circuit." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from qiskit import QuantumCircuit\n", | ||
"\n", | ||
"qc = QuantumCircuit(4)\n", | ||
"qc.h(0)\n", | ||
"qc.cx(0, 1)\n", | ||
"qc.cx(0, 2)\n", | ||
"qc.cx(0, 3)\n", | ||
"\n", | ||
"qc.barrier()\n", | ||
"\n", | ||
"qc.t(0)\n", | ||
"qc.t(1)\n", | ||
"qc.t(2)\n", | ||
"qc.t(3)\n", | ||
"\n", | ||
"qc.barrier()\n", | ||
"\n", | ||
"qc.cx(0, 3)\n", | ||
"qc.cx(0, 2)\n", | ||
"qc.cx(0, 1)\n", | ||
"\n", | ||
"qc.measure_all()\n", | ||
"\n", | ||
"qc.draw(output=\"mpl\")" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Now assume this circuit shall be mapped to a $4$-qubit architecture defined by the following coupling map:\n", | ||
"\n", | ||
"![Linear 4-qubit Architecture](images/linear_arch.svg)\n", | ||
"\n", | ||
"In *QMAP* this architecture can be manually defined as described in the Mapping section.\n", | ||
"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is, more or less, duplicate code from the Mapping notebook.
This page should provide some context on the search space limitation, what the implications are, etc.
It should at least cover both methods from the paper and contrast them against the non-limited version. Should be fairly easy to show the runtime difference on some small examples.
Most importantly, I would have imagined an example circuit and/or architecture, where a real difference can be seen for the different approaches.
Furthermore, it would make sense to reference the paper near the top of this page to set the scene for what's to come.
"\n", | ||
"Instead we look now at the cayley graph, especially the reduced cayley graph that can be generated from the series of swaps possible on an architecture.\n", | ||
"\n", | ||
"![Reduced Cayley graph](images/cayley.png)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image has not been added to the repository. Furthermore, please use vector graphics wherever possible.
The original file is a PDF anyway. So that should be straight-forward.
This tutorial-like page should also contain the original un-limited Cayley graph. I believe you could just replicate the example from the paper (with some minor modifications).
" },\n", | ||
")\n", | ||
"qc_mapped, res = qmap.compile(\n", | ||
" qc, arch, method=\"exact\", post_mapping_optimizations=False, swap_reduction=\"coupling_limit\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be mentioned somewhere, that this is actually the default setting being used (since it is guaranteed to preserve optimality).
"source": [ | ||
"This limits the number of SWAPs based on the selected subgraph of the architecture.\n", | ||
"\n", | ||
"Check out the [reference documentation](library/Mapping.rst) for more information." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected that link to point to the SwapReduction settings reference documentation and not the general mapper page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new file is linked nowhere in the documentation. As such, it is not accessible in the documentation.
Description
Adding a simple Notebook to show how swap-limiting can be enabled
Fixes #116
Checklist: