From 774d5a7aee23ca991e28149eea4653b28f870853 Mon Sep 17 00:00:00 2001 From: Wang-Shengtao Date: Sat, 29 Oct 2022 17:35:12 -0400 Subject: [PATCH 1/4] update license --- LICENSE | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 179 insertions(+), 20 deletions(-) diff --git a/LICENSE b/LICENSE index a3cf8c4..8f3c377 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,180 @@ -MIT License +The UnitDiskMapping.jl package is licensed under the Apache License, Version 2.0: -Copyright (c) 2021 QuEra Computing Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +> Copyright (c) 2022 QuEra Computing Inc.. +> +> Apache License +> Version 2.0, January 2004 +> http://www.apache.org/licenses/ +> +> TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +> +> 1. Definitions. +> +> "License" shall mean the terms and conditions for use, reproduction, +> and distribution as defined by Sections 1 through 9 of this document. +> +> "Licensor" shall mean the copyright owner or entity authorized by +> the copyright owner that is granting the License. +> +> "Legal Entity" shall mean the union of the acting entity and all +> other entities that control, are controlled by, or are under common +> control with that entity. For the purposes of this definition, +> "control" means (i) the power, direct or indirect, to cause the +> direction or management of such entity, whether by contract or +> otherwise, or (ii) ownership of fifty percent (50%) or more of the +> outstanding shares, or (iii) beneficial ownership of such entity. +> +> "You" (or "Your") shall mean an individual or Legal Entity +> exercising permissions granted by this License. +> +> "Source" form shall mean the preferred form for making modifications, +> including but not limited to software source code, documentation +> source, and configuration files. +> +> "Object" form shall mean any form resulting from mechanical +> transformation or translation of a Source form, including but +> not limited to compiled object code, generated documentation, +> and conversions to other media types. +> +> "Work" shall mean the work of authorship, whether in Source or +> Object form, made available under the License, as indicated by a +> copyright notice that is included in or attached to the work +> (an example is provided in the Appendix below). +> +> "Derivative Works" shall mean any work, whether in Source or Object +> form, that is based on (or derived from) the Work and for which the +> editorial revisions, annotations, elaborations, or other modifications +> represent, as a whole, an original work of authorship. For the purposes +> of this License, Derivative Works shall not include works that remain +> separable from, or merely link (or bind by name) to the interfaces of, +> the Work and Derivative Works thereof. +> +> "Contribution" shall mean any work of authorship, including +> the original version of the Work and any modifications or additions +> to that Work or Derivative Works thereof, that is intentionally +> submitted to Licensor for inclusion in the Work by the copyright owner +> or by an individual or Legal Entity authorized to submit on behalf of +> the copyright owner. For the purposes of this definition, "submitted" +> means any form of electronic, verbal, or written communication sent +> to the Licensor or its representatives, including but not limited to +> communication on electronic mailing lists, source code control systems, +> and issue tracking systems that are managed by, or on behalf of, the +> Licensor for the purpose of discussing and improving the Work, but +> excluding communication that is conspicuously marked or otherwise +> designated in writing by the copyright owner as "Not a Contribution." +> +> "Contributor" shall mean Licensor and any individual or Legal Entity +> on behalf of whom a Contribution has been received by Licensor and +> subsequently incorporated within the Work. +> +> 2. Grant of Copyright License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> copyright license to reproduce, prepare Derivative Works of, +> publicly display, publicly perform, sublicense, and distribute the +> Work and such Derivative Works in Source or Object form. +> +> 3. Grant of Patent License. Subject to the terms and conditions of +> this License, each Contributor hereby grants to You a perpetual, +> worldwide, non-exclusive, no-charge, royalty-free, irrevocable +> (except as stated in this section) patent license to make, have made, +> use, offer to sell, sell, import, and otherwise transfer the Work, +> where such license applies only to those patent claims licensable +> by such Contributor that are necessarily infringed by their +> Contribution(s) alone or by combination of their Contribution(s) +> with the Work to which such Contribution(s) was submitted. If You +> institute patent litigation against any entity (including a +> cross-claim or counterclaim in a lawsuit) alleging that the Work +> or a Contribution incorporated within the Work constitutes direct +> or contributory patent infringement, then any patent licenses +> granted to You under this License for that Work shall terminate +> as of the date such litigation is filed. +> +> 4. Redistribution. You may reproduce and distribute copies of the +> Work or Derivative Works thereof in any medium, with or without +> modifications, and in Source or Object form, provided that You +> meet the following conditions: +> +> (a) You must give any other recipients of the Work or +> Derivative Works a copy of this License; and +> +> (b) You must cause any modified files to carry prominent notices +> stating that You changed the files; and +> +> (c) You must retain, in the Source form of any Derivative Works +> that You distribute, all copyright, patent, trademark, and +> attribution notices from the Source form of the Work, +> excluding those notices that do not pertain to any part of +> the Derivative Works; and +> +> (d) If the Work includes a "NOTICE" text file as part of its +> distribution, then any Derivative Works that You distribute must +> include a readable copy of the attribution notices contained +> within such NOTICE file, excluding those notices that do not +> pertain to any part of the Derivative Works, in at least one +> of the following places: within a NOTICE text file distributed +> as part of the Derivative Works; within the Source form or +> documentation, if provided along with the Derivative Works; or, +> within a display generated by the Derivative Works, if and +> wherever such third-party notices normally appear. The contents +> of the NOTICE file are for informational purposes only and +> do not modify the License. You may add Your own attribution +> notices within Derivative Works that You distribute, alongside +> or as an addendum to the NOTICE text from the Work, provided +> that such additional attribution notices cannot be construed +> as modifying the License. +> +> You may add Your own copyright statement to Your modifications and +> may provide additional or different license terms and conditions +> for use, reproduction, or distribution of Your modifications, or +> for any such Derivative Works as a whole, provided Your use, +> reproduction, and distribution of the Work otherwise complies with +> the conditions stated in this License. +> +> 5. Submission of Contributions. Unless You explicitly state otherwise, +> any Contribution intentionally submitted for inclusion in the Work +> by You to the Licensor shall be under the terms and conditions of +> this License, without any additional terms or conditions. +> Notwithstanding the above, nothing herein shall supersede or modify +> the terms of any separate license agreement you may have executed +> with Licensor regarding such Contributions. +> +> 6. Trademarks. This License does not grant permission to use the trade +> names, trademarks, service marks, or product names of the Licensor, +> except as required for reasonable and customary use in describing the +> origin of the Work and reproducing the content of the NOTICE file. +> +> 7. Disclaimer of Warranty. Unless required by applicable law or +> agreed to in writing, Licensor provides the Work (and each +> Contributor provides its Contributions) on an "AS IS" BASIS, +> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +> implied, including, without limitation, any warranties or conditions +> of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any +> risks associated with Your exercise of permissions under this License. +> +> 8. Limitation of Liability. In no event and under no legal theory, +> whether in tort (including negligence), contract, or otherwise, +> unless required by applicable law (such as deliberate and grossly +> negligent acts) or agreed to in writing, shall any Contributor be +> liable to You for damages, including any direct, indirect, special, +> incidental, or consequential damages of any character arising as a +> result of this License or out of the use or inability to use the +> Work (including but not limited to damages for loss of goodwill, +> work stoppage, computer failure or malfunction, or any and all +> other commercial damages or losses), even if such Contributor +> has been advised of the possibility of such damages. +> +> 9. Accepting Warranty or Additional Liability. While redistributing +> the Work or Derivative Works thereof, You may choose to offer, +> and charge a fee for, acceptance of support, warranty, indemnity, +> or other liability obligations and/or rights consistent with this +> License. However, in accepting such obligations, You may act only +> on Your own behalf and on Your sole responsibility, not on behalf +> of any other Contributor, and only if You agree to indemnify, +> defend, and hold each Contributor harmless for any liability +> incurred by, or claims asserted against, such Contributor by reason +> of your accepting any such warranty or additional liability. +> +> END OF TERMS AND CONDITIONS \ No newline at end of file From 93c822ab840683fe33a76a129ddfef06789884e0 Mon Sep 17 00:00:00 2001 From: Wang-Shengtao Date: Sat, 29 Oct 2022 17:36:31 -0400 Subject: [PATCH 2/4] update citation --- CITATION.bib | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/CITATION.bib b/CITATION.bib index bebebaa..6d90fd4 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -1,10 +1,15 @@ -@misc{https://doi.org/10.48550/arxiv.2209.03965, - doi = {10.48550/ARXIV.2209.03965}, - url = {https://arxiv.org/abs/2209.03965}, - author = {Nguyen, Minh-Thi and Liu, Jin-Guo and Wurtz, Jonathan and Lukin, Mikhail D. and Wang, Sheng-Tao and Pichler, Hannes}, - keywords = {Quantum Physics (quant-ph), Disordered Systems and Neural Networks (cond-mat.dis-nn), Quantum Gases (cond-mat.quant-gas), Computational Complexity (cs.CC), Atomic Physics (physics.atom-ph), FOS: Physical sciences, FOS: Physical sciences, FOS: Computer and information sciences, FOS: Computer and information sciences}, - title = {Quantum optimization with arbitrary connectivity using Rydberg atom arrays}, - publisher = {arXiv}, - year = {2022}, - copyright = {arXiv.org perpetual, non-exclusive license} -} +@ARTICLE{Nguyen2022Quantum, + author = {{Nguyen}, Minh-Thi and {Liu}, Jin-Guo and {Wurtz}, Jonathan and {Lukin}, Mikhail D. and {Wang}, Sheng-Tao and {Pichler}, Hannes}, + title = "{Quantum optimization with arbitrary connectivity using Rydberg atom arrays}", + journal = {arXiv e-prints}, + keywords = {Quantum Physics, Condensed Matter - Disordered Systems and Neural Networks, Condensed Matter - Quantum Gases, Computer Science - Computational Complexity, Physics - Atomic Physics}, + year = 2022, + month = sep, + eid = {arXiv:2209.03965}, + pages = {arXiv:2209.03965}, +archivePrefix = {arXiv}, + eprint = {2209.03965}, + primaryClass = {quant-ph}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2022arXiv220903965N}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} \ No newline at end of file From 1deade6ea744e5c1296e048be276214fabdc3542 Mon Sep 17 00:00:00 2001 From: Wang-Shengtao Date: Sat, 29 Oct 2022 17:54:51 -0400 Subject: [PATCH 3/4] edit readme --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2edd46d..9d65066 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # UnitDiskMapping -[![CI](https://github.com/Happy-Diode/UnitDiskMapping.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/Happy-Diode/UnitDiskMapping.jl/actions/workflows/ci.yml) -[![Coverage Status](https://coveralls.io/repos/github/Happy-Diode/UnitDiskMapping.jl/badge.svg?branch=main&t=H2ReMe)](https://coveralls.io/github/Happy-Diode/UnitDiskMapping.jl?branch=main) - +[![CI](https://github.com/QuEraComputing/UnitDiskMapping.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/QuEraComputing/UnitDiskMapping.jl/actions/workflows/ci.yml) +[![Coverage Status](https://coveralls.io/repos/github/QuEraComputing/UnitDiskMapping.jl/badge.svg?branch=main&t=H2ReMe)](https://coveralls.io/github/QuEraComputing/UnitDiskMapping.jl?branch=main) +https://github.com/QuEraComputing/UnitDiskMapping.jl ## Installation

UnitDiskMapping is a   @@ -10,18 +10,18 @@ Julia Language -   package for reducing a generic (weighted) maximum independent set problem, QUBO problem or integer factoring problem to a maximum independent set problem on a unit disk grid graph (or hardcore lattice gas in physics). To install UnitDiskMapping, +   package for reducing a generic maximum (weighted) independent set problem, Quadratic unconstrained binary optimization (QUBO) problem or integer factorization problem to a maximum independent set problem on a unit disk grid graph (or hardcore lattice gas in physics). To install UnitDiskMapping, please open - Julia's interactive session (known as REPL) and press ] key in the REPL to use the package mode, then type the following command + Julia's interactive session (known as REPL) and press the ] key in the REPL to use the package mode, and then type the following command:

-For installing the current master branch, please type +For installing the current master branch, please type: ```julia pkg> add https://github.com/QuEraComputing/UnitDiskMapping.jl.git ``` -For stable release (not yet ready) +For stable release (not yet ready): ```julia pkg> add UnitDiskMapping @@ -29,7 +29,7 @@ pkg> add UnitDiskMapping ## Examples -Please check this [notebook](https://refactored-spork-2b31d0c0.pages.github.io/notebooks/tutorial.html), which contains the following examples +Please check this [notebook](https://github.com/QuEraComputing/UnitDiskMapping.jl/blob/main/notebooks/tutorial.jl), which contains the following examples: * Generic Unweighted Mapping * Generic Weighted Mapping @@ -38,20 +38,20 @@ Please check this [notebook](https://refactored-spork-2b31d0c0.pages.github.io/n * QUBO problem on a square lattice * Factoring -To run the notebook locally you will need the [Pluto](https://github.com/fonsp/Pluto.jl) and [GenericTensorNetworks](https://github.com/QuEraComputing/GenericTensorNetworks.jl) Julia packages installed. You can run the following after entering Package mode: +To run the notebook locally, you will need the [Pluto](https://github.com/fonsp/Pluto.jl) and [GenericTensorNetworks](https://github.com/QuEraComputing/GenericTensorNetworks.jl) Julia packages installed. You can run the following after entering the Package mode: ``` pkg> add Pluto pkg> add GenericTensorNetworks ``` -and returning to the Julia REPL (you can do this by hitting Backspace in Package mode) run: +and returning to the Julia REPL (you can do this by hitting Backspace in the Package mode) to run: ``` julia> import Pluto; Pluto.run() ``` -in the `notebooks` directory of this project. At this point your browser should automatically launch and display a list of available notebooks you can run. You should just see `tutorial.jl` listed. +in the `notebooks` directory of this project. At this point, your browser should automatically launch and display a list of available notebooks you can run. You should just see `tutorial.jl` listed. ## Supporting and Citing -Much of the software in this ecosystem was developed as part of academic research. If you would like to help support it, please star the repository as such metrics may help us secure funding in the future. If you use our software as part of your research, teaching, or other activities, we would be grateful if you could cite our work. The [CITATION.bib](CITATION.bib) file in the root of this repository lists the relevant papers. +Much of the software in this ecosystem was developed as a part of an academic research project. If you would like to help support it, please star the repository. If you use our software as part of your research, teaching, or other activities, we would like to ask you to cite our work. The [CITATION.bib](CITATION.bib) file in the root of this repository lists the relevant papers. From 6b4551fabd49e632eee871b79f924f121acf3aa4 Mon Sep 17 00:00:00 2001 From: Wang-Shengtao Date: Sat, 29 Oct 2022 18:10:45 -0400 Subject: [PATCH 4/4] edit tutorial --- notebooks/tutorial.jl | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/notebooks/tutorial.jl b/notebooks/tutorial.jl index cf0fe48..f364b9b 100644 --- a/notebooks/tutorial.jl +++ b/notebooks/tutorial.jl @@ -45,7 +45,7 @@ using UnitDiskMapping, Graphs, GenericTensorNetworks, LinearAlgebra # ╔═╡ 98459516-4833-4e4a-916f-d5ea3e657ceb # Visualization setup. -# To make the plots dark mode friendly, we use white background color. +# To make the plots dark-mode friendly, we use white-background color. using UnitDiskMapping.LuxorGraphPlot.Luxor, LuxorGraphPlot; LuxorGraphPlot.DEFAULT_UNIT[] = 25; LuxorGraphPlot.DEFAULT_BACKGROUND_COLOR[]="white"; # ╔═╡ eac6ceda-f5d4-11ec-23db-b7b4d00eaddf @@ -73,7 +73,7 @@ md"We can use the `map_graph` function to map the unweighted MIS problem on the unweighted_res = map_graph(graph; vertex_order=Branching()); # ╔═╡ 3f605eac-f587-40b2-8fac-8223777d3fad -md"Here, the key word argument `vertex_order` can be a vector of vertices in a specified order, or the method to compute the path decomposition that generates an order. The `Branching()` method is an exact path decomposition solver, which is suited for small graphs (where number of vertices <= 50). The `Greedy()` method finds the vertex order much faster and works in all cases, but is not optimal. +md"Here, the keyword argument `vertex_order` can be a vector of vertices in a specified order, or the method to compute the path decomposition that generates an order. The `Branching()` method is an exact path decomposition solver, which is suited for small graphs (where number of vertices <= 50). The `Greedy()` method finds the vertex order much faster and works in all cases, but may not be optimal. A good vertex order can reduce the depth of the mapped graph." # ╔═╡ e5382b61-6387-49b5-bae8-0389fbc92153 @@ -90,7 +90,7 @@ md"The field `grid_graph` is the mapped grid graph." show_graph(unweighted_res.grid_graph) # ╔═╡ 96ca41c0-ac77-404c-ada3-0cdc4a426e44 -md"The field `lines` is a vector of copy gadgets arranged in `⊢` shape. These copy gadgets form a *crossing lattice*, in which two copy lines cross each other whenever the their corresponding vertices in the source graph are connected by an edge. +md"The field `lines` is a vector of copy gadgets arranged in a `⊢` shape. These copy gadgets form a *crossing lattice*, in which two copy lines cross each other whenever their corresponding vertices in the source graph are connected by an edge. ``` vslot ↓ @@ -106,7 +106,7 @@ md"The field `lines` is a vector of copy gadgets arranged in `⊢` shape. These unweighted_res.lines # ╔═╡ a64c2094-9a51-4c45-b9d1-41693c89a212 -md"The field `mapping_history` contains the rewrite rules applied to the crossing lattice. They are important information for mapping a solution back." +md"The field `mapping_history` contains the rewrite rules applied to the crossing lattice. They contain important information for mapping a solution back." # ╔═╡ 52b904ad-6fb5-4a7e-a3db-ae7aff32be51 unweighted_res.mapping_history @@ -124,20 +124,20 @@ md"We can solve the mapped graph with [`GenericTensorNetworks`](https://queracom res = solve(IndependentSet(SimpleGraph(unweighted_res.grid_graph)), SingleConfigMax())[] # ╔═╡ 86457b4e-b83e-4bf5-9d82-b5e14c055b4b -md"You might want to read [the documentation page of `GenericTensorNetworks`](https://queracomputing.github.io/GenericTensorNetworks.jl/dev/) for a detailed explaination about this function. Here, we just visually check the solution configuration." +md"You might want to read [the documentation page of `GenericTensorNetworks`](https://queracomputing.github.io/GenericTensorNetworks.jl/dev/) for a detailed explanation on this function. Here, we just visually check the solution configuration." # ╔═╡ 4abb86dd-67e2-46f4-ae6c-e97952b23fdc show_config(unweighted_res.grid_graph, res.c.data) # ╔═╡ 5ec5e23a-6904-41cc-b2dc-659da9556d20 -md"By mapping the result back, we get a solution for the original Petersen graph. Its maximum independent set size is 4" +md"By mapping the result back, we get a solution for the original Petersen graph. Its maximum independent set size is 4." # ╔═╡ 773ce349-ba72-426c-849d-cfb511773756 # The solution obtained by solving the mapped graph original_configs = map_config_back(unweighted_res, res.c.data) # ╔═╡ 7d921205-5133-40c0-bfa6-f76713dd4972 -# Confirm the solution from the mapped graph gives us +# Confirm that the solution from the mapped graph gives us # a maximum independent set for the original graph UnitDiskMapping.is_independent_set(graph, original_configs) @@ -145,13 +145,13 @@ UnitDiskMapping.is_independent_set(graph, original_configs) md"## Generic Weighted Mapping" # ╔═╡ 5e4500f5-beb6-4ef9-bd42-41dc13b60bce -md"A Weighted Maximum Independent Set (WMIS) problem on a general graph can be mapped to one on the defected King's graph. The first step is do the same mapping as above but adding a new positional argument `Weighted()` as the first argument of `map_graph`. Let us still use the Petersen graph as an example." +md"A Maximum Weight Independent Set (MWIS) problem on a general graph can be mapped to one on the defected King's graph. The first step is to do the same mapping as above but adding a new positional argument `Weighted()` as the first argument of `map_graph`. Let us still use the Petersen graph as an example." # ╔═╡ 2fa704ee-d5c1-4205-9a6a-34ba0195fecf weighted_res = map_graph(Weighted(), graph; vertex_order=Branching()); # ╔═╡ 27acc8be-2db8-4322-85b4-230fdddac043 -md"The return value is similar to that for the unweighted mapping generated previously, except each node in the mapped graph can have a weight 1, 2 or 3. Note here, we haven't added the weights in the original graph." +md"The return value is similar to that for the unweighted mapping generated above, except each node in the mapped graph can have a weight 1, 2 or 3. Note here, we haven't added the weights in the original graph." # ╔═╡ b8879b2c-c6c2-47e2-a989-63a00c645676 show_grayscale(weighted_res.grid_graph) @@ -174,7 +174,7 @@ source_weights = rand(10) mapped_weights = map_weights(weighted_res, source_weights) # ╔═╡ f77293c4-e5c3-4f14-95a2-ac9688fa3ba1 -md"Now that we have both graph and weights, let us solve the mapped problem!" +md"Now that we have both the graph and the weights, let us solve the mapped problem!" # ╔═╡ cf910d3e-3e3c-42ef-acf3-d0990d6227ac wmap_config = let @@ -208,7 +208,7 @@ md"### Generic QUBO mapping" # ╔═╡ b5d95984-cf8d-4bce-a73a-8eb2a7c6b830 md""" -A QUBO problem can be specified as the following energy model +A QUBO problem can be specified as the following energy model: ```math E(z) = -\sum_{i