diff --git a/GruntFile.js b/GruntFile.js index e845277b..3bcc4baa 100644 --- a/GruntFile.js +++ b/GruntFile.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ var path = require('path'); diff --git a/PuppeteerRunTests.js b/PuppeteerRunTests.js index 00303763..fd4553b2 100644 --- a/PuppeteerRunTests.js +++ b/PuppeteerRunTests.js @@ -1,3 +1,19 @@ +/** + * Copyright 2017 Google 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. + */ + const puppeteer = require('puppeteer'); (async () => { diff --git a/PuppeteerScreenshotCircuit.js b/PuppeteerScreenshotCircuit.js index 8bde8f00..a01f3158 100644 --- a/PuppeteerScreenshotCircuit.js +++ b/PuppeteerScreenshotCircuit.js @@ -1,3 +1,19 @@ +/** + * Copyright 2017 Google 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. + */ + const puppeteer = require('puppeteer'); (async () => { diff --git a/karma.test.conf.js b/karma.test.conf.js index dc69150c..c2d488a8 100644 --- a/karma.test.conf.js +++ b/karma.test.conf.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ module.exports = function(config) { config.set({ diff --git a/karma.test_perf.conf.js b/karma.test_perf.conf.js index 6f1617a9..2a037d4c 100644 --- a/karma.test_perf.conf.js +++ b/karma.test_perf.conf.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ module.exports = function(config) { config.set({ diff --git a/package-lock.json b/package-lock.json index 2999eb06..25cbd7bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "quirk-quantum-circuit-simulator", - "version": "2.3.0", + "version": "2.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -158,12 +158,6 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -255,15 +249,6 @@ "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "dev": true, - "requires": { - "callsite": "1.0.0" - } - }, "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", @@ -383,12 +368,6 @@ "unset-value": "^1.0.0" } }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -604,12 +583,6 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", - "dev": true - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -765,82 +738,6 @@ "once": "^1.4.0" } }, - "engine.io": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz", - "integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "0.3.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "^7.1.2" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "engine.io-client": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.3.tgz", - "integrity": "sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw==", - "dev": true, - "requires": { - "component-emitter": "~1.3.0", - "component-inherit": "0.0.3", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "~6.1.0", - "xmlhttprequest-ssl": "~1.5.4", - "yeast": "0.1.2" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, "engine.io-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", @@ -1190,9 +1087,9 @@ "dev": true }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", + "version": "1.14.7", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz", + "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==", "dev": true }, "for-in": { @@ -1291,18 +1188,18 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" }, "dependencies": { "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -2444,12 +2341,6 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", - "dev": true - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -2602,24 +2493,6 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, - "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } - }, - "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "dev": true, - "requires": { - "better-assert": "~1.0.0" - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -2645,9 +2518,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-root": { @@ -3081,19 +2954,25 @@ } }, "socket.io": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", - "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.4.1.tgz", + "integrity": "sha512-Si18v0mMXGAqLqCVpTxBa8MGqriHGQh8ccEOhmsmNS3thNCGBwO8WGrwMibANsWtQQ5NStdZwHqZR3naJVFc3w==", "dev": true, "requires": { "debug": "~4.1.0", - "engine.io": "~3.4.0", + "engine.io": "~3.5.0", "has-binary2": "~1.0.2", "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.3.0", + "socket.io-client": "2.4.0", "socket.io-parser": "~3.4.0" }, "dependencies": { + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "dev": true + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -3103,55 +2982,54 @@ "ms": "^2.1.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", - "dev": true - }, - "socket.io-client": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", - "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", - "dev": true, - "requires": { - "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "engine.io-client": "~3.4.0", - "has-binary2": "~1.0.2", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true + "engine.io": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.5.0.tgz", + "integrity": "sha512-21HlvPUKaitDGE4GXNtQ7PLP0Sz4aWLddMPw2VTyFz1FVZqu/kZsJUO8WNpKuE/OCL7nkfRaOui2ZCJloGznGA==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.4.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "~7.4.2" + } }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "engine.io-client": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.0.tgz", + "integrity": "sha512-12wPRfMrugVw/DNyJk34GQ5vIVArEcVMXWugQGGuw2XxUSztFNmJggZmv8IZlLyEdnpO1QB9LkcjeWewO2vxtA==", "dev": true, "requires": { - "ms": "^2.1.1" + "component-emitter": "~1.3.0", + "component-inherit": "0.0.3", + "debug": "~3.1.0", + "engine.io-parser": "~2.2.0", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "ws": "~7.4.2", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "isarray": { @@ -3161,20 +3039,40 @@ "dev": true }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "parseqs": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==", "dev": true }, - "socket.io-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", - "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "parseuri": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==", + "dev": true + }, + "socket.io-client": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", + "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", "dev": true, "requires": { - "component-emitter": "1.2.1", + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "~1.3.0", "debug": "~3.1.0", - "isarray": "2.0.1" + "engine.io-client": "~3.5.0", + "has-binary2": "~1.0.2", + "indexof": "0.0.1", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "socket.io-parser": "~3.3.0", + "to-array": "0.1.4" }, "dependencies": { "debug": { @@ -3191,11 +3089,28 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "socket.io-parser": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", + "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "dev": true, + "requires": { + "component-emitter": "~1.3.0", + "debug": "~3.1.0", + "isarray": "2.0.1" + } } } } } }, + "socket.io-adapter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", + "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", + "dev": true + }, "socket.io-parser": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", @@ -3741,9 +3656,9 @@ "dev": true }, "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", "dev": true }, "xmlhttprequest-ssl": { @@ -3753,9 +3668,9 @@ "dev": true }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true }, "yargs": { diff --git a/package.json b/package.json index 01ca317a..01c75fb8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "Quirk", "description": "A drag-and-drop toy for exploring and understanding small quantum circuits.", "license": "Apache-2.0", - "version": "2.3.0", + "version": "2.3.2", "homepage": "https://github.com/Strilanc/Quirk", "bugs": { "url": "https://github.com/Strilanc/Quirk/issues" diff --git a/src/Config.js b/src/Config.js index a5e518fb..4a9aa01a 100644 --- a/src/Config.js +++ b/src/Config.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Configuration parameters for quantum circuit visualizer. diff --git a/src/base/CooldownThrottle.js b/src/base/CooldownThrottle.js index ee27f629..7ee5584d 100644 --- a/src/base/CooldownThrottle.js +++ b/src/base/CooldownThrottle.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Performs an action when triggered, but defers the action if it happens too soon after the last one. diff --git a/src/base/Describe.js b/src/base/Describe.js index 9e8baf72..260cea91 100644 --- a/src/base/Describe.js +++ b/src/base/Describe.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ const COLLECTION_CUTOFF = 1000; const BAD_TO_STRING_RESULT = new (function(){})().toString(); diff --git a/src/base/DetailedError.js b/src/base/DetailedError.js index 5201f5c7..4db05233 100644 --- a/src/base/DetailedError.js +++ b/src/base/DetailedError.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {describe} from "src/base/Describe.js" +import {describe} from "./Describe.js" let CONSTRUCTOR_CALLS_NESTING = 0; diff --git a/src/base/Equate.js b/src/base/Equate.js index 438c5740..c39b5998 100644 --- a/src/base/Equate.js +++ b/src/base/Equate.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Determines if two values are currently equivalent. diff --git a/src/base/Format.js b/src/base/Format.js index c109fe18..ab23c5ff 100644 --- a/src/base/Format.js +++ b/src/base/Format.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Stores formatting options, for determining what string output should look like. diff --git a/src/base/Obs.js b/src/base/Obs.js index 12b984dc..cd72b590 100644 --- a/src/base/Obs.js +++ b/src/base/Obs.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {CooldownThrottle} from "src/base/CooldownThrottle.js" +import {CooldownThrottle} from "./CooldownThrottle.js" /** * An observable sequence of events. diff --git a/src/base/RestartableRng.js b/src/base/RestartableRng.js index 998311f3..b7663cf9 100644 --- a/src/base/RestartableRng.js +++ b/src/base/RestartableRng.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * A random number generator that records its results, so you can make a restarted copy. diff --git a/src/base/Revision.js b/src/base/Revision.js index 08d47d94..3d6f6a02 100644 --- a/src/base/Revision.js +++ b/src/base/Revision.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {describe} from "src/base/Describe.js" -import {equate} from "src/base/Equate.js" -import {DetailedError} from "src/base/DetailedError.js" -import {ObservableSource, ObservableValue} from "src/base/Obs.js" +/** + * Copyright 2017 Google 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. + */ + +import {describe} from "./Describe.js" +import {equate} from "./Equate.js" +import {DetailedError} from "./DetailedError.js" +import {ObservableSource, ObservableValue} from "./Obs.js" /** * A simple linear revision history tracker, for supporting undo and redo functionality. diff --git a/src/base/Seq.js b/src/base/Seq.js index 720e4659..12d269a4 100644 --- a/src/base/Seq.js +++ b/src/base/Seq.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "./DetailedError.js" export const THROW_IF_EMPTY = { if_same_instance_as_this_then_throw: true }; diff --git a/src/base/Util.js b/src/base/Util.js index 4c0f6f62..2668f32b 100644 --- a/src/base/Util.js +++ b/src/base/Util.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "./DetailedError.js" /** * Miscellaneous utility methods. diff --git a/src/browser/Clipboard.js b/src/browser/Clipboard.js index 815b571c..7713b57c 100644 --- a/src/browser/Clipboard.js +++ b/src/browser/Clipboard.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * @param {!HTMLElement} element diff --git a/src/browser/EventUtil.js b/src/browser/EventUtil.js index ab7c843f..678364c3 100644 --- a/src/browser/EventUtil.js +++ b/src/browser/EventUtil.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Observable} from "src/base/Obs.js" +import {Observable} from "../base/Obs.js" /** * @param {!HTMLInputElement} textBox diff --git a/src/browser/HistoryPusher.js b/src/browser/HistoryPusher.js index 8b699175..ef2eb017 100644 --- a/src/browser/HistoryPusher.js +++ b/src/browser/HistoryPusher.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {DetailedError} from "src/base/DetailedError.js" +import {DetailedError} from "../base/DetailedError.js" /** * Manages interactions with the browser's history as the app's state changes and frequently updates the URL. diff --git a/src/browser/MouseWatcher.js b/src/browser/MouseWatcher.js index 5e2fe8a8..991e7744 100644 --- a/src/browser/MouseWatcher.js +++ b/src/browser/MouseWatcher.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {Point} from "src/math/Point.js" +/** + * Copyright 2017 Google 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. + */ + +import {Point} from "../math/Point.js" const ALLOW_REGRAB_WATCHDOG_TIME_MS = 5000; const MOUSE_ID = "mouse!"; diff --git a/src/browser/Polyfills.js b/src/browser/Polyfills.js index c5906507..c7b46870 100644 --- a/src/browser/Polyfills.js +++ b/src/browser/Polyfills.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ // Several browsers (IE, Safari, Samsung) don't implement slice. Float32Array.prototype.slice = Float32Array.prototype.slice || function(a, b) { diff --git a/src/browser/SaveFile.js b/src/browser/SaveFile.js index 4cc74208..1f4fe8a5 100644 --- a/src/browser/SaveFile.js +++ b/src/browser/SaveFile.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * @param {!string} name diff --git a/src/browser/TouchScrollBlocker.js b/src/browser/TouchScrollBlocker.js index f12ff52c..feea8182 100644 --- a/src/browser/TouchScrollBlocker.js +++ b/src/browser/TouchScrollBlocker.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Rect} from "src/math/Rect.js" +import {Rect} from "../math/Rect.js" class TouchScrollBlocker { /** diff --git a/src/circuit/CircuitComputeUtil.js b/src/circuit/CircuitComputeUtil.js index b93af72a..12a1a1d7 100644 --- a/src/circuit/CircuitComputeUtil.js +++ b/src/circuit/CircuitComputeUtil.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. - -import {CircuitEvalContext} from "src/circuit/CircuitEvalContext.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {DetailedError} from "src/base/DetailedError.js" -import {KetTextureUtil} from "src/circuit/KetTextureUtil.js" -import {Controls} from "src/circuit/Controls.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {Gates} from "src/gates/AllGates.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitEvalContext} from "./CircuitEvalContext.js" +import {CircuitShaders} from "./CircuitShaders.js" +import {DetailedError} from "../base/DetailedError.js" +import {KetTextureUtil} from "./KetTextureUtil.js" +import {Controls} from "./Controls.js" +import {GateBuilder} from "./Gate.js" +import {Gates} from "../gates/AllGates.js" +import {Util} from "../base/Util.js" /** * @param {!GateBuilder} builder diff --git a/src/circuit/CircuitDefinition.js b/src/circuit/CircuitDefinition.js index 085a0064..4cf292e2 100644 --- a/src/circuit/CircuitDefinition.js +++ b/src/circuit/CircuitDefinition.js @@ -1,30 +1,32 @@ -// Copyright 2017 Google 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. - -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Config} from "src/Config.js" -import {Controls} from "src/circuit/Controls.js" -import {CustomGateSet} from "src/circuit/CustomGateSet.js" -import {DetailedError} from "src/base/DetailedError.js" -import {equate_Maps} from "src/base/Equate.js"; -import {Gate} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {Gates, INITIAL_STATES_TO_GATES} from "src/gates/AllGates.js" -import {Point} from "src/math/Point.js" -import {seq, Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitShaders} from "./CircuitShaders.js" +import {Config} from "../Config.js" +import {Controls} from "./Controls.js" +import {CustomGateSet} from "./CustomGateSet.js" +import {DetailedError} from "../base/DetailedError.js" +import {equate_Maps} from "../base/Equate.js"; +import {Gate} from "./Gate.js" +import {GateColumn} from "./GateColumn.js" +import {GateShaders} from "./GateShaders.js" +import {Gates, INITIAL_STATES_TO_GATES} from "../gates/AllGates.js" +import {Point} from "../math/Point.js" +import {seq, Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" /** * Defines a circuit layout, with wires and columns and gates. diff --git a/src/circuit/CircuitEvalContext.js b/src/circuit/CircuitEvalContext.js index 7583e5f1..d4d67bcc 100644 --- a/src/circuit/CircuitEvalContext.js +++ b/src/circuit/CircuitEvalContext.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" /** * Values used by the various gate effects. diff --git a/src/circuit/CircuitShaders.js b/src/circuit/CircuitShaders.js index a5031e3f..798a73a5 100644 --- a/src/circuit/CircuitShaders.js +++ b/src/circuit/CircuitShaders.js @@ -1,30 +1,32 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {Controls} from "src/circuit/Controls.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {Controls} from "./Controls.js" +import {ketArgs, ketShaderPermute} from "./KetShaderUtil.js" +import {Shaders} from "../webgl/Shaders.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" import { currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode, Inputs, Outputs -} from "src/webgl/ShaderCoders.js" +} from "../webgl/ShaderCoders.js" /** * Defines operations used to initialize, advance, and inspect quantum states stored in WebGL textures. diff --git a/src/circuit/CircuitStats.js b/src/circuit/CircuitStats.js index a886feff..ce1bbb87 100644 --- a/src/circuit/CircuitStats.js +++ b/src/circuit/CircuitStats.js @@ -1,31 +1,33 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitEvalContext} from "src/circuit/CircuitEvalContext.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {KetTextureUtil} from "src/circuit/KetTextureUtil.js" -import {Controls} from "src/circuit/Controls.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Matrix, complexVectorToReadableJson} from "src/math/Matrix.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Serializer} from "src/circuit/Serializer.js" -import {Util} from "src/base/Util.js" -import {notifyAboutRecoveryFromUnexpectedError} from "src/fallback.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" -import {currentShaderCoder} from "src/webgl/ShaderCoders.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +import {CircuitDefinition} from "./CircuitDefinition.js" +import {CircuitEvalContext} from "./CircuitEvalContext.js" +import {CircuitShaders} from "./CircuitShaders.js" +import {KetTextureUtil} from "./KetTextureUtil.js" +import {Controls} from "./Controls.js" +import {DetailedError} from "../base/DetailedError.js" +import {Matrix, complexVectorToReadableJson} from "../math/Matrix.js" +import {Shaders} from "../webgl/Shaders.js" +import {Serializer} from "./Serializer.js" +import {Util} from "../base/Util.js" +import {notifyAboutRecoveryFromUnexpectedError} from "../fallback.js" +import {advanceStateWithCircuit} from "./CircuitComputeUtil.js" +import {currentShaderCoder} from "../webgl/ShaderCoders.js" +import {WglTextureTrader} from "../webgl/WglTextureTrader.js" class CircuitStats { /** diff --git a/src/circuit/Controls.js b/src/circuit/Controls.js index aad76e26..b5aada6e 100644 --- a/src/circuit/Controls.js +++ b/src/circuit/Controls.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {DetailedError} from "src/base/DetailedError.js" -import {Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +import {DetailedError} from "../base/DetailedError.js" +import {Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" /** * Stores a set of requirements that a state's bits must meet. diff --git a/src/circuit/CustomGateSet.js b/src/circuit/CustomGateSet.js index 0b82704d..82149bc2 100644 --- a/src/circuit/CustomGateSet.js +++ b/src/circuit/CustomGateSet.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {DetailedError} from "src/base/DetailedError.js" +import {DetailedError} from "../base/DetailedError.js" class CustomGateSet { /** diff --git a/src/circuit/Gate.js b/src/circuit/Gate.js index 526cc474..6b42708b 100644 --- a/src/circuit/Gate.js +++ b/src/circuit/Gate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {GateDrawParams} from "src/draw/GateDrawParams.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {GateDrawParams} from "../draw/GateDrawParams.js" +import {Complex} from "../math/Complex.js" +import {Matrix} from "../math/Matrix.js" /** * Describes a quantum operation that may vary with time. diff --git a/src/circuit/GateCheckArgs.js b/src/circuit/GateCheckArgs.js index 6782f4c5..3d394316 100644 --- a/src/circuit/GateCheckArgs.js +++ b/src/circuit/GateCheckArgs.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Values used by gate disable reason finder functions. diff --git a/src/circuit/GateColumn.js b/src/circuit/GateColumn.js index d7ecf18e..3530d124 100644 --- a/src/circuit/GateColumn.js +++ b/src/circuit/GateColumn.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {Gate} from "src/circuit/Gate.js" -import {GateCheckArgs} from "src/circuit/GateCheckArgs.js" -import {Gates} from "src/gates/AllGates.js" -import {seq, Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {Gate} from "./Gate.js" +import {GateCheckArgs} from "./GateCheckArgs.js" +import {Gates} from "../gates/AllGates.js" +import {seq, Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" /** * A column of gates in a circuit with many qubits. diff --git a/src/circuit/GateShaders.js b/src/circuit/GateShaders.js index 9835acf9..86f83069 100644 --- a/src/circuit/GateShaders.js +++ b/src/circuit/GateShaders.js @@ -1,30 +1,32 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {DetailedError} from "src/base/DetailedError.js" -import {ketArgs, ketShader} from "src/circuit/KetShaderUtil.js" -import {Matrix} from "src/math/Matrix.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {DetailedError} from "../base/DetailedError.js" +import {ketArgs, ketShader} from "./KetShaderUtil.js" +import {Matrix} from "../math/Matrix.js" +import {Shaders} from "../webgl/Shaders.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" import { Inputs, Outputs, currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" +} from "../webgl/ShaderCoders.js" /** * Defines operations used by gates to operate on textures representing superpositions. diff --git a/src/circuit/KetShaderUtil.js b/src/circuit/KetShaderUtil.js index 2bd0d981..938c5dc6 100644 --- a/src/circuit/KetShaderUtil.js +++ b/src/circuit/KetShaderUtil.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {WglArg} from "src/webgl/WglArg.js" -import {makePseudoShaderWithInputsAndOutputAndCode, Inputs, Outputs} from "src/webgl/ShaderCoders.js" +import {WglArg} from "../webgl/WglArg.js" +import {makePseudoShaderWithInputsAndOutputAndCode, Inputs, Outputs} from "../webgl/ShaderCoders.js" /** * Creates a shader for a quantum gate based on a minimalist input like `return cmul(inp(0.0), vec2(0.0, 1.0));`. diff --git a/src/circuit/KetTextureUtil.js b/src/circuit/KetTextureUtil.js index b11ec149..29909b18 100644 --- a/src/circuit/KetTextureUtil.js +++ b/src/circuit/KetTextureUtil.js @@ -1,34 +1,36 @@ -// Copyright 2017 Google 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. - -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Controls} from "src/circuit/Controls.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Matrix} from "src/math/Matrix.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Util} from "src/base/Util.js" -import {WglTexture} from "src/webgl/WglTexture.js" -import {seq, Seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitShaders} from "./CircuitShaders.js" +import {Controls} from "./Controls.js" +import {DetailedError} from "../base/DetailedError.js" +import {Matrix} from "../math/Matrix.js" +import {Shaders} from "../webgl/Shaders.js" +import {Util} from "../base/Util.js" +import {WglTexture} from "../webgl/WglTexture.js" +import {seq, Seq} from "../base/Seq.js" import { outputShaderCoder, currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode, Inputs, Outputs -} from "src/webgl/ShaderCoders.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +} from "../webgl/ShaderCoders.js" +import {WglTexturePool} from "../webgl/WglTexturePool.js" +import {WglTextureTrader} from "../webgl/WglTextureTrader.js" /** * Utilities related to storing and operation on superpositions and other circuit information in WebGL textures. diff --git a/src/circuit/Serializer.js b/src/circuit/Serializer.js index e9d0e3f5..670389c7 100644 --- a/src/circuit/Serializer.js +++ b/src/circuit/Serializer.js @@ -1,33 +1,35 @@ -// Copyright 2017 Google 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. - -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Complex} from "src/math/Complex.js" -import {Config} from "src/Config.js" -import {CustomGateSet} from "src/circuit/CustomGateSet.js" -import {describe} from "src/base/Describe.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Format} from "src/base/Format.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates, INITIAL_STATES_TO_GATES} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" -import {Util} from "src/base/Util.js" -import {notifyAboutRecoveryFromUnexpectedError} from "src/fallback.js" -import {MysteryGateSymbol, MysteryGateMakerWithMatrix} from "src/gates/Joke_MysteryGate.js" -import {seq} from "src/base/Seq.js" -import {setGateBuilderEffectToCircuit} from "src/circuit/CircuitComputeUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitDefinition} from "./CircuitDefinition.js" +import {Complex} from "../math/Complex.js" +import {Config} from "../Config.js" +import {CustomGateSet} from "./CustomGateSet.js" +import {describe} from "../base/Describe.js" +import {DetailedError} from "../base/DetailedError.js" +import {Format} from "../base/Format.js" +import {Gate, GateBuilder} from "./Gate.js" +import {GateColumn} from "./GateColumn.js" +import {Gates, INITIAL_STATES_TO_GATES} from "../gates/AllGates.js" +import {Matrix} from "../math/Matrix.js" +import {Util} from "../base/Util.js" +import {notifyAboutRecoveryFromUnexpectedError} from "../fallback.js" +import {MysteryGateSymbol, MysteryGateMakerWithMatrix} from "../gates/Joke_MysteryGate.js" +import {seq} from "../base/Seq.js" +import {setGateBuilderEffectToCircuit} from "./CircuitComputeUtil.js" /** @type {!function(!GateDrawParams)} */ let matrixDrawer = undefined; diff --git a/src/draw/CachablePainting.js b/src/draw/CachablePainting.js index 929741e8..7adab5d2 100644 --- a/src/draw/CachablePainting.js +++ b/src/draw/CachablePainting.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Painter} from "src/draw/Painter.js" -import {RestartableRng} from "src/base/RestartableRng.js" +import {Painter} from "./Painter.js" +import {RestartableRng} from "../base/RestartableRng.js" const fixedRng = new RestartableRng(); diff --git a/src/draw/GateDrawParams.js b/src/draw/GateDrawParams.js index dc2da6e2..ba965cfc 100644 --- a/src/draw/GateDrawParams.js +++ b/src/draw/GateDrawParams.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Values used by the various gate drawing strategies. diff --git a/src/draw/GatePainting.js b/src/draw/GatePainting.js index 9f1d07cd..859cbebf 100644 --- a/src/draw/GatePainting.js +++ b/src/draw/GatePainting.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {GateDrawParams} from "src/draw/GateDrawParams.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {GateDrawParams} from "./GateDrawParams.js" +import {MathPainter} from "./MathPainter.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {Util} from "../base/Util.js" /** * A described and possibly time-varying quantum operation. diff --git a/src/draw/MathPainter.js b/src/draw/MathPainter.js index 54823876..46a3a8c8 100644 --- a/src/draw/MathPainter.js +++ b/src/draw/MathPainter.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. - -import {Painter} from "src/draw/Painter.js" -import {Format} from "src/base/Format.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {seq, Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" -import {Config} from "src/Config.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" +/** + * Copyright 2017 Google 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. + */ + +import {Painter} from "./Painter.js" +import {Format} from "../base/Format.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {seq, Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" +import {Config} from "../Config.js" +import {Complex} from "../math/Complex.js" +import {Matrix} from "../math/Matrix.js" class MathPainter { static describeProbability(p, fractionalDigits) { diff --git a/src/draw/Painter.js b/src/draw/Painter.js index dded626c..24683665 100644 --- a/src/draw/Painter.js +++ b/src/draw/Painter.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {RestartableRng} from "src/base/RestartableRng.js" -import {seq, Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {RestartableRng} from "../base/RestartableRng.js" +import {seq, Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" class Painter { /** diff --git a/src/draw/WidgetPainter.js b/src/draw/WidgetPainter.js index ba587e4c..dd921214 100644 --- a/src/draw/WidgetPainter.js +++ b/src/draw/WidgetPainter.js @@ -1,29 +1,31 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Complex} from "src/math/Complex.js" -import {Config} from "src/Config.js" -import {Format} from "src/base/Format.js" -import {Gate} from "src/circuit/Gate.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Matrix} from "src/math/Matrix.js" -import {Painter} from "src/draw/Painter.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {Seq} from "src/base/Seq.js" -import {drawCircuitTooltip} from "src/ui/DisplayedCircuit.js" -import {Util} from "src/base/Util.js" +import {Complex} from "../math/Complex.js" +import {Config} from "../Config.js" +import {Format} from "../base/Format.js" +import {Gate} from "../circuit/Gate.js" +import {MathPainter} from "./MathPainter.js" +import {Matrix} from "../math/Matrix.js" +import {Painter} from "./Painter.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {Seq} from "../base/Seq.js" +import {drawCircuitTooltip} from "../ui/DisplayedCircuit.js" +import {Util} from "../base/Util.js" class WidgetPainter { diff --git a/src/fallback.js b/src/fallback.js index 027bdba5..06373a9e 100644 --- a/src/fallback.js +++ b/src/fallback.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {describe} from "src/base/Describe.js" +import {describe} from "./base/Describe.js" /** * @type {!Array.<{regex: !Pattern, handler: !function()}>} diff --git a/src/gates/AllGates.js b/src/gates/AllGates.js index 563758ca..ae8edba5 100644 --- a/src/gates/AllGates.js +++ b/src/gates/AllGates.js @@ -1,66 +1,68 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {ArithmeticGates} from "src/gates/ArithmeticGates.js" -import {AmplitudeDisplayFamily} from "src/gates/AmplitudeDisplay.js" -import {BitCountGates} from "src/gates/BitCountGates.js" -import {BlochSphereDisplay} from "src/gates/BlochSphereDisplay.js" -import {ComparisonGates} from "src/gates/ComparisonGates.js" -import {Controls} from "src/gates/Controls.js" -import {CountingGates} from "src/gates/CountingGates.js" -import {CycleBitsGates} from "src/gates/CycleBitsGates.js" -import {DensityMatrixDisplayFamily} from "src/gates/DensityMatrixDisplay.js" -import {ErrorInjectionGate} from "src/gates/Debug_ErrorInjectionGate.js" -import {ExponentiatingGates} from "src/gates/ExponentiatingGates.js" -import {FourierTransformGates} from "src/gates/FourierTransformGates.js" -import {HalfTurnGates} from "src/gates/HalfTurnGates.js" +import {ArithmeticGates} from "./ArithmeticGates.js" +import {AmplitudeDisplayFamily} from "./AmplitudeDisplay.js" +import {BitCountGates} from "./BitCountGates.js" +import {BlochSphereDisplay} from "./BlochSphereDisplay.js" +import {ComparisonGates} from "./ComparisonGates.js" +import {Controls} from "./Controls.js" +import {CountingGates} from "./CountingGates.js" +import {CycleBitsGates} from "./CycleBitsGates.js" +import {DensityMatrixDisplayFamily} from "./DensityMatrixDisplay.js" +import {ErrorInjectionGate} from "./Debug_ErrorInjectionGate.js" +import {ExponentiatingGates} from "./ExponentiatingGates.js" +import {FourierTransformGates} from "./FourierTransformGates.js" +import {HalfTurnGates} from "./HalfTurnGates.js" import { ImaginaryGate, AntiImaginaryGate, SqrtImaginaryGate, AntiSqrtImaginaryGate -} from "src/gates/Joke_ImaginaryGate.js" -import {IncrementGates} from "src/gates/IncrementGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {InterleaveBitsGates} from "src/gates/InterleaveBitsGates.js" -import {MeasurementGate} from "src/gates/MeasurementGate.js" -import {ModularIncrementGates} from "src/gates/ModularIncrementGates.js" -import {ModularAdditionGates} from "src/gates/ModularAdditionGates.js" -import {ModularMultiplicationGates} from "src/gates/ModularMultiplicationGates.js" -import {ModularMultiplyAccumulateGates} from "src/gates/ModularMultiplyAccumulateGates.js" -import {MultiplicationGates} from "src/gates/MultiplicationGates.js" -import {MultiplyAccumulateGates} from "src/gates/MultiplyAccumulateGates.js" -import {NeGate} from "src/gates/Joke_NeGate.js" -import {ParametrizedRotationGates} from "src/gates/ParametrizedRotationGates.js" -import {PhaseGradientGates} from "src/gates/PhaseGradientGates.js" -import {PivotFlipGates} from "src/gates/PivotFlipGates.js" -import {PostSelectionGates} from "src/gates/PostSelectionGates.js" -import {PoweringGates} from "src/gates/PoweringGates.js" -import {ProbabilityDisplayFamily} from "src/gates/ProbabilityDisplay.js" -import {QuarterTurnGates} from "src/gates/QuarterTurnGates.js" -import {ReverseBitsGateFamily} from "src/gates/ReverseBitsGate.js" -import {SampleDisplayFamily} from "src/gates/SampleDisplay.js" -import {Detectors} from "src/gates/Detector.js" -import {SpacerGate} from "src/gates/SpacerGate.js" -import {SwapGateHalf} from "src/gates/SwapGateHalf.js" -import {UniversalNotGate} from "src/gates/Impossible_UniversalNotGate.js" -import {VariousXGates} from "src/gates/VariousXGates.js" -import {VariousYGates} from "src/gates/VariousYGates.js" -import {VariousZGates} from "src/gates/VariousZGates.js" -import {XorGates} from "src/gates/XorGates.js" -import {ZeroGate} from "src/gates/Joke_ZeroGate.js" -import {seq} from "src/base/Seq.js" +} from "./Joke_ImaginaryGate.js" +import {IncrementGates} from "./IncrementGates.js" +import {InputGates} from "./InputGates.js" +import {InterleaveBitsGates} from "./InterleaveBitsGates.js" +import {MeasurementGate} from "./MeasurementGate.js" +import {ModularIncrementGates} from "./ModularIncrementGates.js" +import {ModularAdditionGates} from "./ModularAdditionGates.js" +import {ModularMultiplicationGates} from "./ModularMultiplicationGates.js" +import {ModularMultiplyAccumulateGates} from "./ModularMultiplyAccumulateGates.js" +import {MultiplicationGates} from "./MultiplicationGates.js" +import {MultiplyAccumulateGates} from "./MultiplyAccumulateGates.js" +import {NeGate} from "./Joke_NeGate.js" +import {ParametrizedRotationGates} from "./ParametrizedRotationGates.js" +import {PhaseGradientGates} from "./PhaseGradientGates.js" +import {PivotFlipGates} from "./PivotFlipGates.js" +import {PostSelectionGates} from "./PostSelectionGates.js" +import {PoweringGates} from "./PoweringGates.js" +import {ProbabilityDisplayFamily} from "./ProbabilityDisplay.js" +import {QuarterTurnGates} from "./QuarterTurnGates.js" +import {ReverseBitsGateFamily} from "./ReverseBitsGate.js" +import {SampleDisplayFamily} from "./SampleDisplay.js" +import {Detectors} from "./Detector.js" +import {SpacerGate} from "./SpacerGate.js" +import {SwapGateHalf} from "./SwapGateHalf.js" +import {UniversalNotGate} from "./Impossible_UniversalNotGate.js" +import {VariousXGates} from "./VariousXGates.js" +import {VariousYGates} from "./VariousYGates.js" +import {VariousZGates} from "./VariousZGates.js" +import {XorGates} from "./XorGates.js" +import {ZeroGate} from "./Joke_ZeroGate.js" +import {seq} from "../base/Seq.js" let Gates = {}; diff --git a/src/gates/AmplitudeDisplay.js b/src/gates/AmplitudeDisplay.js index 862166c9..ec774599 100644 --- a/src/gates/AmplitudeDisplay.js +++ b/src/gates/AmplitudeDisplay.js @@ -1,38 +1,40 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {Format} from "src/base/Format.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Matrix, complexVectorToReadableJson, realVectorToReadableJson} from "src/math/Matrix.js" -import {probabilityStatTexture} from "src/gates/ProbabilityDisplay.js" -import {Point} from "src/math/Point.js" -import {Util} from "src/base/Util.js" -import {Shaders} from "src/webgl/Shaders.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {Config} from "../Config.js" +import {CircuitShaders} from "../circuit/CircuitShaders.js" +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {GateShaders} from "../circuit/GateShaders.js" +import {Format} from "../base/Format.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Matrix, complexVectorToReadableJson, realVectorToReadableJson} from "../math/Matrix.js" +import {probabilityStatTexture} from "./ProbabilityDisplay.js" +import {Point} from "../math/Point.js" +import {Util} from "../base/Util.js" +import {Shaders} from "../webgl/Shaders.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" import { Inputs, Outputs, currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +} from "../webgl/ShaderCoders.js" +import {WglTexturePool} from "../webgl/WglTexturePool.js" +import {WglTextureTrader} from "../webgl/WglTextureTrader.js" /** * @param {!WglTexture} stateKet diff --git a/src/gates/ArithmeticGates.js b/src/gates/ArithmeticGates.js index e301f477..6d04a890 100644 --- a/src/gates/ArithmeticGates.js +++ b/src/gates/ArithmeticGates.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {WglArg} from "../webgl/WglArg.js" let ArithmeticGates = {}; diff --git a/src/gates/BitCountGates.js b/src/gates/BitCountGates.js index d378e716..fc9b381b 100644 --- a/src/gates/BitCountGates.js +++ b/src/gates/BitCountGates.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" let BitCountGates = {}; diff --git a/src/gates/BlochSphereDisplay.js b/src/gates/BlochSphereDisplay.js index 402f2591..f0079f96 100644 --- a/src/gates/BlochSphereDisplay.js +++ b/src/gates/BlochSphereDisplay.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Point} from "src/math/Point.js" +import {Config} from "../Config.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Point} from "../math/Point.js" /** * @param {!Painter} painter diff --git a/src/gates/ComparisonGates.js b/src/gates/ComparisonGates.js index 111755ff..7a5a18e6 100644 --- a/src/gates/ComparisonGates.js +++ b/src/gates/ComparisonGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {GateBuilder} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" let ComparisonGates = {}; diff --git a/src/gates/Controls.js b/src/gates/Controls.js index 3c4539f0..6becf89b 100644 --- a/src/gates/Controls.js +++ b/src/gates/Controls.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {HalfTurnGates} from "src/gates/HalfTurnGates.js" -import {QuarterTurnGates} from "src/gates/QuarterTurnGates.js" -import {Config} from "src/Config.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js"; -import {WglArg} from "src/webgl/WglArg.js"; -import {Util} from "src/base/Util.js"; +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {GateShaders} from "../circuit/GateShaders.js" +import {HalfTurnGates} from "./HalfTurnGates.js" +import {QuarterTurnGates} from "./QuarterTurnGates.js" +import {Config} from "../Config.js" +import {ketArgs, ketShaderPermute} from "../circuit/KetShaderUtil.js"; +import {WglArg} from "../webgl/WglArg.js"; +import {Util} from "../base/Util.js"; let Controls = {}; diff --git a/src/gates/CountingGates.js b/src/gates/CountingGates.js index b1c339e8..60cbcceb 100644 --- a/src/gates/CountingGates.js +++ b/src/gates/CountingGates.js @@ -1,27 +1,29 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {ketArgs} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" - -import {offsetShader} from "src/gates/IncrementGates.js" -import {makeCycleBitsPermutation, cycleBitsShader} from "src/gates/CycleBitsGates.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" +import {Point} from "../math/Point.js" +import {ketArgs} from "../circuit/KetShaderUtil.js" +import {WglArg} from "../webgl/WglArg.js" + +import {offsetShader} from "./IncrementGates.js" +import {makeCycleBitsPermutation, cycleBitsShader} from "./CycleBitsGates.js" let CountingGates = {}; diff --git a/src/gates/CycleBitsGates.js b/src/gates/CycleBitsGates.js index a44fe2d9..dd92d9fd 100644 --- a/src/gates/CycleBitsGates.js +++ b/src/gates/CycleBitsGates.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {ketArgs, ketShaderPermute} from "../circuit/KetShaderUtil.js" +import {Matrix} from "../math/Matrix.js" +import {Point} from "../math/Point.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" let CycleBitsGates = {}; diff --git a/src/gates/Debug_ErrorInjectionGate.js b/src/gates/Debug_ErrorInjectionGate.js index 794fcecd..e831142b 100644 --- a/src/gates/Debug_ErrorInjectionGate.js +++ b/src/gates/Debug_ErrorInjectionGate.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {DetailedError} from "src/base/DetailedError.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" +import {DetailedError} from "../base/DetailedError.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" let ErrorInjectionGate = new GateBuilder(). setSerializedId("__error__"). diff --git a/src/gates/DensityMatrixDisplay.js b/src/gates/DensityMatrixDisplay.js index 78ffb2c3..20ca847b 100644 --- a/src/gates/DensityMatrixDisplay.js +++ b/src/gates/DensityMatrixDisplay.js @@ -1,35 +1,37 @@ -// Copyright 2017 Google 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. - -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Matrix} from "src/math/Matrix.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitShaders} from "../circuit/CircuitShaders.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {GateShaders} from "../circuit/GateShaders.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Matrix} from "../math/Matrix.js" +import {Shaders} from "../webgl/Shaders.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" import { Inputs, Outputs, currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +} from "../webgl/ShaderCoders.js" +import {WglTexturePool} from "../webgl/WglTexturePool.js" +import {WglTextureTrader} from "../webgl/WglTextureTrader.js" /** * @param {!WglTexture} inp diff --git a/src/gates/Detector.js b/src/gates/Detector.js index 53fa70eb..fbb7a373 100644 --- a/src/gates/Detector.js +++ b/src/gates/Detector.js @@ -1,35 +1,37 @@ -// Copyright 2017 Google 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. - -import {GateBuilder} from 'src/circuit/Gate.js' -import {amplitudesToProbabilities} from 'src/gates/ProbabilityDisplay.js' -import {WglTexturePool} from 'src/webgl/WglTexturePool.js'; -import {WglTextureTrader} from 'src/webgl/WglTextureTrader.js'; -import {Shaders} from 'src/webgl/Shaders.js' -import {currentShaderCoder, Inputs} from 'src/webgl/ShaderCoders.js'; -import {CircuitShaders} from 'src/circuit/CircuitShaders.js' -import {Controls} from 'src/circuit/Controls.js'; -import {WglArg} from 'src/webgl/WglArg.js'; -import {Config} from 'src/Config.js' -import {GatePainting} from 'src/draw/GatePainting.js' -import {makePseudoShaderWithInputsAndOutputAndCode, Outputs} from 'src/webgl/ShaderCoders.js'; -import {Matrix} from "src/math/Matrix.js"; -import {GateShaders} from "src/circuit/GateShaders.js"; -import {Point} from "src/math/Point.js"; -import {DetailedError} from "src/base/DetailedError.js"; -import {QuarterTurnGates} from "src/gates/QuarterTurnGates.js"; -import {HalfTurnGates} from "src/gates/HalfTurnGates.js"; +/** + * Copyright 2017 Google 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. + */ + +import {GateBuilder} from "../circuit/Gate.js" +import {amplitudesToProbabilities} from "../gates/ProbabilityDisplay.js" +import {WglTexturePool} from "../webgl/WglTexturePool.js"; +import {WglTextureTrader} from "../webgl/WglTextureTrader.js"; +import {Shaders} from "../webgl/Shaders.js" +import {currentShaderCoder, Inputs} from "../webgl/ShaderCoders.js"; +import {CircuitShaders} from "../circuit/CircuitShaders.js" +import {Controls} from "../circuit/Controls.js"; +import {WglArg} from "../webgl/WglArg.js"; +import {Config} from "../Config.js" +import {GatePainting} from "../draw/GatePainting.js" +import {makePseudoShaderWithInputsAndOutputAndCode, Outputs} from "../webgl/ShaderCoders.js"; +import {Matrix} from "../math/Matrix.js"; +import {GateShaders} from "../circuit/GateShaders.js"; +import {Point} from "../math/Point.js"; +import {DetailedError} from "../base/DetailedError.js"; +import {QuarterTurnGates} from "./QuarterTurnGates.js"; +import {HalfTurnGates} from "./HalfTurnGates.js"; /** * @param {!CircuitEvalContext} ctx diff --git a/src/gates/ExponentiatingGates.js b/src/gates/ExponentiatingGates.js index 12b5f425..22814d56 100644 --- a/src/gates/ExponentiatingGates.js +++ b/src/gates/ExponentiatingGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" let ExponentiatingGates = {}; diff --git a/src/gates/FourierTransformGates.js b/src/gates/FourierTransformGates.js index ab8af4be..f10f7ef6 100644 --- a/src/gates/FourierTransformGates.js +++ b/src/gates/FourierTransformGates.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Complex} from "src/math/Complex.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPhase} from "src/circuit/KetShaderUtil.js" -import {Matrix} from "src/math/Matrix.js" -import {HalfTurnGates} from "src/gates/HalfTurnGates.js" -import {reverseShaderForSize} from "src/gates/ReverseBitsGate.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Complex} from "../math/Complex.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPhase} from "../circuit/KetShaderUtil.js" +import {Matrix} from "../math/Matrix.js" +import {HalfTurnGates} from "./HalfTurnGates.js" +import {reverseShaderForSize} from "./ReverseBitsGate.js" +import {WglArg} from "../webgl/WglArg.js" /** * @param {!CircuitEvalContext} ctx diff --git a/src/gates/HalfTurnGates.js b/src/gates/HalfTurnGates.js index 43e57ca3..aa1271ec 100644 --- a/src/gates/HalfTurnGates.js +++ b/src/gates/HalfTurnGates.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {ketArgs, ketShader, ketShaderPermute} from "src/circuit/KetShaderUtil.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" +import {Point} from "../math/Point.js" +import {ketArgs, ketShader, ketShaderPermute} from "../circuit/KetShaderUtil.js" /** * Gates that correspond to 180 degree rotations around the Bloch sphere, so they're their own inverses. diff --git a/src/gates/Impossible_UniversalNotGate.js b/src/gates/Impossible_UniversalNotGate.js index 490ce905..db0fb9b1 100644 --- a/src/gates/Impossible_UniversalNotGate.js +++ b/src/gates/Impossible_UniversalNotGate.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {ketArgs, ketShader} from "src/circuit/KetShaderUtil.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {GateBuilder} from "../circuit/Gate.js" +import {ketArgs, ketShader} from "../circuit/KetShaderUtil.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" /** * @param {!CircuitEvalContext} ctx diff --git a/src/gates/IncrementGates.js b/src/gates/IncrementGates.js index b1bba2c3..adbc3b55 100644 --- a/src/gates/IncrementGates.js +++ b/src/gates/IncrementGates.js @@ -1,6 +1,22 @@ -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" +/** + * Copyright 2017 Google 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. + */ + +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute} from "../circuit//KetShaderUtil.js" +import {WglArg} from "../webgl/WglArg.js" let IncrementGates = {}; diff --git a/src/gates/InputGates.js b/src/gates/InputGates.js index 7a097d20..2edead05 100644 --- a/src/gates/InputGates.js +++ b/src/gates/InputGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {reverseShaderForSize} from "src/gates/ReverseBitsGate.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {reverseShaderForSize} from "./ReverseBitsGate.js" let InputGates = {}; diff --git a/src/gates/InterleaveBitsGates.js b/src/gates/InterleaveBitsGates.js index 5d006d0a..90c12da4 100644 --- a/src/gates/InterleaveBitsGates.js +++ b/src/gates/InterleaveBitsGates.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Point} from "src/math/Point.js" -import {Seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute} from "../circuit/KetShaderUtil.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Point} from "../math/Point.js" +import {Seq} from "../base/Seq.js" let InterleaveBitsGates = {}; diff --git a/src/gates/Joke_ImaginaryGate.js b/src/gates/Joke_ImaginaryGate.js index 37f5c26d..d5e4585c 100644 --- a/src/gates/Joke_ImaginaryGate.js +++ b/src/gates/Joke_ImaginaryGate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" -import {Complex} from "src/math/Complex.js" -import {GatePainting} from "src/draw/GatePainting.js" +import {GateBuilder} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" +import {Complex} from "../math/Complex.js" +import {GatePainting} from "../draw/GatePainting.js" const ImaginaryGate = new GateBuilder(). setSerializedIdAndSymbol("i"). diff --git a/src/gates/Joke_MysteryGate.js b/src/gates/Joke_MysteryGate.js index fc68003a..8cd73ce4 100644 --- a/src/gates/Joke_MysteryGate.js +++ b/src/gates/Joke_MysteryGate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Complex} from "src/math/Complex.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" +import {Complex} from "../math/Complex.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" let MysteryGateSymbol = "?"; diff --git a/src/gates/Joke_NeGate.js b/src/gates/Joke_NeGate.js index 308c444a..93e69180 100644 --- a/src/gates/Joke_NeGate.js +++ b/src/gates/Joke_NeGate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {GatePainting} from "src/draw/GatePainting.js" +import {GateBuilder} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" +import {Point} from "../math/Point.js" +import {GatePainting} from "../draw/GatePainting.js" const NeGate = new GateBuilder(). setSerializedId("NeGate"). diff --git a/src/gates/Joke_ZeroGate.js b/src/gates/Joke_ZeroGate.js index e5b47bb0..c14ac2b3 100644 --- a/src/gates/Joke_ZeroGate.js +++ b/src/gates/Joke_ZeroGate.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" /** @type {!Gate} */ const ZeroGate = new GateBuilder(). diff --git a/src/gates/MeasurementGate.js b/src/gates/MeasurementGate.js index 318aa016..0266cbaa 100644 --- a/src/gates/MeasurementGate.js +++ b/src/gates/MeasurementGate.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" +import {Config} from "../Config.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" /** * @param {!GateDrawParams} args diff --git a/src/gates/ModularAdditionGates.js b/src/gates/ModularAdditionGates.js index 1b7a998a..52f5d05d 100644 --- a/src/gates/ModularAdditionGates.js +++ b/src/gates/ModularAdditionGates.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" -import {modulusTooBigChecker} from "src/gates/ModularIncrementGates.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" +import {modulusTooBigChecker} from "./ModularIncrementGates.js" let ModularAdditionGates = {}; diff --git a/src/gates/ModularIncrementGates.js b/src/gates/ModularIncrementGates.js index d0d40888..749dbcf0 100644 --- a/src/gates/ModularIncrementGates.js +++ b/src/gates/ModularIncrementGates.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" let ModularIncrementGates = {}; diff --git a/src/gates/ModularMultiplicationGates.js b/src/gates/ModularMultiplicationGates.js index f4c6baf5..c00fc2b9 100644 --- a/src/gates/ModularMultiplicationGates.js +++ b/src/gates/ModularMultiplicationGates.js @@ -1,28 +1,30 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js"; -import {Gate} from "src/circuit/Gate.js" +import {Config} from "../Config.js"; +import {Gate} from "../circuit/Gate.js" import { ketArgs, ketShaderPermute, ketInputGateShaderCode -} from "src/circuit/KetShaderUtil.js" -import {modulusTooBigChecker} from "src/gates/ModularIncrementGates.js" -import {BIG_MUL_MOD_SHADER_CODE} from "src/gates/MultiplyAccumulateGates.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" +} from "../circuit/KetShaderUtil.js" +import {modulusTooBigChecker} from "./ModularIncrementGates.js" +import {BIG_MUL_MOD_SHADER_CODE} from "./MultiplyAccumulateGates.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" let ModularMultiplicationGates = {}; diff --git a/src/gates/ModularMultiplyAccumulateGates.js b/src/gates/ModularMultiplyAccumulateGates.js index 2c9d4c2f..e1c46c36 100644 --- a/src/gates/ModularMultiplyAccumulateGates.js +++ b/src/gates/ModularMultiplyAccumulateGates.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {BIG_MUL_MOD_SHADER_CODE} from "src/gates/MultiplyAccumulateGates.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {modulusTooBigChecker} from "src/gates/ModularIncrementGates.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" +import {BIG_MUL_MOD_SHADER_CODE} from "./MultiplyAccumulateGates.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {modulusTooBigChecker} from "./ModularIncrementGates.js" +import {Util} from "../base/Util.js" +import {WglArg} from "../webgl/WglArg.js" let ModularMultiplyAccumulateGates = {}; diff --git a/src/gates/MultiplicationGates.js b/src/gates/MultiplicationGates.js index 6406bb52..d1d8dab7 100644 --- a/src/gates/MultiplicationGates.js +++ b/src/gates/MultiplicationGates.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" import { modularMultiply, modularUnmultiply, MODULAR_INVERSE_SHADER_CODE -} from "src/gates/ModularMultiplicationGates.js" +} from "./ModularMultiplicationGates.js" let MultiplicationGates = {}; diff --git a/src/gates/MultiplyAccumulateGates.js b/src/gates/MultiplyAccumulateGates.js index 51c5c1c1..805c7c3f 100644 --- a/src/gates/MultiplyAccumulateGates.js +++ b/src/gates/MultiplyAccumulateGates.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js"; -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Config} from "../Config.js"; +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {WglArg} from "../webgl/WglArg.js" let MultiplyAccumulateGates = {}; diff --git a/src/gates/ParametrizedRotationGates.js b/src/gates/ParametrizedRotationGates.js index 9c2eddbb..1b4beebc 100644 --- a/src/gates/ParametrizedRotationGates.js +++ b/src/gates/ParametrizedRotationGates.js @@ -1,27 +1,29 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Complex, PARSE_COMPLEX_TOKEN_MAP_RAD} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" -import {ketArgs, ketShader, ketShaderPhase, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" -import {Util} from "src/base/Util.js"; -import {parseFormula} from "src/math/FormulaParser.js"; -import {XExp, YExp, ZExp} from "src/gates/ExponentiatingGates.js"; -import {Config} from "src/Config.js"; +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Complex, PARSE_COMPLEX_TOKEN_MAP_RAD} from "../math/Complex.js" +import {Matrix} from "../math/Matrix.js" +import {ketArgs, ketShader, ketShaderPhase, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {WglArg} from "../webgl/WglArg.js" +import {Util} from "../base/Util.js"; +import {parseFormula} from "../math/FormulaParser.js"; +import {XExp, YExp, ZExp} from "./ExponentiatingGates.js"; +import {Config} from "../Config.js"; let ParametrizedRotationGates = {}; diff --git a/src/gates/PhaseGradientGates.js b/src/gates/PhaseGradientGates.js index 9a903d20..2e46b0cd 100644 --- a/src/gates/PhaseGradientGates.js +++ b/src/gates/PhaseGradientGates.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js"; -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {ketArgs, ketShaderPhase} from "src/circuit/KetShaderUtil.js" -import {MUL_STEP} from "src/gates/MultiplyAccumulateGates.js" -import {WglArg} from "src/webgl/WglArg.js" -import {Matrix} from "src/math/Matrix.js"; -import {Complex} from "src/math/Complex.js"; +import {Config} from "../Config.js"; +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {ketArgs, ketShaderPhase} from "../circuit/KetShaderUtil.js" +import {MUL_STEP} from "./MultiplyAccumulateGates.js" +import {WglArg} from "../webgl/WglArg.js" +import {Matrix} from "../math/Matrix.js"; +import {Complex} from "../math/Complex.js"; const PHASE_GRADIENT_SHADER = ketShaderPhase( ` diff --git a/src/gates/PivotFlipGates.js b/src/gates/PivotFlipGates.js index c6cb9829..ed616427 100644 --- a/src/gates/PivotFlipGates.js +++ b/src/gates/PivotFlipGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from 'src/circuit/Gate.js' -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from 'src/circuit/KetShaderUtil.js' -import {modulusTooBigChecker} from 'src/gates/ModularIncrementGates.js' +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" +import {modulusTooBigChecker} from "./ModularIncrementGates.js" let PivotFlipGates = {}; diff --git a/src/gates/PostSelectionGates.js b/src/gates/PostSelectionGates.js index e8061753..3cf51610 100644 --- a/src/gates/PostSelectionGates.js +++ b/src/gates/PostSelectionGates.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Complex} from "src/math/Complex.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" +import {Complex} from "../math/Complex.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" let PostSelectionGates = {}; diff --git a/src/gates/PoweringGates.js b/src/gates/PoweringGates.js index 2c39593d..04518d73 100644 --- a/src/gates/PoweringGates.js +++ b/src/gates/PoweringGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" let PoweringGates = {}; diff --git a/src/gates/ProbabilityDisplay.js b/src/gates/ProbabilityDisplay.js index cc47b9cb..68a8a5e0 100644 --- a/src/gates/ProbabilityDisplay.js +++ b/src/gates/ProbabilityDisplay.js @@ -1,38 +1,40 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Complex} from "src/math/Complex.js" -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {Seq} from "src/base/Seq.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Util} from "src/base/Util.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {Complex} from "../math/Complex.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {GateShaders} from "../circuit/GateShaders.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Matrix} from "../math/Matrix.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {Seq} from "../base/Seq.js" +import {Shaders} from "../webgl/Shaders.js" +import {Util} from "../base/Util.js" +import {WglConfiguredShader} from "../webgl/WglConfiguredShader.js" import { Inputs, Outputs, currentShaderCoder, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +} from "../webgl/ShaderCoders.js" +import {WglTexturePool} from "../webgl/WglTexturePool.js" +import {WglTextureTrader} from "../webgl/WglTextureTrader.js" /** * Derives conditional computational basis measurement probabilities from the state vector. diff --git a/src/gates/QuarterTurnGates.js b/src/gates/QuarterTurnGates.js index c076ce56..614b389b 100644 --- a/src/gates/QuarterTurnGates.js +++ b/src/gates/QuarterTurnGates.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" let QuarterTurnGates = {}; diff --git a/src/gates/ReverseBitsGate.js b/src/gates/ReverseBitsGate.js index fee1eafa..26fe46d0 100644 --- a/src/gates/ReverseBitsGate.js +++ b/src/gates/ReverseBitsGate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute} from "src/circuit/KetShaderUtil.js" -import {Seq} from "src/base/Seq.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute} from "../circuit/KetShaderUtil.js" +import {Seq} from "../base/Seq.js" let _generateReverseShaderForSize = span => span < 2 ? undefined : ketShaderPermute( '', diff --git a/src/gates/SampleDisplay.js b/src/gates/SampleDisplay.js index d18ab4d4..23996a5c 100644 --- a/src/gates/SampleDisplay.js +++ b/src/gates/SampleDisplay.js @@ -1,29 +1,31 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {Util} from "src/base/Util.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {Util} from "../base/Util.js" import { probabilityStatTexture, probabilityPixelsToColumnVector, probabilityDataToJson -} from "src/gates/ProbabilityDisplay.js" +} from "./ProbabilityDisplay.js" /** * Looks up the simulated probability distribution and samples from it using the current graphics PRNG. diff --git a/src/gates/SpacerGate.js b/src/gates/SpacerGate.js index a6f3c0a7..3e2e540f 100644 --- a/src/gates/SpacerGate.js +++ b/src/gates/SpacerGate.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Rect} from "src/math/Rect.js" +import {Config} from "../Config.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Rect} from "../math/Rect.js" let SpacerGate = new GateBuilder(). setSerializedIdAndSymbol("…"). diff --git a/src/gates/SwapGateHalf.js b/src/gates/SwapGateHalf.js index 216b794b..f3bda9c1 100644 --- a/src/gates/SwapGateHalf.js +++ b/src/gates/SwapGateHalf.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {GateBuilder} from "src/circuit/Gate.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Matrix} from "src/math/Matrix.js" -import {Rect} from "src/math/Rect.js" -import {Seq} from "src/base/Seq.js" +import {GateBuilder} from "../circuit/Gate.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Matrix} from "../math/Matrix.js" +import {Rect} from "../math/Rect.js" +import {Seq} from "../base/Seq.js" // Note: there is special code to handle swaps sprinkled everywhere, since it's the only gate with two paired sides. diff --git a/src/gates/VariousXGates.js b/src/gates/VariousXGates.js index f8eb5d55..b999d02a 100644 --- a/src/gates/VariousXGates.js +++ b/src/gates/VariousXGates.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" +import {Gate} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" let VariousXGates = {}; diff --git a/src/gates/VariousYGates.js b/src/gates/VariousYGates.js index bbf0b0b6..2d41b3d6 100644 --- a/src/gates/VariousYGates.js +++ b/src/gates/VariousYGates.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" +import {Gate} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" let VariousYGates = {}; diff --git a/src/gates/VariousZGates.js b/src/gates/VariousZGates.js index d131109d..ca601650 100644 --- a/src/gates/VariousZGates.js +++ b/src/gates/VariousZGates.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Gate} from "src/circuit/Gate.js" -import {Matrix} from "src/math/Matrix.js" +import {Gate} from "../circuit/Gate.js" +import {Matrix} from "../math/Matrix.js" let VariousZGates = {}; diff --git a/src/gates/XorGates.js b/src/gates/XorGates.js index e1909abd..71cad320 100644 --- a/src/gates/XorGates.js +++ b/src/gates/XorGates.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {Gate} from "src/circuit/Gate.js" -import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "src/circuit/KetShaderUtil.js" +import {Config} from "../Config.js" +import {Gate} from "../circuit/Gate.js" +import {ketArgs, ketShaderPermute, ketInputGateShaderCode} from "../circuit/KetShaderUtil.js" let XorGates = {}; diff --git a/src/issues.js b/src/issues.js index 70e77c9d..9e799161 100644 --- a/src/issues.js +++ b/src/issues.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {notifyAboutKnownIssue} from "src/fallback.js" +import {notifyAboutKnownIssue} from "./fallback.js" let canvasCreatedForTesting = document.createElement('canvas'); let webglContextCreatedForTesting = canvasCreatedForTesting.getContext('webgl') || diff --git a/src/main.js b/src/main.js index f0d2e2ab..6be15798 100644 --- a/src/main.js +++ b/src/main.js @@ -1,50 +1,52 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ // It's important that the polyfills and error fallback get loaded first! -import {} from "src/browser/Polyfills.js" -import {hookErrorHandler} from "src/fallback.js" +import {} from "./browser/Polyfills.js" +import {hookErrorHandler} from "./fallback.js" hookErrorHandler(); -import {doDetectIssues} from "src/issues.js" +import {doDetectIssues} from "./issues.js" doDetectIssues(); -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {CooldownThrottle} from "src/base/CooldownThrottle.js" -import {Config} from "src/Config.js" -import {DisplayedInspector} from "src/ui/DisplayedInspector.js" -import {Painter} from "src/draw/Painter.js" -import {Rect} from "src/math/Rect.js" -import {RestartableRng} from "src/base/RestartableRng.js" -import {Revision} from "src/base/Revision.js" -import {initSerializer, fromJsonText_CircuitDefinition} from "src/circuit/Serializer.js" -import {TouchScrollBlocker} from "src/browser/TouchScrollBlocker.js" -import {Util} from "src/base/Util.js" -import {initializedWglContext} from "src/webgl/WglContext.js" -import {watchDrags, isMiddleClicking, eventPosRelativeTo} from "src/browser/MouseWatcher.js" -import {ObservableValue, ObservableSource} from "src/base/Obs.js" -import {initExports, obsExportsIsShowing} from "src/ui/exports.js" -import {initForge, obsForgeIsShowing} from "src/ui/forge.js" -import {initMenu, obsMenuIsShowing, closeMenu} from "src/ui/menu.js" -import {initUndoRedo} from "src/ui/undo.js" -import {initClear} from "src/ui/clear.js" -import {initUrlCircuitSync} from "src/ui/url.js" -import {initTitleSync} from "src/ui/title.js" -import {simulate} from "src/ui/sim.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {GATE_CIRCUIT_DRAWER} from "src/ui/DisplayedCircuit.js" -import {GateColumn} from "src/circuit/GateColumn.js"; -import {Point} from "src/math/Point.js"; +import {CircuitStats} from "./circuit/CircuitStats.js" +import {CooldownThrottle} from "./base/CooldownThrottle.js" +import {Config} from "./Config.js" +import {DisplayedInspector} from "./ui/DisplayedInspector.js" +import {Painter} from "./draw/Painter.js" +import {Rect} from "./math/Rect.js" +import {RestartableRng} from "./base/RestartableRng.js" +import {Revision} from "./base/Revision.js" +import {initSerializer, fromJsonText_CircuitDefinition} from "./circuit/Serializer.js" +import {TouchScrollBlocker} from "./browser/TouchScrollBlocker.js" +import {Util} from "./base/Util.js" +import {initializedWglContext} from "./webgl/WglContext.js" +import {watchDrags, isMiddleClicking, eventPosRelativeTo} from "./browser/MouseWatcher.js" +import {ObservableValue, ObservableSource} from "./base/Obs.js" +import {initExports, obsExportsIsShowing} from "./ui/exports.js" +import {initForge, obsForgeIsShowing} from "./ui/forge.js" +import {initMenu, obsMenuIsShowing, closeMenu} from "./ui/menu.js" +import {initUndoRedo} from "./ui/undo.js" +import {initClear} from "./ui/clear.js" +import {initUrlCircuitSync} from "./ui/url.js" +import {initTitleSync} from "./ui/title.js" +import {simulate} from "./ui/sim.js" +import {GatePainting} from "./draw/GatePainting.js" +import {GATE_CIRCUIT_DRAWER} from "./ui/DisplayedCircuit.js" +import {GateColumn} from "./circuit/GateColumn.js"; +import {Point} from "./math/Point.js"; initSerializer( GatePainting.LABEL_DRAWER, GatePainting.MATRIX_DRAWER, diff --git a/src/math/Axis.js b/src/math/Axis.js index 41b21144..6e0ef9c3 100644 --- a/src/math/Axis.js +++ b/src/math/Axis.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {UNICODE_FRACTIONS} from "src/base/Format.js" -import {parseFormula} from "src/math/FormulaParser.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {UNICODE_FRACTIONS} from "../base/Format.js" +import {parseFormula} from "./FormulaParser.js" const PARSE_AXIS_TOKEN_MAP = new Map(); diff --git a/src/math/Complex.js b/src/math/Complex.js index 8a785e8a..36f4e234 100644 --- a/src/math/Complex.js +++ b/src/math/Complex.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {Format, UNICODE_FRACTIONS} from "src/base/Format.js" -import {Util} from "src/base/Util.js" -import {parseFormula} from "src/math/FormulaParser.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {Format, UNICODE_FRACTIONS} from "../base/Format.js" +import {Util} from "../base/Util.js" +import {parseFormula} from "./FormulaParser.js" const PARSE_COMPLEX_TOKEN_MAP_ALL = new Map(); const PARSE_COMPLEX_TOKEN_MAP_RAD = new Map(); diff --git a/src/math/FormulaParser.js b/src/math/FormulaParser.js index 3c6f7e8b..8935e9a4 100644 --- a/src/math/FormulaParser.js +++ b/src/math/FormulaParser.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {seq} from "../base/Seq.js" /** * @param {!Array.} tokens diff --git a/src/math/Matrix.js b/src/math/Matrix.js index 5e3812ca..9fa7ea5e 100644 --- a/src/math/Matrix.js +++ b/src/math/Matrix.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. - -import {Complex} from "src/math/Complex.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Format} from "src/base/Format.js" -import {seq, Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Complex} from "./Complex.js" +import {DetailedError} from "../base/DetailedError.js" +import {Format} from "../base/Format.js" +import {seq, Seq} from "../base/Seq.js" +import {Util} from "../base/Util.js" /** * A matrix of complex values. diff --git a/src/math/Point.js b/src/math/Point.js index f3c6ff67..e96b7e4c 100644 --- a/src/math/Point.js +++ b/src/math/Point.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * A two dimensional point with real coordinates. diff --git a/src/math/Rect.js b/src/math/Rect.js index 30e25a40..cecb4d74 100644 --- a/src/math/Rect.js +++ b/src/math/Rect.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {Point} from "src/math/Point.js" +/** + * Copyright 2017 Google 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. + */ + +import {Point} from "./Point.js" /** * A two dimensional axis-aligned rectangle with defined position and size. diff --git a/src/ui/DisplayedCircuit.js b/src/ui/DisplayedCircuit.js index 5b3792fd..336cbe53 100644 --- a/src/ui/DisplayedCircuit.js +++ b/src/ui/DisplayedCircuit.js @@ -1,35 +1,37 @@ -// Copyright 2017 Google 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. - -import {CachablePainting} from "src/draw/CachablePainting.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Config} from "src/Config.js" -import {DetailedError} from "src/base/DetailedError.js" -import {equate} from "src/base/Equate.js" -import {Format} from "src/base/Format.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {GateDrawParams} from "src/draw/GateDrawParams.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Hand} from "src/ui/Hand.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Point} from "src/math/Point.js" -import {Matrix} from "src/math/Matrix.js" -import {Rect} from "src/math/Rect.js" -import {Util} from "src/base/Util.js" -import {seq, Seq} from "src/base/Seq.js" -import {paintBlochSphereDisplay} from "src/gates/BlochSphereDisplay.js" +/** + * Copyright 2017 Google 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. + */ + +import {CachablePainting} from "../draw/CachablePainting.js" +import {CircuitDefinition} from "../circuit/CircuitDefinition.js" +import {CircuitStats} from "../circuit/CircuitStats.js" +import {Config} from "../Config.js" +import {DetailedError} from "../base/DetailedError.js" +import {equate} from "../base/Equate.js" +import {Format} from "../base/Format.js" +import {GateColumn} from "../circuit/GateColumn.js" +import {GateDrawParams} from "../draw/GateDrawParams.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Hand} from "../ui/Hand.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Point} from "../math/Point.js" +import {Matrix} from "../math/Matrix.js" +import {Rect} from "../math/Rect.js" +import {Util} from "../base/Util.js" +import {seq, Seq} from "../base/Seq.js" +import {paintBlochSphereDisplay} from "../gates/BlochSphereDisplay.js" /** @type {!number} */ let CIRCUIT_OP_HORIZONTAL_SPACING = 10; diff --git a/src/ui/DisplayedInspector.js b/src/ui/DisplayedInspector.js index d42096fe..54efc505 100644 --- a/src/ui/DisplayedInspector.js +++ b/src/ui/DisplayedInspector.js @@ -1,29 +1,31 @@ -// Copyright 2017 Google 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. - -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Config} from "src/Config.js" -import {DisplayedCircuit} from "src/ui/DisplayedCircuit.js" -import {DisplayedToolbox} from "src/ui/DisplayedToolbox.js" -import {GateDrawParams} from "src/draw/GateDrawParams.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Gates} from "src/gates/AllGates.js" -import {Hand} from "src/ui/Hand.js" -import {Painter} from "src/draw/Painter.js" -import {Rect} from "src/math/Rect.js" -import {Serializer} from "src/circuit/Serializer.js" +/** + * Copyright 2017 Google 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. + */ + +import {CircuitDefinition} from "../circuit/CircuitDefinition.js" +import {CircuitStats} from "../circuit/CircuitStats.js" +import {Config} from "../Config.js" +import {DisplayedCircuit} from "../ui/DisplayedCircuit.js" +import {DisplayedToolbox} from "../ui/DisplayedToolbox.js" +import {GateDrawParams} from "../draw/GateDrawParams.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Gates} from "../gates/AllGates.js" +import {Hand} from "../ui/Hand.js" +import {Painter} from "../draw/Painter.js" +import {Rect} from "../math/Rect.js" +import {Serializer} from "../circuit/Serializer.js" class DisplayedInspector { /** diff --git a/src/ui/DisplayedToolbox.js b/src/ui/DisplayedToolbox.js index 876ba82f..b9d35b80 100644 --- a/src/ui/DisplayedToolbox.js +++ b/src/ui/DisplayedToolbox.js @@ -1,29 +1,31 @@ -// Copyright 2017 Google 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. - -import {CachablePainting} from "src/draw/CachablePainting.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Config} from "src/Config.js" -import {GateDrawParams} from "src/draw/GateDrawParams.js" -import {GatePainting} from "src/draw/GatePainting.js" -import {Hand} from "src/ui/Hand.js" -import {MysteryGateSymbol, MysteryGateMaker} from "src/gates/Joke_MysteryGate.js" -import {Rect} from "src/math/Rect.js" -import {Painter} from "src/draw/Painter.js" -import {Point} from "src/math/Point.js" -import {seq} from "src/base/Seq.js" -import {WidgetPainter} from "src/draw/WidgetPainter.js" +/** + * Copyright 2017 Google 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. + */ + +import {CachablePainting} from "../draw/CachablePainting.js" +import {CircuitStats} from "../circuit/CircuitStats.js" +import {Config} from "../Config.js" +import {GateDrawParams} from "../draw/GateDrawParams.js" +import {GatePainting} from "../draw/GatePainting.js" +import {Hand} from "../ui/Hand.js" +import {MysteryGateSymbol, MysteryGateMaker} from "../gates/Joke_MysteryGate.js" +import {Rect} from "../math/Rect.js" +import {Painter} from "../draw/Painter.js" +import {Point} from "../math/Point.js" +import {seq} from "../base/Seq.js" +import {WidgetPainter} from "../draw/WidgetPainter.js" class DisplayedToolbox { /** diff --git a/src/ui/Hand.js b/src/ui/Hand.js index 9094b7b6..8f923ed4 100644 --- a/src/ui/Hand.js +++ b/src/ui/Hand.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {describe} from "src/base/Describe.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Gate} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Point} from "src/math/Point.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {describe} from "../base/Describe.js" +import {DetailedError} from "../base/DetailedError.js" +import {Gate} from "../circuit/Gate.js" +import {GateColumn} from "../circuit/GateColumn.js" +import {Point} from "../math/Point.js" +import {Util} from "../base/Util.js" class Hand { /** diff --git a/src/ui/clear.js b/src/ui/clear.js index 10475a77..5b2f3353 100644 --- a/src/ui/clear.js +++ b/src/ui/clear.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * @param {!Revision} revision diff --git a/src/ui/exports.js b/src/ui/exports.js index 92a24e29..decaff6a 100644 --- a/src/ui/exports.js +++ b/src/ui/exports.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {ObservableValue} from "src/base/Obs.js" -import {Serializer} from "src/circuit/Serializer.js" -import {selectAndCopyToClipboard} from "src/browser/Clipboard.js" -import {fromJsonText_CircuitDefinition} from "src/circuit/Serializer.js" -import {saveFile} from "src/browser/SaveFile.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {ObservableValue} from "../base/Obs.js" +import {Serializer} from "../circuit/Serializer.js" +import {selectAndCopyToClipboard} from "../browser/Clipboard.js" +import {fromJsonText_CircuitDefinition} from "../circuit/Serializer.js" +import {saveFile} from "../browser/SaveFile.js" const exportsIsVisible = new ObservableValue(false); const obsExportsIsShowing = exportsIsVisible.observable().whenDifferent(); diff --git a/src/ui/forge.js b/src/ui/forge.js index 5c4e001d..1c6a0442 100644 --- a/src/ui/forge.js +++ b/src/ui/forge.js @@ -1,38 +1,40 @@ -// Copyright 2017 Google 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. - -import {Axis} from "src/math/Axis.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {setGateBuilderEffectToCircuit} from "src/circuit/CircuitComputeUtil.js" -import {Complex} from "src/math/Complex.js" -import {Config} from "src/Config.js" -import {DetailedError} from "src/base/DetailedError.js" -import {drawCircuitTooltip} from "src/ui/DisplayedCircuit.js" -import {Format} from "src/base/Format.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {getCircuitCycleTime} from "src/ui/sim.js" -import {MathPainter} from "src/draw/MathPainter.js" -import {Matrix} from "src/math/Matrix.js" -import {Observable, ObservableValue} from "src/base/Obs.js" -import {Painter} from "src/draw/Painter.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" -import {fromJsonText_CircuitDefinition, Serializer} from "src/circuit/Serializer.js" -import {seq} from "src/base/Seq.js" -import {textEditObservable} from "src/browser/EventUtil.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Axis} from "../math/Axis.js" +import {CircuitDefinition} from "../circuit/CircuitDefinition.js" +import {setGateBuilderEffectToCircuit} from "../circuit/CircuitComputeUtil.js" +import {Complex} from "../math/Complex.js" +import {Config} from "../Config.js" +import {DetailedError} from "../base/DetailedError.js" +import {drawCircuitTooltip} from "../ui/DisplayedCircuit.js" +import {Format} from "../base/Format.js" +import {Gate, GateBuilder} from "../circuit/Gate.js" +import {GateColumn} from "../circuit/GateColumn.js" +import {getCircuitCycleTime} from "../ui/sim.js" +import {MathPainter} from "../draw/MathPainter.js" +import {Matrix} from "../math/Matrix.js" +import {Observable, ObservableValue} from "../base/Obs.js" +import {Painter} from "../draw/Painter.js" +import {Point} from "../math/Point.js" +import {Rect} from "../math/Rect.js" +import {fromJsonText_CircuitDefinition, Serializer} from "../circuit/Serializer.js" +import {seq} from "../base/Seq.js" +import {textEditObservable} from "../browser/EventUtil.js" +import {Util} from "../base/Util.js" const forgeIsVisible = new ObservableValue(false); const obsForgeIsShowing = forgeIsVisible.observable().whenDifferent(); diff --git a/src/ui/menu.js b/src/ui/menu.js index c3646ccf..fbe3ddd8 100644 --- a/src/ui/menu.js +++ b/src/ui/menu.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {ObservableValue} from "src/base/Obs.js" +import {ObservableValue} from "../base/Obs.js" const menuIsVisible = new ObservableValue(true); const obsMenuIsShowing = menuIsVisible.observable().whenDifferent(); diff --git a/src/ui/sim.js b/src/ui/sim.js index 62144df3..333312a2 100644 --- a/src/ui/sim.js +++ b/src/ui/sim.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Config} from "src/Config.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" +import {CircuitDefinition} from "../circuit/CircuitDefinition.js" +import {Config} from "../Config.js" +import {CircuitStats} from "../circuit/CircuitStats.js" const getCircuitCycleTime = (() => { /** diff --git a/src/ui/title.js b/src/ui/title.js index 53d763b8..afcc77ea 100644 --- a/src/ui/title.js +++ b/src/ui/title.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" -import {fromJsonText_CircuitDefinition} from "src/circuit/Serializer.js" +import {Config} from "../Config.js" +import {fromJsonText_CircuitDefinition} from "../circuit/Serializer.js" /** * @param {!Revision} revision diff --git a/src/ui/undo.js b/src/ui/undo.js index 5a71f6a8..6561a4d7 100644 --- a/src/ui/undo.js +++ b/src/ui/undo.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * @param {!Revision} revision diff --git a/src/ui/url.js b/src/ui/url.js index 989b0187..51c530c7 100644 --- a/src/ui/url.js +++ b/src/ui/url.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {notifyAboutRecoveryFromUnexpectedError} from "src/fallback.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Config} from "src/Config.js" -import {HistoryPusher} from "src/browser/HistoryPusher.js" -import {fromJsonText_CircuitDefinition, Serializer} from "src/circuit/Serializer.js" +import {notifyAboutRecoveryFromUnexpectedError} from "../fallback.js" +import {CircuitDefinition} from "../circuit/CircuitDefinition.js" +import {Config} from "../Config.js" +import {HistoryPusher} from "../browser/HistoryPusher.js" +import {fromJsonText_CircuitDefinition, Serializer} from "../circuit/Serializer.js" function urlWithCircuitHash(jsonText) { if (jsonText.indexOf('%') !== -1 || jsonText.indexOf('&') !== -1) { diff --git a/src/webgl/ShaderCoders.js b/src/webgl/ShaderCoders.js index fa91d958..0eb1657e 100644 --- a/src/webgl/ShaderCoders.js +++ b/src/webgl/ShaderCoders.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {WglArg} from "src/webgl/WglArg.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" -import {initializedWglContext} from "src/webgl/WglContext.js" -import {provideWorkingShaderCoderToWglConfiguredShader, WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +import {WglArg} from "./WglArg.js" +import {WglShader} from "./WglShader.js" +import {WglTexture} from "./WglTexture.js" +import {initializedWglContext} from "./WglContext.js" +import {provideWorkingShaderCoderToWglConfiguredShader, WglConfiguredShader} from "./WglConfiguredShader.js" -import {ShaderPart} from "src/webgl/ShaderCoders_Base.js" -import {SHADER_CODER_BYTES} from "src/webgl/ShaderCoders_intoBytes.js" -import {SHADER_CODER_FLOATS} from "src/webgl/ShaderCoders_intoFloats.js" +import {ShaderPart} from "./ShaderCoders_Base.js" +import {SHADER_CODER_BYTES} from "./ShaderCoders_intoBytes.js" +import {SHADER_CODER_FLOATS} from "./ShaderCoders_intoFloats.js" class ShaderPartDescription { /** diff --git a/src/webgl/ShaderCoders_Base.js b/src/webgl/ShaderCoders_Base.js index db9efd3c..c83a02c1 100644 --- a/src/webgl/ShaderCoders_Base.js +++ b/src/webgl/ShaderCoders_Base.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {WglArg} from "src/webgl/WglArg.js" +import {WglArg} from "./WglArg.js" /** * A piece of a shader. diff --git a/src/webgl/ShaderCoders_intoBytes.js b/src/webgl/ShaderCoders_intoBytes.js index 9468a519..2202cbd1 100644 --- a/src/webgl/ShaderCoders_intoBytes.js +++ b/src/webgl/ShaderCoders_intoBytes.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {WglArg} from "src/webgl/WglArg.js" -import {Seq} from "src/base/Seq.js" -import {ShaderPart, SingleTypeCoder, ShaderCoder, BOOL_TYPE_CODER} from "src/webgl/ShaderCoders_Base.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {WglArg} from "./WglArg.js" +import {Seq} from "../base/Seq.js" +import {ShaderPart, SingleTypeCoder, ShaderCoder, BOOL_TYPE_CODER} from "./ShaderCoders_Base.js" /** * Exposes an array of single-precision floats as an array of bytes. diff --git a/src/webgl/ShaderCoders_intoFloats.js b/src/webgl/ShaderCoders_intoFloats.js index 310a8a56..949c1604 100644 --- a/src/webgl/ShaderCoders_intoFloats.js +++ b/src/webgl/ShaderCoders_intoFloats.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {ShaderPart, SingleTypeCoder, ShaderCoder, BOOL_TYPE_CODER} from "src/webgl/ShaderCoders_Base.js" -import {WglArg} from "src/webgl/WglArg.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {ShaderPart, SingleTypeCoder, ShaderCoder, BOOL_TYPE_CODER} from "./ShaderCoders_Base.js" +import {WglArg} from "./WglArg.js" /** * @param {!int} vecSize diff --git a/src/webgl/Shaders.js b/src/webgl/Shaders.js index 1400f3a6..092a03c5 100644 --- a/src/webgl/Shaders.js +++ b/src/webgl/Shaders.js @@ -1,28 +1,30 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {WglArg} from "src/webgl/WglArg.js" -import {initializedWglContext} from "src/webgl/WglContext.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {WglArg} from "./WglArg.js" +import {initializedWglContext} from "./WglContext.js" +import {WglShader} from "./WglShader.js" +import {WglConfiguredShader} from "./WglConfiguredShader.js" import { currentShaderCoder, Inputs, Outputs, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" +} from "./ShaderCoders.js" /** * Utilities for creating/configuring shaders that render various simple things. diff --git a/src/webgl/WglArg.js b/src/webgl/WglArg.js index 483cc61a..ace1b887 100644 --- a/src/webgl/WglArg.js +++ b/src/webgl/WglArg.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * Describes a uniform argument, for passing into shaders when rendering. diff --git a/src/webgl/WglConfiguredShader.js b/src/webgl/WglConfiguredShader.js index cc1c1a4d..ed8adb95 100644 --- a/src/webgl/WglConfiguredShader.js +++ b/src/webgl/WglConfiguredShader.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Matrix} from "src/math/Matrix.js" -import {WglTexture} from "src/webgl/WglTexture.js" +/** + * Copyright 2017 Google 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. + */ + +import {Matrix} from "../math/Matrix.js" +import {WglTexture} from "./WglTexture.js" /** @returns {undefined|!ShaderCoder} */ let currentShaderCoder = undefined; diff --git a/src/webgl/WglContext.js b/src/webgl/WglContext.js index 74ce65ca..843a36e1 100644 --- a/src/webgl/WglContext.js +++ b/src/webgl/WglContext.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {canvasCreatedForTesting, webglContextCreatedForTesting} from "src/issues.js" +/** + * Copyright 2017 Google 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. + */ + +import {canvasCreatedForTesting, webglContextCreatedForTesting} from "../issues.js" /** * A WebGLRenderingContext wrapped with metadata helpers, lifetime information, and utility methods. diff --git a/src/webgl/WglMortalValueSlot.js b/src/webgl/WglMortalValueSlot.js index b120e286..bb6e0e7d 100644 --- a/src/webgl/WglMortalValueSlot.js +++ b/src/webgl/WglMortalValueSlot.js @@ -1,16 +1,18 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ /** * A place for a value associated with a webgl context, that needs to be re-initialized when the context is lost. diff --git a/src/webgl/WglShader.js b/src/webgl/WglShader.js index c68ae8eb..29033385 100644 --- a/src/webgl/WglShader.js +++ b/src/webgl/WglShader.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. - -import {Config} from "src/Config.js" -import {DetailedError} from "src/base/DetailedError.js" -import {WglArg} from "src/webgl/WglArg.js" -import {initializedWglContext} from "src/webgl/WglContext.js" -import {WglMortalValueSlot} from "src/webgl/WglMortalValueSlot.js" -import {checkGetErrorResult, checkFrameBufferStatusResult} from "src/webgl/WglUtil.js" -import {Seq} from "src/base/Seq.js" -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" +/** + * Copyright 2017 Google 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. + */ + +import {Config} from "../Config.js" +import {DetailedError} from "../base/DetailedError.js" +import {WglArg} from "./WglArg.js" +import {initializedWglContext} from "./WglContext.js" +import {WglMortalValueSlot} from "./WglMortalValueSlot.js" +import {checkGetErrorResult, checkFrameBufferStatusResult} from "./WglUtil.js" +import {Seq} from "../base/Seq.js" +import {WglConfiguredShader} from "./WglConfiguredShader.js" /** @type {!WglMortalValueSlot} */ const ENSURE_ATTRIBUTES_BOUND_SLOT = new WglMortalValueSlot(() => { diff --git a/src/webgl/WglTexture.js b/src/webgl/WglTexture.js index 972aac08..4d983e36 100644 --- a/src/webgl/WglTexture.js +++ b/src/webgl/WglTexture.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {Util} from "src/base/Util.js" -import {WglMortalValueSlot} from "src/webgl/WglMortalValueSlot.js" -import {initializedWglContext} from "src/webgl/WglContext.js" -import {checkGetErrorResult, checkFrameBufferStatusResult} from "src/webgl/WglUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {Util} from "../base/Util.js" +import {WglMortalValueSlot} from "./WglMortalValueSlot.js" +import {initializedWglContext} from "./WglContext.js" +import {checkGetErrorResult, checkFrameBufferStatusResult} from "./WglUtil.js" /** * Stores pixel data for/from the gpu. diff --git a/src/webgl/WglTexturePool.js b/src/webgl/WglTexturePool.js index e5970385..28029ff6 100644 --- a/src/webgl/WglTexturePool.js +++ b/src/webgl/WglTexturePool.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {DetailedError} from "src/base/DetailedError.js" -import {WglTexture} from "src/webgl/WglTexture.js" -import {provideWglTexturePoolToWglConfiguredShader} from "src/webgl/WglConfiguredShader.js" -import {currentShaderCoder} from "src/webgl/ShaderCoders.js" +/** + * Copyright 2017 Google 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. + */ + +import {DetailedError} from "../base/DetailedError.js" +import {WglTexture} from "./WglTexture.js" +import {provideWglTexturePoolToWglConfiguredShader} from "./WglConfiguredShader.js" +import {currentShaderCoder} from "./ShaderCoders.js" /** @type {!Array.>} */ const FLOAT_POOL = []; diff --git a/src/webgl/WglTextureTrader.js b/src/webgl/WglTextureTrader.js index 99fa1044..f19fe2f3 100644 --- a/src/webgl/WglTextureTrader.js +++ b/src/webgl/WglTextureTrader.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {WglConfiguredShader} from "src/webgl/WglConfiguredShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" +import {WglConfiguredShader} from "./WglConfiguredShader.js" +import {WglTexture} from "./WglTexture.js" +import {WglTexturePool} from "./WglTexturePool.js" /** * A mechanism, for applying a series of shaders to textures, that handles tedious deallocation for you. diff --git a/src/webgl/WglUtil.js b/src/webgl/WglUtil.js index 70c71e89..23a28b05 100644 --- a/src/webgl/WglUtil.js +++ b/src/webgl/WglUtil.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Config} from "src/Config.js" +import {Config} from "../Config.js" /** * Checks if the given code, returned by gl.getError, is an error or not. diff --git a/test/CircuitOperationTestUtil.js b/test/CircuitOperationTestUtil.js index 220e4524..411cf54d 100644 --- a/test/CircuitOperationTestUtil.js +++ b/test/CircuitOperationTestUtil.js @@ -1,32 +1,34 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {assertThat, assertTrue} from "test/TestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitEvalContext} from "src/circuit/CircuitEvalContext.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Complex} from "src/math/Complex.js" -import {Controls} from "src/circuit/Controls.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Matrix} from "src/math/Matrix.js" -import {KetTextureUtil} from "src/circuit/KetTextureUtil.js" -import {seq, Seq} from "src/base/Seq.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +import {assertThat, assertTrue} from "./TestUtil.js" +import {advanceStateWithCircuit} from "../src/circuit/CircuitComputeUtil.js" +import {CircuitDefinition} from "../src/circuit/CircuitDefinition.js" +import {CircuitEvalContext} from "../src/circuit/CircuitEvalContext.js" +import {CircuitShaders} from "../src/circuit/CircuitShaders.js" +import {CircuitStats} from "../src/circuit/CircuitStats.js" +import {Complex} from "../src/math/Complex.js" +import {Controls} from "../src/circuit/Controls.js" +import {GateColumn} from "../src/circuit/GateColumn.js" +import {Gates} from "../src/gates/AllGates.js" +import {Shaders} from "../src/webgl/Shaders.js" +import {Matrix} from "../src/math/Matrix.js" +import {KetTextureUtil} from "../src/circuit/KetTextureUtil.js" +import {seq, Seq} from "../src/base/Seq.js" +import {WglTextureTrader} from "../src/webgl/WglTextureTrader.js" // Turn this on to make it easier to debug why a randomized test is failing. const USE_SIMPLE_VALUES = false; diff --git a/test/KarmaTestRunner.test.js b/test/KarmaTestRunner.test.js index d48f50e2..41c426ec 100644 --- a/test/KarmaTestRunner.test.js +++ b/test/KarmaTestRunner.test.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js"; +import {Suite} from "./TestUtil.js"; let tryPromiseRun = method => { try { diff --git a/test/TestUtil.js b/test/TestUtil.js index 898db329..96cb4335 100644 --- a/test/TestUtil.js +++ b/test/TestUtil.js @@ -1,27 +1,29 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ // Cheat a little bit on the testing library being independent from what it tests -import {} from "src/browser/Polyfills.js" -import {describe} from "src/base/Describe.js" -import {equate} from "src/base/Equate.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" -import {changeShaderCoder, canTestFloatShaders} from "src/webgl/ShaderCoders.js" -import {SHADER_CODER_BYTES} from "src/webgl/ShaderCoders_intoBytes.js" -import {SHADER_CODER_FLOATS} from "src/webgl/ShaderCoders_intoFloats.js" -import {DetailedError} from "src/base/DetailedError.js" -import {Config} from "src/Config.js" +import {} from "../src/browser/Polyfills.js" +import {describe} from "../src/base/Describe.js" +import {equate} from "../src/base/Equate.js" +import {WglTexturePool} from "../src/webgl/WglTexturePool.js" +import {changeShaderCoder, canTestFloatShaders} from "../src/webgl/ShaderCoders.js" +import {SHADER_CODER_BYTES} from "../src/webgl/ShaderCoders_intoBytes.js" +import {SHADER_CODER_FLOATS} from "../src/webgl/ShaderCoders_intoFloats.js" +import {DetailedError} from "../src/base/DetailedError.js" +import {Config} from "../src/Config.js" Config.CHECK_WEB_GL_ERRORS_EVEN_ON_HOT_PATHS = true; /** @type {!int} */ diff --git a/test/base/Describe.test.js b/test/base/Describe.test.js index 8a56f367..8b7ef05b 100644 --- a/test/base/Describe.test.js +++ b/test/base/Describe.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {describe} from "src/base/Describe.js" +import {Suite, assertThat} from "../TestUtil.js" +import {describe} from "../../src/base/Describe.js" let suite = new Suite("Describe"); diff --git a/test/base/DetailedError.test.js b/test/base/DetailedError.test.js index d2360c09..230e0044 100644 --- a/test/base/DetailedError.test.js +++ b/test/base/DetailedError.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {DetailedError} from "src/base/DetailedError.js" +import {Suite, assertThat} from "../TestUtil.js" +import {DetailedError} from "../../src/base/DetailedError.js" let suite = new Suite("DetailedError"); diff --git a/test/base/Equate.test.js b/test/base/Equate.test.js index ad78604f..9ed61127 100644 --- a/test/base/Equate.test.js +++ b/test/base/Equate.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, fail, assertTrue, assertFalse} from "test/TestUtil.js" -import {equate} from "src/base/Equate.js" +import {Suite, fail, assertTrue, assertFalse} from "../TestUtil.js" +import {equate} from "../../src/base/Equate.js" -import {describe} from "src/base/Describe.js" +import {describe} from "../../src/base/Describe.js" let suite = new Suite("Equate"); diff --git a/test/base/Format.test.js b/test/base/Format.test.js index d3d8be03..32e4d2a7 100644 --- a/test/base/Format.test.js +++ b/test/base/Format.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" -import {Format} from "src/base/Format.js" +import {Suite, assertThat, assertThrows} from "../TestUtil.js" +import {Format} from "../../src/base/Format.js" let suite = new Suite("Format"); diff --git a/test/base/Obs.test.js b/test/base/Obs.test.js index f9c62e18..769765be 100644 --- a/test/base/Obs.test.js +++ b/test/base/Obs.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {Observable, ObservableValue, ObservableSource} from "src/base/Obs.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {Observable, ObservableValue, ObservableSource} from "../../src/base/Obs.js" let suite = new Suite("Obs"); diff --git a/test/base/RestartableRng.test.js b/test/base/RestartableRng.test.js index 07ace947..5c3c4aed 100644 --- a/test/base/RestartableRng.test.js +++ b/test/base/RestartableRng.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {RestartableRng} from "src/base/RestartableRng.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {RestartableRng} from "../../src/base/RestartableRng.js" let suite = new Suite("RestartableRng"); diff --git a/test/base/Revision.test.js b/test/base/Revision.test.js index 6d880414..92eca48a 100644 --- a/test/base/Revision.test.js +++ b/test/base/Revision.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {Revision} from "src/base/Revision.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {Revision} from "../../src/base/Revision.js" let suite = new Suite("Revision"); diff --git a/test/base/Seq.test.js b/test/base/Seq.test.js index 7cbb63ae..8b5ddf3e 100644 --- a/test/base/Seq.test.js +++ b/test/base/Seq.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {seq, Seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {seq, Seq} from "../../src/base/Seq.js" let suite = new Suite("Seq"); diff --git a/test/base/Util.test.js b/test/base/Util.test.js index 10ae3e64..ae1ffa01 100644 --- a/test/base/Util.test.js +++ b/test/base/Util.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("Util"); diff --git a/test/circuit/CircuitComputeUtil.test.js b/test/circuit/CircuitComputeUtil.test.js index 80141a63..5ae09a78 100644 --- a/test/circuit/CircuitComputeUtil.test.js +++ b/test/circuit/CircuitComputeUtil.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {setGateBuilderEffectToCircuit, advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {GateBuilder} from "src/circuit/Gate.js" +import {Suite} from "../TestUtil.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {setGateBuilderEffectToCircuit, advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {GateBuilder} from "../../src/circuit/Gate.js" -import {Controls} from "src/circuit/Controls.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("CircuitComputeUtil"); diff --git a/test/circuit/CircuitDefinition.test.js b/test/circuit/CircuitDefinition.test.js index 0024c07e..a4149af0 100644 --- a/test/circuit/CircuitDefinition.test.js +++ b/test/circuit/CircuitDefinition.test.js @@ -1,31 +1,33 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" - -import {setGateBuilderEffectToCircuit} from "src/circuit/CircuitComputeUtil.js" -import {Complex} from "src/math/Complex.js" -import {Controls} from "src/circuit/Controls.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" -import {Point} from "src/math/Point.js" -import {Seq, seq} from "src/base/Seq.js" -import {Serializer} from "src/circuit/Serializer.js" -import {Util} from "src/base/Util.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" + +import {setGateBuilderEffectToCircuit} from "../../src/circuit/CircuitComputeUtil.js" +import {Complex} from "../../src/math/Complex.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Gate, GateBuilder} from "../../src/circuit/Gate.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Point} from "../../src/math/Point.js" +import {Seq, seq} from "../../src/base/Seq.js" +import {Serializer} from "../../src/circuit/Serializer.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("CircuitDefinition"); diff --git a/test/circuit/CircuitShaders.test.js b/test/circuit/CircuitShaders.test.js index a73bcf7c..b8773487 100644 --- a/test/circuit/CircuitShaders.test.js +++ b/test/circuit/CircuitShaders.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {assertThatCircuitShaderActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" - -import {Controls} from "src/circuit/Controls.js" -import {Seq} from "src/base/Seq.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Matrix} from "src/math/Matrix.js" -import {Outputs, makePseudoShaderWithInputsAndOutputAndCode} from "src/webgl/ShaderCoders.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {assertThatCircuitShaderActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {CircuitShaders} from "../../src/circuit/CircuitShaders.js" + +import {Controls} from "../../src/circuit/Controls.js" +import {Seq} from "../../src/base/Seq.js" +import {Shaders} from "../../src/webgl/Shaders.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Outputs, makePseudoShaderWithInputsAndOutputAndCode} from "../../src/webgl/ShaderCoders.js" let suite = new Suite("CircuitShaders"); diff --git a/test/circuit/CircuitStats.test.js b/test/circuit/CircuitStats.test.js index d4f012c7..be6c7497 100644 --- a/test/circuit/CircuitStats.test.js +++ b/test/circuit/CircuitStats.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertTrue} from "test/TestUtil.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" - -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" -import {Serializer} from "src/circuit/Serializer.js" -import {seq, Seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertTrue} from "../TestUtil.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" + +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Serializer} from "../../src/circuit/Serializer.js" +import {seq, Seq} from "../../src/base/Seq.js" let suite = new Suite("CircuitStats"); diff --git a/test/circuit/Controls.test.js b/test/circuit/Controls.test.js index b020df89..050751bd 100644 --- a/test/circuit/Controls.test.js +++ b/test/circuit/Controls.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {assertTrue, assertFalse, assertThat, assertThrows, Suite} from "test/TestUtil.js" -import {Controls} from "src/circuit/Controls.js" +import {assertTrue, assertFalse, assertThat, assertThrows, Suite} from "../TestUtil.js" +import {Controls} from "../../src/circuit/Controls.js" let suite = new Suite("Controls"); diff --git a/test/circuit/Gate.test.js b/test/circuit/Gate.test.js index 2790dec8..6dd01341 100644 --- a/test/circuit/Gate.test.js +++ b/test/circuit/Gate.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" - -import {Matrix} from "src/math/Matrix.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {Gate, GateBuilder} from "../../src/circuit/Gate.js" + +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("Gate"); diff --git a/test/circuit/GateColumn.test.js b/test/circuit/GateColumn.test.js index e2fb2fac..0582a214 100644 --- a/test/circuit/GateColumn.test.js +++ b/test/circuit/GateColumn.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertTrue, assertFalse} from "test/TestUtil.js" -import {GateColumn} from "src/circuit/GateColumn.js" +import {Suite, assertThat, assertTrue, assertFalse} from "../TestUtil.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" +import {Gates} from "../../src/gates/AllGates.js" let suite = new Suite("GateColumn"); diff --git a/test/circuit/GateShaders.test.js b/test/circuit/GateShaders.test.js index e83008ba..71da520c 100644 --- a/test/circuit/GateShaders.test.js +++ b/test/circuit/GateShaders.test.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {GateShaders} from "src/circuit/GateShaders.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" +import {Suite, assertThat} from "../TestUtil.js" +import {GateShaders} from "../../src/circuit/GateShaders.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" -import {Complex} from "src/math/Complex.js" -import {Seq} from "src/base/Seq.js" -import {Shaders} from "src/webgl/Shaders.js" -import {Matrix} from "src/math/Matrix.js" +import {Complex} from "../../src/math/Complex.js" +import {Seq} from "../../src/base/Seq.js" +import {Shaders} from "../../src/webgl/Shaders.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("GateShaders"); diff --git a/test/circuit/KetShaderUtil.test.js b/test/circuit/KetShaderUtil.test.js index 5f222ee4..b81f4150 100644 --- a/test/circuit/KetShaderUtil.test.js +++ b/test/circuit/KetShaderUtil.test.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {ketArgs, ketShader, ketShaderPermute, ketShaderPhase} from "src/circuit/KetShaderUtil.js" -import {assertThatCircuitShaderActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Suite} from "../TestUtil.js" +import {ketArgs, ketShader, ketShaderPermute, ketShaderPhase} from "../../src/circuit/KetShaderUtil.js" +import {assertThatCircuitShaderActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" +import {WglArg} from "../../src/webgl/WglArg.js" let suite = new Suite("KetShaderUtil"); diff --git a/test/circuit/Serializer.test.js b/test/circuit/Serializer.test.js index ba4b7902..7c41ea51 100644 --- a/test/circuit/Serializer.test.js +++ b/test/circuit/Serializer.test.js @@ -1,32 +1,34 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertTrue} from "test/TestUtil.js" -import {Serializer} from "src/circuit/Serializer.js" +import {Suite, assertThat, assertTrue} from "../TestUtil.js" +import {Serializer} from "../../src/circuit/Serializer.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {setGateBuilderEffectToCircuit} from "src/circuit/CircuitComputeUtil.js" -import {Complex} from "src/math/Complex.js" -import {CustomGateSet} from "src/circuit/CustomGateSet.js" -import {describe} from "src/base/Describe.js" -import {Gate, GateBuilder} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" -import {MysteryGateMaker} from "src/gates/Joke_MysteryGate.js" -import {seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {setGateBuilderEffectToCircuit} from "../../src/circuit/CircuitComputeUtil.js" +import {Complex} from "../../src/math/Complex.js" +import {CustomGateSet} from "../../src/circuit/CustomGateSet.js" +import {describe} from "../../src/base/Describe.js" +import {Gate, GateBuilder} from "../../src/circuit/Gate.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Matrix} from "../../src/math/Matrix.js" +import {MysteryGateMaker} from "../../src/gates/Joke_MysteryGate.js" +import {seq} from "../../src/base/Seq.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("Serializer"); diff --git a/test/gates/AllGates.test.js b/test/gates/AllGates.test.js index 0c8c9861..9f4ac3a7 100644 --- a/test/gates/AllGates.test.js +++ b/test/gates/AllGates.test.js @@ -1,32 +1,34 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {Gates} from "src/gates/AllGates.js" - -import {CircuitEvalContext} from "src/circuit/CircuitEvalContext.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Controls} from "src/circuit/Controls.js" -import {Matrix} from "src/math/Matrix.js" -import {Gate} from "src/circuit/Gate.js" -import {seq} from "src/base/Seq.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" -import {currentShaderCoder} from "src/webgl/ShaderCoders.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {Gates} from "../../src/gates/AllGates.js" + +import {CircuitEvalContext} from "../../src/circuit/CircuitEvalContext.js" +import {CircuitShaders} from "../../src/circuit/CircuitShaders.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Gate} from "../../src/circuit/Gate.js" +import {seq} from "../../src/base/Seq.js" +import {WglTextureTrader} from "../../src/webgl/WglTextureTrader.js" +import {currentShaderCoder} from "../../src/webgl/ShaderCoders.js" import { assertThatGateActsLikePermutation, assertThatGateActsLikePhaser -} from "test/CircuitOperationTestUtil.js" +} from "../CircuitOperationTestUtil.js" let suite = new Suite("AllGates"); diff --git a/test/gates/AmplitudeDisplay.test.js b/test/gates/AmplitudeDisplay.test.js index c982125c..78f3d417 100644 --- a/test/gates/AmplitudeDisplay.test.js +++ b/test/gates/AmplitudeDisplay.test.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" import { amplitudeDisplayStatTextures, AMPS_TO_SQUARED_MAGS_SHADER, @@ -20,17 +22,17 @@ import { FOLD_MAX_INDEXED_MAG_SHADER, LOOKUP_KET_AT_INDEXED_MAG_SHADER, POINTWISE_CMUL_CONJ_SHADER, -} from "src/gates/AmplitudeDisplay.js" - -import {Complex} from "src/math/Complex.js" -import {Controls} from "src/circuit/Controls.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Serializer} from "src/circuit/Serializer.js" -import {seq} from "src/base/Seq.js" -import {Shaders} from "src/webgl/Shaders.js" -import {currentShaderCoder} from "src/webgl/ShaderCoders.js" +} from "../../src/gates/AmplitudeDisplay.js" + +import {Complex} from "../../src/math/Complex.js" +import {Controls} from "../../src/circuit/Controls.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {CircuitShaders} from "../../src/circuit/CircuitShaders.js" +import {Serializer} from "../../src/circuit/Serializer.js" +import {seq} from "../../src/base/Seq.js" +import {Shaders} from "../../src/webgl/Shaders.js" +import {currentShaderCoder} from "../../src/webgl/ShaderCoders.js" let suite = new Suite("AmplitudeDisplay"); diff --git a/test/gates/ArithmeticGates.test.js b/test/gates/ArithmeticGates.test.js index 06962420..d2281ad0 100644 --- a/test/gates/ArithmeticGates.test.js +++ b/test/gates/ArithmeticGates.test.js @@ -1,29 +1,31 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {ArithmeticGates} from "src/gates/ArithmeticGates.js" -import {InputGates} from "src/gates/InputGates.js" +import {Suite} from "../TestUtil.js" +import {ArithmeticGates} from "../../src/gates/ArithmeticGates.js" +import {InputGates} from "../../src/gates/InputGates.js" import { assertThatCircuitUpdateActsLikeMatrix, assertThatGateActsLikePermutation, -} from "test/CircuitOperationTestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +} from "../CircuitOperationTestUtil.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Matrix} from "src/math/Matrix.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("ArithmeticGates"); diff --git a/test/gates/BitCountGates.test.js b/test/gates/BitCountGates.test.js index bb3bf184..936d44c2 100644 --- a/test/gates/BitCountGates.test.js +++ b/test/gates/BitCountGates.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {BitCountGates} from "src/gates/BitCountGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +import {Suite} from "../TestUtil.js" +import {BitCountGates} from "../../src/gates/BitCountGates.js" +import {InputGates} from "../../src/gates/InputGates.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Matrix} from "src/math/Matrix.js" -import {Util} from "src/base/Util.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("BitCountGates"); diff --git a/test/gates/ComparisonGates.test.js b/test/gates/ComparisonGates.test.js index 2ed915f5..f32113c6 100644 --- a/test/gates/ComparisonGates.test.js +++ b/test/gates/ComparisonGates.test.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {Gates} from "src/gates/AllGates.js" -import {ComparisonGates} from "src/gates/ComparisonGates.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +import {Suite} from "../TestUtil.js" +import {Gates} from "../../src/gates/AllGates.js" +import {ComparisonGates} from "../../src/gates/ComparisonGates.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Matrix} from "src/math/Matrix.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("ComparisonGates"); diff --git a/test/gates/Controls.test.js b/test/gates/Controls.test.js index 3af76bad..19d9780c 100644 --- a/test/gates/Controls.test.js +++ b/test/gates/Controls.test.js @@ -1,31 +1,33 @@ -// Copyright 2017 Google 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. - -import {assertThat, Suite} from "test/TestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js"; -import {Gate} from "src/circuit/Gate.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" - -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" -import {Util} from "src/base/Util.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js"; +/** + * Copyright 2017 Google 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. + */ + +import {assertThat, Suite} from "../TestUtil.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js"; +import {Gate} from "../../src/circuit/Gate.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Gates} from "../../src/gates/AllGates.js" + +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" +import {Util} from "../../src/base/Util.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js"; import { assertThatCircuitUpdateActsLikeMatrix, -} from "test/CircuitOperationTestUtil.js"; +} from "../CircuitOperationTestUtil.js"; let suite = new Suite("Gates.Controls"); diff --git a/test/gates/CycleBitsGates.test.js b/test/gates/CycleBitsGates.test.js index 8010446a..ef3d514a 100644 --- a/test/gates/CycleBitsGates.test.js +++ b/test/gates/CycleBitsGates.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {assertThatCircuitShaderActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {cycleBitsShader} from "src/gates/CycleBitsGates.js" +import {Suite} from "../TestUtil.js" +import {assertThatCircuitShaderActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {cycleBitsShader} from "../../src/gates/CycleBitsGates.js" -import {Matrix} from "src/math/Matrix.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("CycleBitsGates"); diff --git a/test/gates/DensityMatrixDisplay.test.js b/test/gates/DensityMatrixDisplay.test.js index 0c70d20f..03532183 100644 --- a/test/gates/DensityMatrixDisplay.test.js +++ b/test/gates/DensityMatrixDisplay.test.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {amplitudesToCouplings} from "src/gates/DensityMatrixDisplay.js" -import {Shaders} from "src/webgl/Shaders.js" +import {Suite, assertThat} from "../TestUtil.js" +import {amplitudesToCouplings} from "../../src/gates/DensityMatrixDisplay.js" +import {Shaders} from "../../src/webgl/Shaders.js" let suite = new Suite("DensityMatrixDisplay"); diff --git a/test/gates/Detector.test.js b/test/gates/Detector.test.js index dda9fc1e..d473669e 100644 --- a/test/gates/Detector.test.js +++ b/test/gates/Detector.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {Gates} from "src/gates/AllGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js"; -import {CircuitStats} from "src/circuit/CircuitStats.js"; -import {Matrix} from "src/math/Matrix.js"; +import {Suite, assertThat} from "../TestUtil.js" +import {Gates} from "../../src/gates/AllGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js"; +import {CircuitStats} from "../../src/circuit/CircuitStats.js"; +import {Matrix} from "../../src/math/Matrix.js"; let suite = new Suite("Detector"); diff --git a/test/gates/ExponentiatingGates.test.js b/test/gates/ExponentiatingGates.test.js index 071b4838..7e1adf90 100644 --- a/test/gates/ExponentiatingGates.test.js +++ b/test/gates/ExponentiatingGates.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {Gates} from "src/gates/AllGates.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" +import {Suite, assertThat} from "../TestUtil.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("ExponentiatingGates"); diff --git a/test/gates/FourierTransformGates.test.js b/test/gates/FourierTransformGates.test.js index 44f2b015..48765a8e 100644 --- a/test/gates/FourierTransformGates.test.js +++ b/test/gates/FourierTransformGates.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {applyControlledPhaseGradient, FourierTransformGates} from "src/gates/FourierTransformGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +import {Suite} from "../TestUtil.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {applyControlledPhaseGradient, FourierTransformGates} from "../../src/gates/FourierTransformGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("FourierTransformGates"); diff --git a/test/gates/Impossible_UniversalNotGate.test.js b/test/gates/Impossible_UniversalNotGate.test.js index fbd359a9..1e8ebd5a 100644 --- a/test/gates/Impossible_UniversalNotGate.test.js +++ b/test/gates/Impossible_UniversalNotGate.test.js @@ -1,25 +1,27 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {CircuitEvalContext} from "src/circuit/CircuitEvalContext.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {universalNot} from "src/gates/Impossible_UniversalNotGate.js" +import {Suite, assertThat} from "../TestUtil.js" +import {CircuitEvalContext} from "../../src/circuit/CircuitEvalContext.js" +import {CircuitShaders} from "../../src/circuit/CircuitShaders.js" +import {universalNot} from "../../src/gates/Impossible_UniversalNotGate.js" -import {Controls} from "src/circuit/Controls.js" -import {Shaders} from "src/webgl/Shaders.js" -import {WglTextureTrader} from "src/webgl/WglTextureTrader.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Shaders} from "../../src/webgl/Shaders.js" +import {WglTextureTrader} from "../../src/webgl/WglTextureTrader.js" let suite = new Suite("Impossible_UniverseNotGate"); diff --git a/test/gates/IncrementGates.test.js b/test/gates/IncrementGates.test.js index dc9fbd15..460fbe03 100644 --- a/test/gates/IncrementGates.test.js +++ b/test/gates/IncrementGates.test.js @@ -1,12 +1,28 @@ -import {Suite} from "test/TestUtil.js" -import {offsetShader, IncrementGates} from "src/gates/IncrementGates.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite} from "../TestUtil.js" +import {offsetShader, IncrementGates} from "../../src/gates/IncrementGates.js" import { assertThatCircuitShaderActsLikePermutation, assertThatGateActsLikePermutation, -} from "test/CircuitOperationTestUtil.js" +} from "../CircuitOperationTestUtil.js" -import {ketArgs} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" +import {ketArgs} from "../../src/circuit/KetShaderUtil.js" +import {WglArg} from "../../src/webgl/WglArg.js" let suite = new Suite("ArithmeticGates"); diff --git a/test/gates/InputGates.test.js b/test/gates/InputGates.test.js index bf446a1a..276b36c6 100644 --- a/test/gates/InputGates.test.js +++ b/test/gates/InputGates.test.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {assertThat, Suite} from "test/TestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Gates} from "src/gates/AllGates.js" -import {Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" +import {assertThat, Suite} from "../TestUtil.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Seq} from "../../src/base/Seq.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("InputGates"); diff --git a/test/gates/InterleaveBitsGates.test.js b/test/gates/InterleaveBitsGates.test.js index a58eeae8..5dcbf032 100644 --- a/test/gates/InterleaveBitsGates.test.js +++ b/test/gates/InterleaveBitsGates.test.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" import { interleaveBit, deinterleaveBit, -} from "src/gates/InterleaveBitsGates.js" +} from "../../src/gates/InterleaveBitsGates.js" let suite = new Suite("InterleaveBitsGates"); diff --git a/test/gates/ModularAdditionGates.test.js b/test/gates/ModularAdditionGates.test.js index 817a07c3..e59a001e 100644 --- a/test/gates/ModularAdditionGates.test.js +++ b/test/gates/ModularAdditionGates.test.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {assertThatGateActsLikePermutation, assertThatCircuitOutputsBasisKet} from "test/CircuitOperationTestUtil.js" +import {Suite} from "../TestUtil.js" +import {assertThatGateActsLikePermutation, assertThatCircuitOutputsBasisKet} from "../CircuitOperationTestUtil.js" -import {ModularAdditionGates} from "src/gates/ModularAdditionGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {Util} from "src/base/Util.js" +import {ModularAdditionGates} from "../../src/gates/ModularAdditionGates.js" +import {InputGates} from "../../src/gates/InputGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("ModularAdditionGates"); diff --git a/test/gates/ModularIncrementGates.test.js b/test/gates/ModularIncrementGates.test.js index 2c16b938..3b8ad314 100644 --- a/test/gates/ModularIncrementGates.test.js +++ b/test/gates/ModularIncrementGates.test.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. - -import {assertThat, Suite} from "test/TestUtil.js" -import {assertThatGateActsLikePermutation} from "test/CircuitOperationTestUtil.js" - -import {ModularIncrementGates} from "src/gates/ModularIncrementGates.js" -import {ModularAdditionGates} from "src/gates/ModularAdditionGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" +/** + * Copyright 2017 Google 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. + */ + +import {assertThat, Suite} from "../TestUtil.js" +import {assertThatGateActsLikePermutation} from "../CircuitOperationTestUtil.js" + +import {ModularIncrementGates} from "../../src/gates/ModularIncrementGates.js" +import {ModularAdditionGates} from "../../src/gates/ModularAdditionGates.js" +import {InputGates} from "../../src/gates/InputGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" let suite = new Suite("ModularIncrementGates"); diff --git a/test/gates/ModularMultiplicationGates.test.js b/test/gates/ModularMultiplicationGates.test.js index a374670f..2b3987a5 100644 --- a/test/gates/ModularMultiplicationGates.test.js +++ b/test/gates/ModularMultiplicationGates.test.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. - -import {assertThat, Suite} from "test/TestUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {assertThat, Suite} from "../TestUtil.js" import { MODULAR_INVERSE_SHADER_CODE, POW_MOD_SHADER_CODE, @@ -20,17 +22,17 @@ import { modularUnmultiply, modularPowerMultiply, ModularMultiplicationGates -} from "src/gates/ModularMultiplicationGates.js" - -import {assertThatGateActsLikePermutation} from "test/CircuitOperationTestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Gates} from "src/gates/AllGates.js" -import {Outputs, makePseudoShaderWithInputsAndOutputAndCode} from "src/webgl/ShaderCoders.js" -import {Seq} from "src/base/Seq.js" -import {Util} from "src/base/Util.js" -import {WglArg} from "src/webgl/WglArg.js" +} from "../../src/gates/ModularMultiplicationGates.js" + +import {assertThatGateActsLikePermutation} from "../CircuitOperationTestUtil.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Outputs, makePseudoShaderWithInputsAndOutputAndCode} from "../../src/webgl/ShaderCoders.js" +import {Seq} from "../../src/base/Seq.js" +import {Util} from "../../src/base/Util.js" +import {WglArg} from "../../src/webgl/WglArg.js" let suite = new Suite("ModularMultiplicationGates"); diff --git a/test/gates/ModularMultiplyAccumulateGates.test.js b/test/gates/ModularMultiplyAccumulateGates.test.js index e9127430..f2fa048e 100644 --- a/test/gates/ModularMultiplyAccumulateGates.test.js +++ b/test/gates/ModularMultiplyAccumulateGates.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {assertThatGateActsLikePermutation} from "test/CircuitOperationTestUtil.js" +import {Suite} from "../TestUtil.js" +import {assertThatGateActsLikePermutation} from "../CircuitOperationTestUtil.js" -import {ModularMultiplyAccumulateGates} from "src/gates/ModularMultiplyAccumulateGates.js" -import {Util} from "src/base/Util.js" +import {ModularMultiplyAccumulateGates} from "../../src/gates/ModularMultiplyAccumulateGates.js" +import {Util} from "../../src/base/Util.js" let suite = new Suite("ModularMultiplyAccumulateGates"); diff --git a/test/gates/MultiplicationGates.test.js b/test/gates/MultiplicationGates.test.js index 64047425..2bdb47bd 100644 --- a/test/gates/MultiplicationGates.test.js +++ b/test/gates/MultiplicationGates.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {Gates} from "src/gates/AllGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {modularMultiply, modularUnmultiply} from "src/gates/ModularMultiplicationGates.js" -import {assertThatGateActsLikePermutation, assertThatCircuitOutputsBasisKet} from "test/CircuitOperationTestUtil.js" +import {Suite} from "../TestUtil.js" +import {Gates} from "../../src/gates/AllGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {modularMultiply, modularUnmultiply} from "../../src/gates/ModularMultiplicationGates.js" +import {assertThatGateActsLikePermutation, assertThatCircuitOutputsBasisKet} from "../CircuitOperationTestUtil.js" let suite = new Suite("MultiplicationGates"); diff --git a/test/gates/MultiplyAccumulateGates.test.js b/test/gates/MultiplyAccumulateGates.test.js index 0250e481..64c9642f 100644 --- a/test/gates/MultiplyAccumulateGates.test.js +++ b/test/gates/MultiplyAccumulateGates.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {MultiplyAccumulateGates} from "src/gates/MultiplyAccumulateGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {assertThatCircuitOutputsBasisKet, assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +import {Suite} from "../TestUtil.js" +import {MultiplyAccumulateGates} from "../../src/gates/MultiplyAccumulateGates.js" +import {InputGates} from "../../src/gates/InputGates.js" +import {assertThatCircuitOutputsBasisKet, assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Matrix} from "src/math/Matrix.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("MultiplyAccumulateGates"); diff --git a/test/gates/ParametrizedRotationGates.test.js b/test/gates/ParametrizedRotationGates.test.js index b8103faf..fcfe364f 100644 --- a/test/gates/ParametrizedRotationGates.test.js +++ b/test/gates/ParametrizedRotationGates.test.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. - -import {assertThat, Suite} from "test/TestUtil.js" - -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Complex} from "src/math/Complex.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" +/** + * Copyright 2017 Google 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. + */ + +import {assertThat, Suite} from "../TestUtil.js" + +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {Complex} from "../../src/math/Complex.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("ParametrizedRotationGates"); diff --git a/test/gates/PhaseGradientGates.test.js b/test/gates/PhaseGradientGates.test.js index bd03d60f..49ef873c 100644 --- a/test/gates/PhaseGradientGates.test.js +++ b/test/gates/PhaseGradientGates.test.js @@ -1,28 +1,30 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" +import {Suite} from "../TestUtil.js" import { assertThatCircuitShaderActsLikeMatrix, assertThatGateActsLikePhaser, -} from "test/CircuitOperationTestUtil.js" -import {PHASE_GRADIENT_SHADER, PhaseGradientGates} from "src/gates/PhaseGradientGates.js" +} from "../CircuitOperationTestUtil.js" +import {PHASE_GRADIENT_SHADER, PhaseGradientGates} from "../../src/gates/PhaseGradientGates.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" -import {ketArgs} from "src/circuit/KetShaderUtil.js" -import {WglArg} from "src/webgl/WglArg.js" +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" +import {ketArgs} from "../../src/circuit/KetShaderUtil.js" +import {WglArg} from "../../src/webgl/WglArg.js" let suite = new Suite("PhaseGradientGates"); diff --git a/test/gates/PivotFlipGates.test.js b/test/gates/PivotFlipGates.test.js index defdfa60..b0d265e2 100644 --- a/test/gates/PivotFlipGates.test.js +++ b/test/gates/PivotFlipGates.test.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {assertThatCircuitOutputsBasisKet} from "test/CircuitOperationTestUtil.js" +import {Suite} from "../TestUtil.js" +import {assertThatCircuitOutputsBasisKet} from "../CircuitOperationTestUtil.js" -import {PivotFlipGates} from "src/gates/PivotFlipGates.js" -import {Gates} from "src/gates/AllGates.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" +import {PivotFlipGates} from "../../src/gates/PivotFlipGates.js" +import {Gates} from "../../src/gates/AllGates.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" let suite = new Suite("PivotFlipGates"); diff --git a/test/gates/ProbabilityDisplay.test.js b/test/gates/ProbabilityDisplay.test.js index a4d0cc20..bcac4c62 100644 --- a/test/gates/ProbabilityDisplay.test.js +++ b/test/gates/ProbabilityDisplay.test.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {amplitudesToProbabilities} from "src/gates/ProbabilityDisplay.js" +import {Suite, assertThat} from "../TestUtil.js" +import {amplitudesToProbabilities} from "../../src/gates/ProbabilityDisplay.js" -import {CircuitShaders} from "src/circuit/CircuitShaders.js" -import {Controls} from "src/circuit/Controls.js" -import {Shaders} from "src/webgl/Shaders.js" +import {CircuitShaders} from "../../src/circuit/CircuitShaders.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Shaders} from "../../src/webgl/Shaders.js" let suite = new Suite("ProbabilityDisplay"); diff --git a/test/gates/SampleDisplay.test.js b/test/gates/SampleDisplay.test.js index 86e7d185..5b658e5d 100644 --- a/test/gates/SampleDisplay.test.js +++ b/test/gates/SampleDisplay.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" +import {Suite, assertThat} from "../TestUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Serializer} from "src/circuit/Serializer.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {Serializer} from "../../src/circuit/Serializer.js" let suite = new Suite("SampleDisplay"); diff --git a/test/gates/XorGates.test.js b/test/gates/XorGates.test.js index b9543e9d..f559f4d3 100644 --- a/test/gates/XorGates.test.js +++ b/test/gates/XorGates.test.js @@ -1,26 +1,28 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite} from "test/TestUtil.js" -import {XorGates} from "src/gates/XorGates.js" -import {InputGates} from "src/gates/InputGates.js" -import {assertThatCircuitUpdateActsLikeMatrix} from "test/CircuitOperationTestUtil.js" -import {advanceStateWithCircuit} from "src/circuit/CircuitComputeUtil.js" +import {Suite} from "../TestUtil.js" +import {XorGates} from "../../src/gates/XorGates.js" +import {InputGates} from "../../src/gates/InputGates.js" +import {assertThatCircuitUpdateActsLikeMatrix} from "../CircuitOperationTestUtil.js" +import {advanceStateWithCircuit} from "../../src/circuit/CircuitComputeUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {GateColumn} from "src/circuit/GateColumn.js" -import {Matrix} from "src/math/Matrix.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {GateColumn} from "../../src/circuit/GateColumn.js" +import {Matrix} from "../../src/math/Matrix.js" let suite = new Suite("XorGates"); diff --git a/test/math/Axis.test.js b/test/math/Axis.test.js index 7e5db0dc..528e8394 100644 --- a/test/math/Axis.test.js +++ b/test/math/Axis.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {Axis} from "src/math/Axis.js" +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {Axis} from "../../src/math/Axis.js" let suite = new Suite("Axis"); diff --git a/test/math/Complex.test.js b/test/math/Complex.test.js index 8d8dfecf..474e7812 100644 --- a/test/math/Complex.test.js +++ b/test/math/Complex.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue} from "test/TestUtil.js" -import {Complex} from "src/math/Complex.js" - -import {Format} from "src/base/Format.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue} from "../TestUtil.js" +import {Complex} from "../../src/math/Complex.js" + +import {Format} from "../../src/base/Format.js" let suite = new Suite("Complex"); diff --git a/test/math/Matrix.test.js b/test/math/Matrix.test.js index 0b1e5c82..cd4adf2d 100644 --- a/test/math/Matrix.test.js +++ b/test/math/Matrix.test.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "test/TestUtil.js" -import {Matrix} from "src/math/Matrix.js" - -import {Complex} from "src/math/Complex.js" -import {Controls} from "src/circuit/Controls.js" -import {Format} from "src/base/Format.js" -import {Seq} from "src/base/Seq.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows, assertTrue, assertFalse} from "../TestUtil.js" +import {Matrix} from "../../src/math/Matrix.js" + +import {Complex} from "../../src/math/Complex.js" +import {Controls} from "../../src/circuit/Controls.js" +import {Format} from "../../src/base/Format.js" +import {Seq} from "../../src/base/Seq.js" let suite = new Suite("Matrix"); diff --git a/test/math/Point.test.js b/test/math/Point.test.js index 814f3765..78127890 100644 --- a/test/math/Point.test.js +++ b/test/math/Point.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertTrue, assertFalse} from "test/TestUtil.js" -import {Point} from "src/math/Point.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertTrue, assertFalse} from "../TestUtil.js" +import {Point} from "../../src/math/Point.js" let suite = new Suite("Point"); diff --git a/test/math/Rect.test.js b/test/math/Rect.test.js index 87c7ccd8..f2426e6c 100644 --- a/test/math/Rect.test.js +++ b/test/math/Rect.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertTrue, assertFalse} from "test/TestUtil.js" -import {Rect} from "src/math/Rect.js" - -import {Point} from "src/math/Point.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertTrue, assertFalse} from "../TestUtil.js" +import {Rect} from "../../src/math/Rect.js" + +import {Point} from "../../src/math/Point.js" let suite = new Suite("Rect"); diff --git a/test/ui/DisplayedCircuit.test.js b/test/ui/DisplayedCircuit.test.js index e91c46f0..417e577e 100644 --- a/test/ui/DisplayedCircuit.test.js +++ b/test/ui/DisplayedCircuit.test.js @@ -1,27 +1,29 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" -import {DisplayedCircuit} from "src/ui/DisplayedCircuit.js" +import {Suite, assertThat, assertThrows} from "../TestUtil.js" +import {DisplayedCircuit} from "../../src/ui/DisplayedCircuit.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Gates} from "src/gates/AllGates.js" -import {Point} from "src/math/Point.js" -import {RestartableRng} from "src/base/RestartableRng.js" -import {Hand} from "src/ui/Hand.js" -import {Painter} from "src/draw/Painter.js" +import {CircuitDefinition} from "../../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../../src/circuit/CircuitStats.js" +import {Gates} from "../../src/gates/AllGates.js" +import {Point} from "../../src/math/Point.js" +import {RestartableRng} from "../../src/base/RestartableRng.js" +import {Hand} from "../../src/ui/Hand.js" +import {Painter} from "../../src/draw/Painter.js" const COMMON_GATES = new Map([ ['X', Gates.HalfTurns.X], diff --git a/test/ui/MathPainter.test.js b/test/ui/MathPainter.test.js index d201acf7..bc11f199 100644 --- a/test/ui/MathPainter.test.js +++ b/test/ui/MathPainter.test.js @@ -1,19 +1,21 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {MathPainter} from "src/draw/MathPainter.js" +import {Suite, assertThat} from "../TestUtil.js" +import {MathPainter} from "../../src/draw/MathPainter.js" let suite = new Suite("MathPainter"); diff --git a/test/ui/Painter.test.js b/test/ui/Painter.test.js index 6d64066b..1749b542 100644 --- a/test/ui/Painter.test.js +++ b/test/ui/Painter.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {Painter} from "src/draw/Painter.js" +import {Suite, assertThat} from "../TestUtil.js" +import {Painter} from "../../src/draw/Painter.js" -import {Point} from "src/math/Point.js" -import {Rect} from "src/math/Rect.js" +import {Point} from "../../src/math/Point.js" +import {Rect} from "../../src/math/Rect.js" let suite = new Suite("Painter"); diff --git a/test/ui/WidgetPainter.test.js b/test/ui/WidgetPainter.test.js index 1de07b47..5420695e 100644 --- a/test/ui/WidgetPainter.test.js +++ b/test/ui/WidgetPainter.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {WidgetPainter} from "src/draw/WidgetPainter.js" - -import {Format} from "src/base/Format.js" -import {Complex} from "src/math/Complex.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {WidgetPainter} from "../../src/draw/WidgetPainter.js" + +import {Format} from "../../src/base/Format.js" +import {Complex} from "../../src/math/Complex.js" let suite = new Suite("WidgetPainter"); diff --git a/test/ui/forge.test.js b/test/ui/forge.test.js index 571d3a42..9f138645 100644 --- a/test/ui/forge.test.js +++ b/test/ui/forge.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" -import {Complex} from "src/math/Complex.js" -import {Matrix} from "src/math/Matrix.js" -import {parseUserMatrix, parseUserRotation} from "src/ui/forge.js" +import {Suite, assertThat, assertThrows} from "../TestUtil.js" +import {Complex} from "../../src/math/Complex.js" +import {Matrix} from "../../src/math/Matrix.js" +import {parseUserMatrix, parseUserRotation} from "../../src/ui/forge.js" let suite = new Suite("forge"); diff --git a/test/webgl/ShaderCoders.test.js b/test/webgl/ShaderCoders.test.js index 60dec3a1..6f5e5d95 100644 --- a/test/webgl/ShaderCoders.test.js +++ b/test/webgl/ShaderCoders.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs} from "src/webgl/ShaderCoders.js" -import {currentShaderCoder} from "src/webgl/ShaderCoders.js" -import {Shaders} from "src/webgl/Shaders.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs} from "../../src/webgl/ShaderCoders.js" +import {currentShaderCoder} from "../../src/webgl/ShaderCoders.js" +import {Shaders} from "../../src/webgl/Shaders.js" let suite = new Suite("ShaderCoders"); diff --git a/test/webgl/ShaderCoders_Base.test.js b/test/webgl/ShaderCoders_Base.test.js index fca8cb92..4e2f6ce4 100644 --- a/test/webgl/ShaderCoders_Base.test.js +++ b/test/webgl/ShaderCoders_Base.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" +import {Suite, assertThat} from "../TestUtil.js" -import {BOOL_TYPE_CODER} from "src/webgl/ShaderCoders_Base.js" -import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs} from "src/webgl/ShaderCoders.js" -import {Shaders} from "src/webgl/Shaders.js" +import {BOOL_TYPE_CODER} from "../../src/webgl/ShaderCoders_Base.js" +import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs} from "../../src/webgl/ShaderCoders.js" +import {Shaders} from "../../src/webgl/Shaders.js" let suite = new Suite("ShaderCoders_Base"); diff --git a/test/webgl/ShaderCoders_intoBytes.test.js b/test/webgl/ShaderCoders_intoBytes.test.js index 3c68abe5..3f42a71a 100644 --- a/test/webgl/ShaderCoders_intoBytes.test.js +++ b/test/webgl/ShaderCoders_intoBytes.test.js @@ -1,31 +1,33 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat, assertThrows} from "../TestUtil.js" import { bytesAsFloats, floatsAsBytes, PACK_FLOAT_INTO_BYTES_CODE, SHADER_CODER_BYTES, UNPACK_BYTES_INTO_FLOAT_CODE, -} from "src/webgl/ShaderCoders_intoBytes.js" -import {SHADER_CODER_FLOATS} from "src/webgl/ShaderCoders_intoFloats.js" -import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs } from "src/webgl/ShaderCoders.js" -import {Seq} from "src/base/Seq.js" -import {Shaders} from "src/webgl/Shaders.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglShader} from "src/webgl/WglShader.js" +} from "../../src/webgl/ShaderCoders_intoBytes.js" +import {SHADER_CODER_FLOATS} from "../../src/webgl/ShaderCoders_intoFloats.js" +import {combinedShaderPartsWithCode, shaderWithOutputPartAndArgs } from "../../src/webgl/ShaderCoders.js" +import {Seq} from "../../src/base/Seq.js" +import {Shaders} from "../../src/webgl/Shaders.js" +import {WglArg} from "../../src/webgl/WglArg.js" +import {WglShader} from "../../src/webgl/WglShader.js" let suite = new Suite("ShaderCoders_intoBytes"); diff --git a/test/webgl/ShaderCoders_intoFloats.test.js b/test/webgl/ShaderCoders_intoFloats.test.js index 8540cabe..87952dd5 100644 --- a/test/webgl/ShaderCoders_intoFloats.test.js +++ b/test/webgl/ShaderCoders_intoFloats.test.js @@ -1,20 +1,22 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" -import {SHADER_CODER_FLOATS} from "src/webgl/ShaderCoders_intoFloats.js" -import {Shaders} from "src/webgl/Shaders.js" +import {Suite, assertThat, assertThrows} from "../TestUtil.js" +import {SHADER_CODER_FLOATS} from "../../src/webgl/ShaderCoders_intoFloats.js" +import {Shaders} from "../../src/webgl/Shaders.js" let suite = new Suite("ShaderCoders"); diff --git a/test/webgl/Shaders.test.js b/test/webgl/Shaders.test.js index 9c5e6b45..c3bbbb51 100644 --- a/test/webgl/Shaders.test.js +++ b/test/webgl/Shaders.test.js @@ -1,27 +1,29 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat, assertThrows} from "test/TestUtil.js" -import {Shaders} from "src/webgl/Shaders.js" +import {Suite, assertThat, assertThrows} from "../TestUtil.js" +import {Shaders} from "../../src/webgl/Shaders.js" import { Outputs, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" +} from "../../src/webgl/ShaderCoders.js" +import {WglShader} from "../../src/webgl/WglShader.js" +import {WglTexture} from "../../src/webgl/WglTexture.js" -import {Seq} from "src/base/Seq.js" +import {Seq} from "../../src/base/Seq.js" let suite = new Suite("Shaders"); diff --git a/test/webgl/WglArg.test.js b/test/webgl/WglArg.test.js index c5a07e80..1cac6607 100644 --- a/test/webgl/WglArg.test.js +++ b/test/webgl/WglArg.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. - -import {Suite, assertThat} from "test/TestUtil.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" +/** + * Copyright 2017 Google 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. + */ + +import {Suite, assertThat} from "../TestUtil.js" +import {WglArg} from "../../src/webgl/WglArg.js" +import {WglShader} from "../../src/webgl/WglShader.js" +import {WglTexture} from "../../src/webgl/WglTexture.js" let suite = new Suite("WglArg"); diff --git a/test/webgl/WglShader.test.js b/test/webgl/WglShader.test.js index f2344912..ffe2817b 100644 --- a/test/webgl/WglShader.test.js +++ b/test/webgl/WglShader.test.js @@ -1,22 +1,24 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" -import {Seq} from "src/base/Seq.js" -import {initializedWglContext} from "src/webgl/WglContext.js" +import {Suite, assertThat} from "../TestUtil.js" +import {WglShader} from "../../src/webgl/WglShader.js" +import {WglTexture} from "../../src/webgl/WglTexture.js" +import {Seq} from "../../src/base/Seq.js" +import {initializedWglContext} from "../../src/webgl/WglContext.js" let suite = new Suite("WglShader"); diff --git a/test/webgl/WglTexture.test.js b/test/webgl/WglTexture.test.js index 532ee603..d240d456 100644 --- a/test/webgl/WglTexture.test.js +++ b/test/webgl/WglTexture.test.js @@ -1,21 +1,23 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" -import {WglArg} from "src/webgl/WglArg.js" -import {WglShader} from "src/webgl/WglShader.js" -import {WglTexture} from "src/webgl/WglTexture.js" +import {Suite, assertThat} from "../TestUtil.js" +import {WglArg} from "../../src/webgl/WglArg.js" +import {WglShader} from "../../src/webgl/WglShader.js" +import {WglTexture} from "../../src/webgl/WglTexture.js" let suite = new Suite("WglTexture"); diff --git a/test/webgl/WglTexturePool.test.js b/test/webgl/WglTexturePool.test.js index f6840c11..aade5021 100644 --- a/test/webgl/WglTexturePool.test.js +++ b/test/webgl/WglTexturePool.test.js @@ -1,24 +1,26 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {Suite, assertThat} from "test/TestUtil.js" +import {Suite, assertThat} from "../TestUtil.js" import { currentShaderCoder, Outputs, makePseudoShaderWithInputsAndOutputAndCode -} from "src/webgl/ShaderCoders.js" -import {WglTexturePool} from "src/webgl/WglTexturePool.js" +} from "../../src/webgl/ShaderCoders.js" +import {WglTexturePool} from "../../src/webgl/WglTexturePool.js" let suite = new Suite("WglTexturePool"); diff --git a/test_perf/CircuitStats.perf.js b/test_perf/CircuitStats.perf.js index b6277c53..d6f2ff84 100644 --- a/test_perf/CircuitStats.perf.js +++ b/test_perf/CircuitStats.perf.js @@ -1,23 +1,25 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {perfGoal, millis} from "test_perf/TestPerfUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Gate} from "src/circuit/Gate.js" -import {Gates} from "src/gates/AllGates.js" -import {Matrix} from "src/math/Matrix.js" +import {perfGoal, millis} from "./TestPerfUtil.js" +import {CircuitDefinition} from "../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../src/circuit/CircuitStats.js" +import {Gate} from "../src/circuit/Gate.js" +import {Gates} from "../src/gates/AllGates.js" +import {Matrix} from "../src/math/Matrix.js" const diagram = (diagram, ...extras) => CircuitDefinition.fromTextDiagram(new Map([ ...extras, diff --git a/test_perf/DisplayedInspector.perf.js b/test_perf/DisplayedInspector.perf.js index 1adbf32b..aa87d251 100644 --- a/test_perf/DisplayedInspector.perf.js +++ b/test_perf/DisplayedInspector.perf.js @@ -1,28 +1,30 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {perfGoal, millis} from "test_perf/TestPerfUtil.js" -import {CircuitDefinition} from "src/circuit/CircuitDefinition.js" -import {CircuitStats} from "src/circuit/CircuitStats.js" -import {Rect} from "src/math/Rect.js" -import {Gates} from "src/gates/AllGates.js" -import {Hand} from "src/ui/Hand.js" -import {Painter} from "src/draw/Painter.js" -import {RestartableRng} from "src/base/RestartableRng.js" -import {DisplayedCircuit} from "src/ui/DisplayedCircuit.js" -import {DisplayedInspector} from "src/ui/DisplayedInspector.js" -import {Serializer} from "src/circuit/Serializer.js" +import {perfGoal, millis} from "./TestPerfUtil.js" +import {CircuitDefinition} from "../src/circuit/CircuitDefinition.js" +import {CircuitStats} from "../src/circuit/CircuitStats.js" +import {Rect} from "../src/math/Rect.js" +import {Gates} from "../src/gates/AllGates.js" +import {Hand} from "../src/ui/Hand.js" +import {Painter} from "../src/draw/Painter.js" +import {RestartableRng} from "../src/base/RestartableRng.js" +import {DisplayedCircuit} from "../src/ui/DisplayedCircuit.js" +import {DisplayedInspector} from "../src/ui/DisplayedInspector.js" +import {Serializer} from "../src/circuit/Serializer.js" perfGoal( "Update inspector circuit", diff --git a/test_perf/KarmaTestRunner.perf.js b/test_perf/KarmaTestRunner.perf.js index f8642b2a..2fd002bf 100644 --- a/test_perf/KarmaTestRunner.perf.js +++ b/test_perf/KarmaTestRunner.perf.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {getKnownPerfTests} from "test_perf/TestPerfUtil.js"; +import {getKnownPerfTests} from "./TestPerfUtil.js"; let execIntoPromise = method => { try { diff --git a/test_perf/TestPerfUtil.js b/test_perf/TestPerfUtil.js index a1bc5345..eac53570 100644 --- a/test_perf/TestPerfUtil.js +++ b/test_perf/TestPerfUtil.js @@ -1,18 +1,20 @@ -// Copyright 2017 Google 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. +/** + * Copyright 2017 Google 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. + */ -import {} from "src/browser/Polyfills.js" +import {} from "../src/browser/Polyfills.js" function nanos(nanoseconds) { return {