Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [pull_request]
jobs:
lint:
name: Lint check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
Expand All @@ -19,7 +19,7 @@ jobs:

format:
name: Formatting check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
Expand All @@ -34,7 +34,7 @@ jobs:

wheel-build:
name: Wheel test
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
Expand All @@ -53,7 +53,7 @@ jobs:

bazel-tests:
name: Library tests
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: [lint, format]

steps:
Expand All @@ -71,7 +71,7 @@ jobs:

leak-tests:
name: Memory Leak tests
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: [lint, format]

steps:
Expand All @@ -89,7 +89,7 @@ jobs:

tutorials-test:
name: Tutorial tests
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: [lint, format, wheel-build]

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cirq_compatibility.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Cirq Compatibility

on:
Expand All @@ -7,7 +8,7 @@ on:
jobs:
consistency:
name: Nightly Compatibility
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_clifford_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Benchmark simulators against classically simulatable circuits."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_op_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Benchmark differentiator methods."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_random_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Benchmark simulators against classically intractable 'supremacy' circuits."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Utility functions for benchmark tools."""
import tensorflow as tf
import test_log_pb2
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Tests for utilities related to reading/running benchmarks."""
import os
import tempfile
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Command line flags shared between benchmarks."""
from collections import namedtuple
from absl import flags as absl_flags
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/flags_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Tests for benchmark command line flags."""

import tensorflow as tf
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/random_clifford_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================

from typing import Iterable

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/random_clifford_circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================

from absl.testing import parameterized
import cirq
Expand Down
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"

function write_to_bazelrc() {
Expand Down
2 changes: 1 addition & 1 deletion docs/_book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
upper_tabs:
# Tabs left of dropdown menu
- include: /_upper_tabs_left.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
book_path: /quantum/_book.yaml
project_path: /quantum/_project.yaml
description: >
Expand Down
2 changes: 1 addition & 1 deletion release/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
set -e
set -x

Expand Down
2 changes: 1 addition & 1 deletion release/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""TensorFlow Quantum adds qauntum computing primitives to TensorFlow.

TensorFlow Quantum is an open source library for high performance batch
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmark_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Testing benchmarks.";
test_outputs=$(bazel test -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" --cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" --test_output=errors $(bazel query //benchmarks/...))
exit_code=$?
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Tool to generate external api_docs for tfq."""

from __future__ import absolute_import
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_pip_package_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================

pip install -r requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
pip install --upgrade pip setuptools wheel
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_validate_tutorials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================

# Run the tutorials using the installed pip package
pip install jupyter nbclient==0.6.5 jupyter-client==6.1.12 ipython==7.22.0
Expand Down
4 changes: 2 additions & 2 deletions scripts/format_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Doing python language formatting..."
python3 -m yapf --style=google --in-place --recursive ./benchmarks
python3 -m yapf --style=google --in-place --recursive ./tensorflow_quantum
echo -e "Done! \nDoing notebook formatting..."
python3 ./scripts/format_ipynb.py
echo -e "Done! \nDoing C++ formatting..."
find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format -i -style=google
find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format-6.0 -i -style=google
echo "Done!"
exit 0;
4 changes: 2 additions & 2 deletions scripts/format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Checking python formatting...";

################################################################################
Expand Down Expand Up @@ -92,7 +92,7 @@ else
fi

echo "Checking C++ formatting...";
formatting_outputs=$(find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format -style=google -output-replacements-xml);
formatting_outputs=$(find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format-6.0 -style=google -output-replacements-xml);
CFORMATCHECK=0
while read -r formatting_outputs; do
if [ "$formatting_outputs" != "<?xml version='1.0'?>" ] && [ "$formatting_outputs" != "<replacements xml:space='preserve' incomplete_format='false'>" ] && [ "$formatting_outputs" != "</replacements>" ] && [ "$formatting_outputs" != "<replacement offset='4290' length='9'> </replacement>" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/format_ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Format notebook code cells using yapf google style."""
import glob
import nbformat
Expand Down
2 changes: 1 addition & 1 deletion scripts/import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Tests to check if importing `tfq` APIs is successful or not."""
import tensorflow_quantum as tfq

Expand Down
2 changes: 1 addition & 1 deletion scripts/lint_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Checking for lint in python code...";
linting_outputs=$(pylint --rcfile .pylintrc ./tensorflow_quantum ./examples);
exit_code=$?
Expand Down
2 changes: 1 addition & 1 deletion scripts/msan_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Testing All Bazel cc_tests with msan.";
test_outputs=$(bazel test -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" \
--cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
cd ..
cp quantum/scripts/import_test.py import_test.py
python import_test.py
2 changes: 1 addition & 1 deletion scripts/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Testing All Bazel py_test and cc_tests.";
test_outputs=$(bazel test -c opt --experimental_repo_remote_exec --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" --cxxopt="-std=c++17" --cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" --notest_keep_going --test_output=errors //tensorflow_quantum/...)
exit_code=$?
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
echo "Testing all Benchmarks.";
bazel test -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" --cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" --test_output=errors $(bazel query //benchmarks/scripts:all)
# test_outputs=$(bazel test -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" --cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" --test_output=errors $(bazel query //benchmarks/scripts:all))
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT 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 to ensure all notebooks execute without error by pytesting them."""
import glob
import re
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT 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 functions for tensorflow_quantum.*"""

# Import basic ops and op getters.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# =============================================================================
"""Imports to tensorflow_quantum.core.* level."""
# Import getters for constructing ops.
from tensorflow_quantum.core.ops import (get_expectation_op,
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT 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 for tfq.core.ops.*"""

# Import getters for constructing ops.
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_quantum/core/ops/batch_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT 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 module to for running Cirq objects."""
import collections

Expand Down
Loading