From 9ac9db410fec3587ec4cd3d496ac7246f2e6a8f2 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:17:36 -0500 Subject: [PATCH 01/37] benchmark CI --- .github/workflows/benchmarks/benchmarks.yml | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/benchmarks/benchmarks.yml diff --git a/.github/workflows/benchmarks/benchmarks.yml b/.github/workflows/benchmarks/benchmarks.yml new file mode 100644 index 0000000000..d481f0a152 --- /dev/null +++ b/.github/workflows/benchmarks/benchmarks.yml @@ -0,0 +1,72 @@ +name: Benchmarking +on: + push: + branches: + - master + pull_request: + +jobs: + benchmarks: + name: Python tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04] + + steps: + + - name: Checkout PennyLane-Lightning master + uses: actions/checkout@v2 + with: + path: main + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Install dependencies + run: sudo apt-get -y -q install cmake gcc + + - name: Get required Python packages + run: | + cd main + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Install lightning.qubit device + run: | + cd main + pip install -e . + + - name: Benchmark lightning master device + run: | + python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json + + - name: Benchmark default qubit device + run: | + python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json + + - name: Checkout PennyLane-Lightning PR + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + path: main + + - name: Install lightning.qubit device + run: | + cd main + pip install -e . + + - name: Benchmark lightning PR device + run: | + python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json + + - name: Plot results + run: | + python .github/workflows/benchmarks/plot_results.py + + - uses: actions/upload-artifact@v2 + with: + name: gates.png + path: ./gates.png From 95694a90ca7b84b05e69f546042a2bd96491fe9d Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:18:23 -0500 Subject: [PATCH 02/37] scripts --- .github/workflows/benchmarks/plot_results.py | 98 ++++++++++++++++++++ .github/workflows/benchmarks/run_bench.py | 45 +++++++++ 2 files changed, 143 insertions(+) create mode 100644 .github/workflows/benchmarks/plot_results.py create mode 100644 .github/workflows/benchmarks/run_bench.py diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py new file mode 100644 index 0000000000..a6958190e3 --- /dev/null +++ b/.github/workflows/benchmarks/plot_results.py @@ -0,0 +1,98 @@ +# Copyright 2018-2021 Xanadu Quantum Technologies Inc. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The MIT License (MIT) +# +# Copyright (c) 2009-2018 Xiuzhe (Roger) Luo, +# and other contributors. +# +# 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. + +# Acknowledghing the solution for plotting from the quantum-benchmarks repository +# at https://github.com/Roger-luo/quantum-benchmarks. + + +#!/usr/bin/env python3 +import os +import matplotlib +import matplotlib.pyplot as plt +import json + +COLOR = { + 'lightning_master.json': 'darkblue', + 'pennylane-lightning with PL v0.13': 'tab:orange', + 'default_qubit.json': 'tab:olive' +} + +projects = [ + 'lightning_master.json', + #'lightning_pr.json', + 'default_qubit.json', +] + +# Single Gate Benchmark Report +# Ordered as appear in projects +op_results = {"PauliX":[], "T":[], "Hadamard":[]} #, "CNOT":[]} + +for p in projects: + with open(p) as f: + data = json.load(f) + for k in data.keys(): + op_results[k].append(data[k] ) + +fig, ax = plt.subplots(2, 2, figsize=(10, 8)) +((ax1, ax2), (ax3, ax4)) = ax + +axes = ax.flatten() + +for a in ax.flatten(): + a.set_xlabel("nqubits", size=16) + a.set_ylabel("ns", size=16) + +for a, op in zip(axes, op_results.keys()): + for k,v in enumerate(projects): + a.semilogy(range(1,10), op_results[op][k], '-o', markersize=4, color=COLOR[v]) + +plots = [] +plt.tight_layout() +plt.subplots_adjust(top=0.85) + +lgd = fig.legend( + plots, + labels=[p.split(".")[0] for p in projects], + loc="upper center", + ncol=4, + frameon=False, + prop={'size': 15}, + borderaxespad=-0.4, + bbox_to_anchor=(0.5, 0.97) +) + +plt.savefig('gates.png') diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py new file mode 100644 index 0000000000..377ea13415 --- /dev/null +++ b/.github/workflows/benchmarks/run_bench.py @@ -0,0 +1,45 @@ +# Copyright 2018-2021 Xanadu Quantum Technologies Inc. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/usr/bin/env python3 + +# Generate data +import pennylane as qml +import timeit +import json +import sys + +if len(sys.argv)!=3: + raise ValueError("Please provide the device name and the filename as the only arguments.") + +device_string, filename = sys.argv[1], sys.argv[2] + +ops = ["PauliX", "T", "Hadamard"] + +op_res = {o:[] for o in ops} + +for num_q in range(1,10): + dev = qml.device(device_string, wires=num_q) + for gate in ops: + @qml.qnode(dev) + def circuit(): + getattr(qml, gate)(wires=0) + return qml.expval(qml.PauliZ(0)) + + number = 1000 + res = timeit.timeit(circuit, number =number)/number + op_res[gate].append(res) + +with open(filename, 'w') as fp: + json.dump(op_res, fp) From df248155b175f191e23bd172aa39ee02984905ba Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:24:07 -0500 Subject: [PATCH 03/37] adjust --- .github/workflows/benchmarks/plot_results.py | 4 ++-- .github/workflows/benchmarks/run_bench.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index a6958190e3..98ecdd0be3 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -47,13 +47,13 @@ COLOR = { 'lightning_master.json': 'darkblue', - 'pennylane-lightning with PL v0.13': 'tab:orange', + 'lightning_pr.json': 'tab:orange', 'default_qubit.json': 'tab:olive' } projects = [ 'lightning_master.json', - #'lightning_pr.json', + 'lightning_pr.json', 'default_qubit.json', ] diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index 377ea13415..1f6298515d 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -32,13 +32,12 @@ for num_q in range(1,10): dev = qml.device(device_string, wires=num_q) for gate in ops: - @qml.qnode(dev) - def circuit(): - getattr(qml, gate)(wires=0) - return qml.expval(qml.PauliZ(0)) + def apply_op(): + # Calling apply to minimize the Python overhead + dev.apply([getattr(qml, gate)(wires=0)]) - number = 1000 - res = timeit.timeit(circuit, number =number)/number + number = 10000 + res = timeit.timeit(apply_op, number =number)/number op_res[gate].append(res) with open(filename, 'w') as fp: From 67eef846f9a5fa043f83486a8232a0d89ddc734e Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:27:58 -0500 Subject: [PATCH 04/37] whitespace --- .github/workflows/{benchmarks => }/benchmarks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{benchmarks => }/benchmarks.yml (94%) diff --git a/.github/workflows/benchmarks/benchmarks.yml b/.github/workflows/benchmarks.yml similarity index 94% rename from .github/workflows/benchmarks/benchmarks.yml rename to .github/workflows/benchmarks.yml index d481f0a152..742024d4a9 100644 --- a/.github/workflows/benchmarks/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -41,11 +41,11 @@ jobs: - name: Benchmark lightning master device run: | - python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json + python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json - name: Benchmark default qubit device run: | - python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json + python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - name: Checkout PennyLane-Lightning PR uses: actions/checkout@v2 @@ -60,7 +60,7 @@ jobs: - name: Benchmark lightning PR device run: | - python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json + python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json - name: Plot results run: | From 8e0fba238f69f7b1879c60714d65a0e8fd3cdd71 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:30:27 -0500 Subject: [PATCH 05/37] adjust --- .github/workflows/benchmarks.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 742024d4a9..897d0397f4 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -7,7 +7,7 @@ on: jobs: benchmarks: - name: Python tests + name: Gate benchmarks runs-on: ${{ matrix.os }} strategy: matrix: @@ -34,17 +34,19 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - - name: Install lightning.qubit device + - name: Install lightning.qubit device (master) run: | cd main pip install -e . - name: Benchmark lightning master device run: | + cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json - name: Benchmark default qubit device run: | + cd main python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - name: Checkout PennyLane-Lightning PR @@ -53,17 +55,19 @@ jobs: ref: ${{ github.ref }} path: main - - name: Install lightning.qubit device + - name: Install lightning.qubit device (PR) run: | cd main pip install -e . - name: Benchmark lightning PR device run: | + cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json - name: Plot results run: | + cd main python .github/workflows/benchmarks/plot_results.py - uses: actions/upload-artifact@v2 From d4ab3bc66981ffda8ef7f17944a86efb884f06b0 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:34:29 -0500 Subject: [PATCH 06/37] get matplotlib --- .github/workflows/benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 897d0397f4..690b0f7a22 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -33,6 +33,7 @@ jobs: cd main python -m pip install --upgrade pip pip install -r requirements.txt + pip install matplotlib - name: Install lightning.qubit device (master) run: | From 0bf655881537e42d60b5044787d214487ce2214a Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:46:05 -0500 Subject: [PATCH 07/37] temp remove --- .github/workflows/benchmarks.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 690b0f7a22..a0f31615f3 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -45,27 +45,6 @@ jobs: cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json - - name: Benchmark default qubit device - run: | - cd main - python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - - - name: Checkout PennyLane-Lightning PR - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - path: main - - - name: Install lightning.qubit device (PR) - run: | - cd main - pip install -e . - - - name: Benchmark lightning PR device - run: | - cd main - python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json - - name: Plot results run: | cd main From c55da6700f0a8e486b495b95f16f678674c6cfa2 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:47:44 -0500 Subject: [PATCH 08/37] temp --- .github/workflows/benchmarks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index a0f31615f3..50c023386a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -44,6 +44,9 @@ jobs: run: | cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json + pwd + ls -la + la -la .github/workflows/benchmarks/ - name: Plot results run: | From 281bb33643ae1fdf19466e21bb06acd55927f470 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:51:32 -0500 Subject: [PATCH 09/37] fix --- .github/workflows/benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 50c023386a..23e016b224 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -46,7 +46,7 @@ jobs: python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json pwd ls -la - la -la .github/workflows/benchmarks/ + ls -la .github/workflows/benchmarks/ - name: Plot results run: | From 49b42d6b13319ba7c067040924a44af89406105f Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:57:17 -0500 Subject: [PATCH 10/37] Revert "fix" This reverts commit 281bb33643ae1fdf19466e21bb06acd55927f470. --- .github/workflows/benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 23e016b224..50c023386a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -46,7 +46,7 @@ jobs: python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json pwd ls -la - ls -la .github/workflows/benchmarks/ + la -la .github/workflows/benchmarks/ - name: Plot results run: | From 6f027cbf858306e0552d404054a558e7ad3e23b3 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:57:24 -0500 Subject: [PATCH 11/37] Revert "temp" This reverts commit c55da6700f0a8e486b495b95f16f678674c6cfa2. --- .github/workflows/benchmarks.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 50c023386a..a0f31615f3 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -44,9 +44,6 @@ jobs: run: | cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json - pwd - ls -la - la -la .github/workflows/benchmarks/ - name: Plot results run: | From 71c8831002f75504e8813dbb2ba0f69526aa3d29 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:57:32 -0500 Subject: [PATCH 12/37] Revert "temp remove" This reverts commit 0bf655881537e42d60b5044787d214487ce2214a. --- .github/workflows/benchmarks.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index a0f31615f3..690b0f7a22 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -45,6 +45,27 @@ jobs: cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json + - name: Benchmark default qubit device + run: | + cd main + python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json + + - name: Checkout PennyLane-Lightning PR + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + path: main + + - name: Install lightning.qubit device (PR) + run: | + cd main + pip install -e . + + - name: Benchmark lightning PR device + run: | + cd main + python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json + - name: Plot results run: | cd main From 11a925dd4fa4307d56af73b0d357189002aceca4 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 12:59:43 -0500 Subject: [PATCH 13/37] main/pr --- .github/workflows/benchmarks.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 690b0f7a22..d04f6810d0 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -54,17 +54,19 @@ jobs: uses: actions/checkout@v2 with: ref: ${{ github.ref }} - path: main + path: main/pr - name: Install lightning.qubit device (PR) run: | - cd main + cd main/pr pip install -e . - name: Benchmark lightning PR device run: | cd main + cd main/pr python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json + mv lightning_pr.json .. - name: Plot results run: | From 9140de99a1d46e8220b02d1cd5ad6bb8ce7b8060 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 13:03:24 -0500 Subject: [PATCH 14/37] creat main/pr --- .github/workflows/benchmarks.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index d04f6810d0..93aba64141 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -56,6 +56,10 @@ jobs: ref: ${{ github.ref }} path: main/pr + - name: Create main/pr + run: | + mkdir main/pr + - name: Install lightning.qubit device (PR) run: | cd main/pr From e9a893a1e3178d40dbf0da348cd24546e1b7e982 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 13:07:59 -0500 Subject: [PATCH 15/37] fix --- .github/workflows/benchmarks.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 93aba64141..3df0c2410c 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -56,10 +56,6 @@ jobs: ref: ${{ github.ref }} path: main/pr - - name: Create main/pr - run: | - mkdir main/pr - - name: Install lightning.qubit device (PR) run: | cd main/pr @@ -67,7 +63,6 @@ jobs: - name: Benchmark lightning PR device run: | - cd main cd main/pr python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_pr.json mv lightning_pr.json .. From daf3c3bb13e5dd1bc465c632f4beef6fe7b92002 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 13:12:41 -0500 Subject: [PATCH 16/37] fix path --- .github/workflows/benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 3df0c2410c..18524cc8e2 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -75,4 +75,4 @@ jobs: - uses: actions/upload-artifact@v2 with: name: gates.png - path: ./gates.png + path: ./main/gates.png From dcd20b4b0d5401470883a11b481e6c1c736d4154 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 13:21:45 -0500 Subject: [PATCH 17/37] qubit range; no lines --- .github/workflows/benchmarks/plot_results.py | 2 +- .github/workflows/benchmarks/run_bench.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 98ecdd0be3..4edc5f3168 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -78,7 +78,7 @@ for a, op in zip(axes, op_results.keys()): for k,v in enumerate(projects): - a.semilogy(range(1,10), op_results[op][k], '-o', markersize=4, color=COLOR[v]) + a.semilogy(range(1,10), op_results[op][k], '-o', markersize=4, color=COLOR[v], linestyle="None") plots = [] plt.tight_layout() diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index 1f6298515d..f2fdb24141 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -29,7 +29,7 @@ op_res = {o:[] for o in ops} -for num_q in range(1,10): +for num_q in [1, 2, 3, 5, 10, 13 15, 18 20]: dev = qml.device(device_string, wires=num_q) for gate in ops: def apply_op(): From 961546a9aa6df00ed797bad7d025ff349b6cde06 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:09:44 -0500 Subject: [PATCH 18/37] more --- .github/workflows/benchmarks/parameters.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/workflows/benchmarks/parameters.py diff --git a/.github/workflows/benchmarks/parameters.py b/.github/workflows/benchmarks/parameters.py new file mode 100644 index 0000000000..932af984e0 --- /dev/null +++ b/.github/workflows/benchmarks/parameters.py @@ -0,0 +1,2 @@ +qubits = [1] #, 3, 5, 10, 15, 18] +ops = ["PauliX", "T", "Hadamard"] From 31fbafc98346afc419222c5e595d87334bd40355 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:09:55 -0500 Subject: [PATCH 19/37] organize --- .github/workflows/benchmarks/plot_results.py | 19 ++++++++++--------- .github/workflows/benchmarks/run_bench.py | 5 ++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 4edc5f3168..b4fd18fdec 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -44,22 +44,21 @@ import matplotlib import matplotlib.pyplot as plt import json +from parameters import qubits, ops -COLOR = { - 'lightning_master.json': 'darkblue', - 'lightning_pr.json': 'tab:orange', - 'default_qubit.json': 'tab:olive' -} - +colors = ['darkblue', 'tab:orange', 'tab:olive'] projects = [ 'lightning_master.json', 'lightning_pr.json', 'default_qubit.json', ] +COLOR = dict(zip(projects, colors)) + # Single Gate Benchmark Report # Ordered as appear in projects -op_results = {"PauliX":[], "T":[], "Hadamard":[]} #, "CNOT":[]} +ops = ["PauliX", "T", "Hadamard"] +op_results = { o:[] for o in ops} #, "CNOT":[]} for p in projects: with open(p) as f: @@ -72,13 +71,15 @@ axes = ax.flatten() -for a in ax.flatten(): +for op, a in zip(ops, ax.flatten()): a.set_xlabel("nqubits", size=16) a.set_ylabel("ns", size=16) + a.set_title(op) for a, op in zip(axes, op_results.keys()): for k,v in enumerate(projects): - a.semilogy(range(1,10), op_results[op][k], '-o', markersize=4, color=COLOR[v], linestyle="None") + data = op_results[op][k] + a.semilogy(qubits, data, '-o', markersize=4, color=COLOR[v], linestyle="None") plots = [] plt.tight_layout() diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index f2fdb24141..8c1bba2fa1 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -19,17 +19,16 @@ import timeit import json import sys +from parameters import qubits, ops if len(sys.argv)!=3: raise ValueError("Please provide the device name and the filename as the only arguments.") device_string, filename = sys.argv[1], sys.argv[2] -ops = ["PauliX", "T", "Hadamard"] - op_res = {o:[] for o in ops} -for num_q in [1, 2, 3, 5, 10, 13 15, 18 20]: +for num_q in qubits: dev = qml.device(device_string, wires=num_q) for gate in ops: def apply_op(): From 0f3ac945f20337521c8fd41217f99306b9350d4b Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:20:00 -0500 Subject: [PATCH 20/37] further --- .github/workflows/benchmarks/parameters.py | 4 ++-- .github/workflows/benchmarks/plot_results.py | 7 ++----- .github/workflows/benchmarks/run_bench.py | 6 +++++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks/parameters.py b/.github/workflows/benchmarks/parameters.py index 932af984e0..3a745d8e31 100644 --- a/.github/workflows/benchmarks/parameters.py +++ b/.github/workflows/benchmarks/parameters.py @@ -1,2 +1,2 @@ -qubits = [1] #, 3, 5, 10, 15, 18] -ops = ["PauliX", "T", "Hadamard"] +qubits = [1, 3, 5, 10, 15, 18] +ops = ["PauliX", "T", "Hadamard", "CNOT"] diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index b4fd18fdec..c380b9b9eb 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -55,10 +55,7 @@ COLOR = dict(zip(projects, colors)) -# Single Gate Benchmark Report -# Ordered as appear in projects -ops = ["PauliX", "T", "Hadamard"] -op_results = { o:[] for o in ops} #, "CNOT":[]} +op_results = { o:[] for o in ops} for p in projects: with open(p) as f: @@ -74,7 +71,7 @@ for op, a in zip(ops, ax.flatten()): a.set_xlabel("nqubits", size=16) a.set_ylabel("ns", size=16) - a.set_title(op) + a.set_title(op + " gate") for a, op in zip(axes, op_results.keys()): for k,v in enumerate(projects): diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index 8c1bba2fa1..f47e4d02a4 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -33,7 +33,11 @@ for gate in ops: def apply_op(): # Calling apply to minimize the Python overhead - dev.apply([getattr(qml, gate)(wires=0)]) + pennylane_op = getattr(qml, gate) + if pennylane_op.num_wires == 1: + dev.apply([pennylane_op(wires=0)]) + elif num_q > 1 and pennylane_op.num_wires == 2: + dev.apply([pennylane_op(wires=[0, 1])]) number = 10000 res = timeit.timeit(apply_op, number =number)/number From 2d457ae64fdb569f7d4d712b923f2f8eeff4e328 Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:22:43 -0500 Subject: [PATCH 21/37] format --- .github/workflows/benchmarks/plot_results.py | 24 ++++++++++---------- .github/workflows/benchmarks/run_bench.py | 14 ++++++++---- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index c380b9b9eb..b0d6e701c9 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -46,22 +46,22 @@ import json from parameters import qubits, ops -colors = ['darkblue', 'tab:orange', 'tab:olive'] +colors = ["darkblue", "tab:orange", "tab:olive"] projects = [ - 'lightning_master.json', - 'lightning_pr.json', - 'default_qubit.json', + "lightning_master.json", + "lightning_pr.json", + "default_qubit.json", ] COLOR = dict(zip(projects, colors)) -op_results = { o:[] for o in ops} +op_results = {o: [] for o in ops} for p in projects: with open(p) as f: data = json.load(f) for k in data.keys(): - op_results[k].append(data[k] ) + op_results[k].append(data[k]) fig, ax = plt.subplots(2, 2, figsize=(10, 8)) ((ax1, ax2), (ax3, ax4)) = ax @@ -74,10 +74,10 @@ a.set_title(op + " gate") for a, op in zip(axes, op_results.keys()): - for k,v in enumerate(projects): + for k, v in enumerate(projects): data = op_results[op][k] - a.semilogy(qubits, data, '-o', markersize=4, color=COLOR[v], linestyle="None") - + a.semilogy(qubits, data, "-o", markersize=4, color=COLOR[v], linestyle="None") + plots = [] plt.tight_layout() plt.subplots_adjust(top=0.85) @@ -88,9 +88,9 @@ loc="upper center", ncol=4, frameon=False, - prop={'size': 15}, + prop={"size": 15}, borderaxespad=-0.4, - bbox_to_anchor=(0.5, 0.97) + bbox_to_anchor=(0.5, 0.97), ) -plt.savefig('gates.png') +plt.savefig("gates.png") diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index f47e4d02a4..0909325c3c 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -14,6 +14,7 @@ #!/usr/bin/env python3 +# pylint: disable=cell-var-from-loop # Generate data import pennylane as qml import timeit @@ -21,16 +22,19 @@ import sys from parameters import qubits, ops -if len(sys.argv)!=3: - raise ValueError("Please provide the device name and the filename as the only arguments.") +if len(sys.argv) != 3: + raise ValueError( + "Please provide the device name and the filename as the only arguments." + ) device_string, filename = sys.argv[1], sys.argv[2] -op_res = {o:[] for o in ops} +op_res = {o: [] for o in ops} for num_q in qubits: dev = qml.device(device_string, wires=num_q) for gate in ops: + def apply_op(): # Calling apply to minimize the Python overhead pennylane_op = getattr(qml, gate) @@ -40,8 +44,8 @@ def apply_op(): dev.apply([pennylane_op(wires=[0, 1])]) number = 10000 - res = timeit.timeit(apply_op, number =number)/number + res = timeit.timeit(apply_op, number=number) / number op_res[gate].append(res) -with open(filename, 'w') as fp: +with open(filename, "w") as fp: json.dump(op_res, fp) From ca0fd6a7317dd8eb061f093152c9de58e5f008db Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:32:20 -0500 Subject: [PATCH 22/37] ns --- .github/workflows/benchmarks/plot_results.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index b0d6e701c9..e3adc794c9 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -45,6 +45,7 @@ import matplotlib.pyplot as plt import json from parameters import qubits, ops +import numpy as np colors = ["darkblue", "tab:orange", "tab:olive"] projects = [ @@ -76,6 +77,7 @@ for a, op in zip(axes, op_results.keys()): for k, v in enumerate(projects): data = op_results[op][k] + data = np.array(data) * 1e9 a.semilogy(qubits, data, "-o", markersize=4, color=COLOR[v], linestyle="None") plots = [] From 88ffbae2b3c7c1b8080210afe76d87a3e2dc8fef Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:35:07 -0500 Subject: [PATCH 23/37] lic --- .github/workflows/benchmarks/parameters.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/benchmarks/parameters.py b/.github/workflows/benchmarks/parameters.py index 3a745d8e31..c9ecbecd61 100644 --- a/.github/workflows/benchmarks/parameters.py +++ b/.github/workflows/benchmarks/parameters.py @@ -1,2 +1,15 @@ +# Copyright 2018-2021 Xanadu Quantum Technologies Inc. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. qubits = [1, 3, 5, 10, 15, 18] ops = ["PauliX", "T", "Hadamard", "CNOT"] From 15013bebfcd3f1dadcba1acfcfd78b89217c3c0b Mon Sep 17 00:00:00 2001 From: antalszava Date: Fri, 12 Mar 2021 15:38:02 -0500 Subject: [PATCH 24/37] int labels --- .github/workflows/benchmarks/plot_results.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index e3adc794c9..80561c4655 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -43,6 +43,7 @@ import os import matplotlib import matplotlib.pyplot as plt +from matplotlib.ticker import MaxNLocator import json from parameters import qubits, ops import numpy as np @@ -73,6 +74,7 @@ a.set_xlabel("nqubits", size=16) a.set_ylabel("ns", size=16) a.set_title(op + " gate") + a.xaxis.set_major_locator(MaxNLocator(integer=True)) for a, op in zip(axes, op_results.keys()): for k, v in enumerate(projects): From e1f3294d957fe0cac9edd8a69cc3a3b5955e5ce2 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:00:44 -0400 Subject: [PATCH 25/37] runs-on; no push run --- .github/workflows/benchmarks.yml | 3 --- .github/workflows/build.yml | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 18524cc8e2..b13a4c3b4b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -1,8 +1,5 @@ name: Benchmarking on: - push: - branches: - - master pull_request: jobs: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d31bec846..5bceed36ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,7 @@ on: jobs: cpptests: name: C++ tests - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-18.04] - + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 From 041b41308b7f5d5d149f4dccac7a4708dd8ec9ea Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:05:04 -0400 Subject: [PATCH 26/37] git checkout --- .github/workflows/benchmarks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index b13a4c3b4b..651ee35f40 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -49,9 +49,9 @@ jobs: - name: Checkout PennyLane-Lightning PR uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - path: main/pr + run: | + cd main + git checkout ${{ github.ref }} - name: Install lightning.qubit device (PR) run: | From ed1bd6f0a229cbe04890a892605dec0e27921fdc Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:08:15 -0400 Subject: [PATCH 27/37] no uses --- .github/workflows/benchmarks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 651ee35f40..0106a75472 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -48,7 +48,6 @@ jobs: python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - name: Checkout PennyLane-Lightning PR - uses: actions/checkout@v2 run: | cd main git checkout ${{ github.ref }} From b12561501e7b3294c9fedc4fd2e908d65f0e472a Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:14:39 -0400 Subject: [PATCH 28/37] Revert "no uses" This reverts commit ed1bd6f0a229cbe04890a892605dec0e27921fdc. --- .github/workflows/benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 0106a75472..651ee35f40 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -48,6 +48,7 @@ jobs: python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - name: Checkout PennyLane-Lightning PR + uses: actions/checkout@v2 run: | cd main git checkout ${{ github.ref }} From 0ca25d17a9db185113842126ddbb4f140a91cc49 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:14:48 -0400 Subject: [PATCH 29/37] Revert "git checkout" This reverts commit 041b41308b7f5d5d149f4dccac7a4708dd8ec9ea. --- .github/workflows/benchmarks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 651ee35f40..b13a4c3b4b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -49,9 +49,9 @@ jobs: - name: Checkout PennyLane-Lightning PR uses: actions/checkout@v2 - run: | - cd main - git checkout ${{ github.ref }} + with: + ref: ${{ github.ref }} + path: main/pr - name: Install lightning.qubit device (PR) run: | From 2381c8faefa924bf93e534cafb10071719d6c68a Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:18:14 -0400 Subject: [PATCH 30/37] remove previous binaries and pip uninstall --- .github/workflows/benchmarks.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index b13a4c3b4b..9d9de0e97f 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -55,7 +55,10 @@ jobs: - name: Install lightning.qubit device (PR) run: | - cd main/pr + cd main + make clean + pip uninstall pennylane-lightning -y + cd pr pip install -e . - name: Benchmark lightning PR device From 2741927f277c3b77c97ac0b61c566a2af7d8d149 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:18:35 -0400 Subject: [PATCH 31/37] no default.qubit bench (temp) --- .github/workflows/benchmarks.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 9d9de0e97f..64d19d0791 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -42,11 +42,6 @@ jobs: cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json - - name: Benchmark default qubit device - run: | - cd main - python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json - - name: Checkout PennyLane-Lightning PR uses: actions/checkout@v2 with: From 0b365d80825c1a18c756760174aaa9848fab7b2b Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:21:16 -0400 Subject: [PATCH 32/37] Revert "no default.qubit bench (temp)" This reverts commit 2741927f277c3b77c97ac0b61c566a2af7d8d149. --- .github/workflows/benchmarks.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 64d19d0791..9d9de0e97f 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -42,6 +42,11 @@ jobs: cd main python .github/workflows/benchmarks/run_bench.py lightning.qubit lightning_master.json + - name: Benchmark default qubit device + run: | + cd main + python .github/workflows/benchmarks/run_bench.py default.qubit default_qubit.json + - name: Checkout PennyLane-Lightning PR uses: actions/checkout@v2 with: From 9d42fe50afac5bb0c787ae9af1a77c11beff88b2 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 15:17:57 -0400 Subject: [PATCH 33/37] Update .github/workflows/benchmarks/plot_results.py Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> --- .github/workflows/benchmarks/plot_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 80561c4655..95343a4f0f 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -35,7 +35,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# Acknowledghing the solution for plotting from the quantum-benchmarks repository +# Acknowledging the approach for plotting from the quantum-benchmarks repository # at https://github.com/Roger-luo/quantum-benchmarks. From 81e33bcbb222e58878f79bdc9dddf7c8d24bc70c Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 15:18:05 -0400 Subject: [PATCH 34/37] Update .github/workflows/benchmarks/plot_results.py Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com> --- .github/workflows/benchmarks/plot_results.py | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 95343a4f0f..19beede2fa 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -41,7 +41,6 @@ #!/usr/bin/env python3 import os -import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator import json From 7cc9fb3de7d195fa8680e9fe3b4ebab6316f3086 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 03:40:20 -0400 Subject: [PATCH 35/37] license --- .github/workflows/benchmarks/plot_results.py | 23 ----------------- .github/workflows/benchmarks/run_bench.py | 26 ++++++++++++++++++++ LICENSE | 11 +++++++++ 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 19beede2fa..01046363d6 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -12,29 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# The MIT License (MIT) -# -# Copyright (c) 2009-2018 Xiuzhe (Roger) Luo, -# and other contributors. -# -# 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. - # Acknowledging the approach for plotting from the quantum-benchmarks repository # at https://github.com/Roger-luo/quantum-benchmarks. diff --git a/.github/workflows/benchmarks/run_bench.py b/.github/workflows/benchmarks/run_bench.py index 0909325c3c..20a9562e4b 100644 --- a/.github/workflows/benchmarks/run_bench.py +++ b/.github/workflows/benchmarks/run_bench.py @@ -12,6 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +# The MIT License (MIT) +# +# Copyright (c) 2009-2018 Xiuzhe (Roger) Luo, +# and other contributors. +# +# 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. + +# Acknowledging the benchmarking approach from the quantum-benchmarks repository +# at https://github.com/Roger-luo/quantum-benchmarks. + #!/usr/bin/env python3 # pylint: disable=cell-var-from-loop diff --git a/LICENSE b/LICENSE index 261eeb9e9f..3e817fcfdc 100644 --- a/LICENSE +++ b/LICENSE @@ -199,3 +199,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +-------------------------------------------------------------------------------- +This product bundles various third-party components under other open source +licenses. This section summarizes those components and their licenses. +See licenses/ for text of these licenses. + + +The MIT License (MIT) +--------------------- + +.github/workflows/benchmarks/run_bench.py From a8be88ebb5d2dfb1f4adc839b1fc3137378ec46a Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 22:38:47 -0400 Subject: [PATCH 36/37] adjust licensing --- .github/workflows/benchmarks/plot_results.py | 24 +++++++++++++++++++- LICENSE | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks/plot_results.py b/.github/workflows/benchmarks/plot_results.py index 01046363d6..0927e07c21 100644 --- a/.github/workflows/benchmarks/plot_results.py +++ b/.github/workflows/benchmarks/plot_results.py @@ -12,10 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +# The MIT License (MIT) +# +# Copyright (c) 2009-2018 Xiuzhe (Roger) Luo, +# and other contributors. +# +# 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. + # Acknowledging the approach for plotting from the quantum-benchmarks repository # at https://github.com/Roger-luo/quantum-benchmarks. - #!/usr/bin/env python3 import os import matplotlib.pyplot as plt diff --git a/LICENSE b/LICENSE index 3e817fcfdc..02317d08a1 100644 --- a/LICENSE +++ b/LICENSE @@ -203,10 +203,10 @@ -------------------------------------------------------------------------------- This product bundles various third-party components under other open source licenses. This section summarizes those components and their licenses. -See licenses/ for text of these licenses. The MIT License (MIT) --------------------- .github/workflows/benchmarks/run_bench.py +.github/workflows/benchmarks/plot_results.py From 7ca605bf153fed3e14532143e3f135ef681160b9 Mon Sep 17 00:00:00 2001 From: antalszava Date: Tue, 16 Mar 2021 22:53:06 -0400 Subject: [PATCH 37/37] runs-on --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bceed36ec..47cffa4f08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,10 @@ on: jobs: cpptests: name: C++ tests - runs-on: ubuntu-18.04 + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04] steps: - uses: actions/checkout@v2