Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc authored Aug 15, 2017
2 parents 826d3b4 + 0ba0b2e commit 46b21c2
Show file tree
Hide file tree
Showing 190 changed files with 2,673 additions and 7 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
14 changes: 14 additions & 0 deletions GruntFile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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');

module.exports = function(grunt) {
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 Craig Gidney
Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion html/quirk.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<button id="export-button" style="min-width: 50px; min-height: 30px;">Export</button>
&nbsp;
&nbsp;
<button id="clear-button" style="min-width: 50px; min-height: 30px;">Clear ALL</button>
<button id="clear-circuit-button" style="min-width: 50px; min-height: 30px;">Clear Circuit</button>
<button id="clear-all-button" style="min-width: 50px; min-height: 30px;">Clear ALL</button>
&nbsp;
&nbsp;
<button id="undo-button" style="min-width: 50px; min-height: 30px;">Undo</button>
Expand Down
14 changes: 14 additions & 0 deletions karma.test.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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({
basePath: '',
Expand Down
14 changes: 14 additions & 0 deletions karma.test_perf.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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({
basePath: '',
Expand Down
14 changes: 14 additions & 0 deletions src/Config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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.
*/
Expand Down
14 changes: 14 additions & 0 deletions src/base/CooldownThrottle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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.
*
Expand Down
14 changes: 14 additions & 0 deletions src/base/Describe.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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();
const RECURSE_LIMIT_DESCRIPTION = "!recursion-limit!";
Expand Down
14 changes: 14 additions & 0 deletions src/base/DetailedError.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

let CONSTRUCTOR_CALLS_NESTING = 0;
Expand Down
14 changes: 14 additions & 0 deletions src/base/Equate.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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.
*
Expand Down
14 changes: 14 additions & 0 deletions src/base/Format.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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.
*/
Expand Down
14 changes: 14 additions & 0 deletions src/base/Obs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

/**
Expand Down
14 changes: 14 additions & 0 deletions src/base/RestartableRng.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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.
*/
Expand Down
22 changes: 22 additions & 0 deletions src/base/Revision.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"
Expand Down Expand Up @@ -46,6 +60,14 @@ class Revision {
return this._latestActiveCommit.observable();
}

/**
* Returns a snapshot of the current commit.
* @returns {*}
*/
peekActiveCommit() {
return this._latestActiveCommit.get();
}

/**
* Returns a cleared revision history, starting at the given state.
* @param {*} state
Expand Down
14 changes: 14 additions & 0 deletions src/base/Seq.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

export const THROW_IF_EMPTY = { if_same_instance_as_this_then_throw: true };
Expand Down
14 changes: 14 additions & 0 deletions src/base/Util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

/**
Expand Down
14 changes: 14 additions & 0 deletions src/browser/Clipboard.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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
* @throws
Expand Down
14 changes: 14 additions & 0 deletions src/browser/EventUtil.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

/**
Expand Down
14 changes: 14 additions & 0 deletions src/browser/HistoryPusher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

/**
Expand Down
14 changes: 14 additions & 0 deletions src/browser/MouseWatcher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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"

const ALLOW_REGRAB_WATCHDOG_TIME_MS = 5000;
Expand Down
14 changes: 14 additions & 0 deletions src/browser/Polyfills.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT 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) {
return new Float32Array(Array.from(this).slice(a, b));
Expand Down
Loading

0 comments on commit 46b21c2

Please sign in to comment.