diff --git a/.github/workflows/ci-build-checks.yaml b/.github/workflows/ci-build-checks.yaml index b7ff4461b..912d529e5 100644 --- a/.github/workflows/ci-build-checks.yaml +++ b/.github/workflows/ci-build-checks.yaml @@ -18,12 +18,77 @@ run-name: Continuous integration build and test on: pull_request: branches: - - master + - main merge_group: types: - checks_requested + push: + branches: + - main + + # Allow manual invocation, with options that can be useful for debugging. + workflow_dispatch: + inputs: + sha: + description: 'SHA of commit to run against:' + type: string + required: true + + python_ver: + description: 'Python version:' + type: string + default: '3.10.15' + + extra_bazel_options: + description: 'Extra Bazel options:' + type: string + + remake_python_cache: + description: 'Delete & remake the Python cache' + type: boolean + default: false + + debug: + description: 'Print additional workflow info' + type: boolean + default: false + +env: + # Default Python version to use. Important: give it a full x.y.z number. + python_ver: '3.10.15' + + # Additional .bazelrc options to use. + bazelrc_additions: | + common -c opt + common --announce_rc + common --color=no + common --experimental_repo_remote_exec + common --remote_upload_local_results=false + common --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" + common --cxxopt="-std=c++17" + common --cxxopt="-msse2" + common --cxxopt="-msse3" + common --cxxopt="-msse4" + build --verbose_failures + build --auto_output_filter=none + build --show_progress_rate_limit=1 + test --test_output=errors + test --test_summary=detailed + + # Note: these regexes are Bash regex syntax, NOT path glob syntax. + # Also, do not put dashes in front of the values. + ignore_patterns: |- + .*\.md$ + .*\.jpg$ + .*\.png$ + ^\.gitignore + ^\.pylintrc + ^\.yamllint.yaml + ^\.github/problem-matchers/.* + ^benchmarks/.* + concurrency: cancel-in-progress: true group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}} diff --git a/.github/workflows/ci-file-checks.yaml b/.github/workflows/ci-file-checks.yaml index 166af5c90..ab5c614b7 100644 --- a/.github/workflows/ci-file-checks.yaml +++ b/.github/workflows/ci-file-checks.yaml @@ -32,7 +32,7 @@ on: pull_request: types: [opened, synchronize] branches: - - master + - main merge_group: types: @@ -40,7 +40,7 @@ on: push: branches: - - master + - main # Allow manual invocation, with options that can be useful for debugging. workflow_dispatch: diff --git a/README.md b/README.md index 026bd2c22..8e305e939 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ src="docs/images/logo/tf_quantum1.svg"> High-performance Python framework for hybrid quantum-classical machine learning [![Licensed under the Apache 2.0 -license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative&logoColor=white&style=flat-square)](https://github.com/tensorflow/quantum/blob/master/LICENSE) +license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative&logoColor=white&style=flat-square)](https://github.com/tensorflow/quantum/blob/main/LICENSE) [![Compatible with Python versions 3.10 and higher](https://img.shields.io/badge/Python-3.10+-fcbc2c.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/) [![TensorFlow Quantum project on @@ -84,7 +84,7 @@ including tutorials and API documentation, can be found online at the TensorFlow.org web site. All of the examples can be found in GitHub in the form of [Python notebook -tutorials](https://github.com/tensorflow/quantum/tree/master/docs/tutorials) +tutorials](https://github.com/tensorflow/quantum/tree/main/docs/tutorials) ## Getting help diff --git a/docs/design.md b/docs/design.md index a82bc9716..b0679c637 100644 --- a/docs/design.md +++ b/docs/design.md @@ -76,7 +76,7 @@ with AVX2 and SSE instructions). Ops with identical functional signatures were created that use a physical quantum computer. Switching between a simulated and physical quantum computer is as easy as changing a single line of code. These ops are located in the -circuit_execution_ops.py. +circuit_execution_ops.py. ### Layers diff --git a/docs/install.md b/docs/install.md index 821b0a761..915a45f92 100644 --- a/docs/install.md +++ b/docs/install.md @@ -5,7 +5,7 @@ There are a few ways to set up your environment to use TensorFlow Quantum (TFQ): * The easiest way to learn and use TFQ requires no installation—run the [TensorFlow Quantum tutorials](./tutorials/hello_many_worlds.ipynb) directly in your browser using - [Google Colab](https://colab.research.google.com/github/tensorflow/quantum/blob/master/docs/tutorials/hello_many_worlds.ipynb). + [Google Colab](https://colab.research.google.com/github/tensorflow/quantum/blob/main/docs/tutorials/hello_many_worlds.ipynb). * To use TensorFlow Quantum on a local machine, install the TFQ package using Python's pip package manager. * Or build TensorFlow Quantum from source. diff --git a/docs/tutorials/barren_plateaus.ipynb b/docs/tutorials/barren_plateaus.ipynb index 1e4d47f91..369a096eb 100644 --- a/docs/tutorials/barren_plateaus.ipynb +++ b/docs/tutorials/barren_plateaus.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -56,10 +56,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/gradients.ipynb b/docs/tutorials/gradients.ipynb index 5f8fe9ebb..9556395b2 100644 --- a/docs/tutorials/gradients.ipynb +++ b/docs/tutorials/gradients.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -56,10 +56,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/hello_many_worlds.ipynb b/docs/tutorials/hello_many_worlds.ipynb index 5530596eb..bacde2084 100644 --- a/docs/tutorials/hello_many_worlds.ipynb +++ b/docs/tutorials/hello_many_worlds.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -59,10 +59,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/mnist.ipynb b/docs/tutorials/mnist.ipynb index 146be6da8..ff5987704 100644 --- a/docs/tutorials/mnist.ipynb +++ b/docs/tutorials/mnist.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -56,10 +56,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/noise.ipynb b/docs/tutorials/noise.ipynb index 9fbd62071..ee27bfe48 100644 --- a/docs/tutorials/noise.ipynb +++ b/docs/tutorials/noise.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -51,10 +51,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/qcnn.ipynb b/docs/tutorials/qcnn.ipynb index f547ce6bd..ce93661c3 100644 --- a/docs/tutorials/qcnn.ipynb +++ b/docs/tutorials/qcnn.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -59,10 +59,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/quantum_data.ipynb b/docs/tutorials/quantum_data.ipynb index 3a7a2813d..c90f037a6 100644 --- a/docs/tutorials/quantum_data.ipynb +++ b/docs/tutorials/quantum_data.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -56,10 +56,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/quantum_reinforcement_learning.ipynb b/docs/tutorials/quantum_reinforcement_learning.ipynb index d12e254a5..58d8cafa5 100644 --- a/docs/tutorials/quantum_reinforcement_learning.ipynb +++ b/docs/tutorials/quantum_reinforcement_learning.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -50,10 +50,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/docs/tutorials/research_tools.ipynb b/docs/tutorials/research_tools.ipynb index ae6d8e2be..bd409d66a 100644 --- a/docs/tutorials/research_tools.ipynb +++ b/docs/tutorials/research_tools.ipynb @@ -1,4 +1,4 @@ -{ +{ "cells": [ { "cell_type": "markdown", @@ -51,10 +51,10 @@ " View on TensorFlow.org\n", " \n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", " \n", " Download notebook\n", diff --git a/scripts/build_docs.py b/scripts/build_docs.py index dc47df224..b1e3b0048 100644 --- a/scripts/build_docs.py +++ b/scripts/build_docs.py @@ -31,7 +31,7 @@ flags.DEFINE_string("output_dir", "/tmp/tfq_api", "Where to output the docs") flags.DEFINE_string("code_url_prefix", - ("https://github.com/tensorflow/quantum/tree/master/" + ("https://github.com/tensorflow/quantum/tree/main/" "tensorflow_quantum"), "The url prefix for links to code.") flags.DEFINE_bool("search_hints", True, diff --git a/scripts/format_check.sh b/scripts/format_check.sh index f0de918dc..a898a6fcf 100755 --- a/scripts/format_check.sh +++ b/scripts/format_check.sh @@ -21,9 +21,9 @@ echo "Checking python formatting..."; # The base git revision to compare against is chosen from the following defaults, # in order, until one exists: # -# 1. upstream/master -# 2. origin/master -# 3. master +# 1. upstream/main +# 2. origin/main +# 3. main # # If none exists, the script fails. ################################################################################ @@ -41,12 +41,12 @@ done # Figure out which branch to compare against. if [ -z "${rev}" ]; then - if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then - rev=upstream/master - elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then - rev=origin/master - elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then - rev=master + if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then + rev=upstream/main + elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then + rev=origin/main + elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then + rev=main else echo -e "\033[31mNo default revision found to compare against.\033[0m" >&2 exit 1 @@ -100,7 +100,7 @@ if [ $? -ne 0 ]; then 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 -style=google -output-replacements-xml); CFORMATCHECK=0 while read -r formatting_outputs; do if [ "$formatting_outputs" != "" ] && [ "$formatting_outputs" != "" ] && [ "$formatting_outputs" != "" ] && [ "$formatting_outputs" != " " ]; then