Skip to content

Commit 52f8f8e

Browse files
authored
Merge branch 'main' into fix-sparse-operator-simplify
2 parents a825b90 + 4e0ec18 commit 52f8f8e

24 files changed

+199
-195
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
pull_request:
3030
types: [opened, synchronize]
3131
branches:
32-
- master
32+
- main
3333

3434
merge_group:
3535
types:

.github/workflows/osv-scanner.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ on:
3838
types: [opened, synchronize]
3939
branches:
4040
- main
41-
- master
4241

4342
# Support merge queues.
4443
merge_group:
@@ -101,7 +100,7 @@ jobs:
101100
102101
- name: Run OSV scanner on existing code
103102
# yamllint disable rule:line-length
104-
uses: google/osv-scanner-action/osv-scanner-action@90b209d0ea55cea1da9fc0c4e65782cc6acb6e2e # v2.2.2
103+
uses: google/osv-scanner-action/osv-scanner-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
105104
continue-on-error: true
106105
with:
107106
scan-args: |-
@@ -119,7 +118,7 @@ jobs:
119118
120119
- name: Run OSV scanner on new code
121120
# yamllint disable rule:line-length
122-
uses: google/osv-scanner-action/osv-scanner-action@90b209d0ea55cea1da9fc0c4e65782cc6acb6e2e # v2.2.2
121+
uses: google/osv-scanner-action/osv-scanner-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
123122
continue-on-error: true
124123
with:
125124
scan-args: |-
@@ -131,7 +130,7 @@ jobs:
131130
132131
- name: Run the OSV scanner reporter
133132
# yamllint disable rule:line-length
134-
uses: google/osv-scanner-action/osv-reporter-action@90b209d0ea55cea1da9fc0c4e65782cc6acb6e2e # v2.2.2
133+
uses: google/osv-scanner-action/osv-reporter-action@e92b5d07338d4f0ba0981dffed17c48976ca4730 # v2.2.3
135134
with:
136135
scan-args: |-
137136
--output=osv-results.sarif
@@ -143,7 +142,7 @@ jobs:
143142
- name: Upload results to the repository's code-scanning results dashboard
144143
id: upload_artifact
145144
# yamllint disable rule:line-length
146-
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5
145+
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
147146
with:
148147
sarif_file: osv-results.sarif
149148

.github/workflows/scorecard-scanner.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ on:
2929
types: [opened, synchronize]
3030
branches:
3131
- main
32-
- master
3332

3433
# Support merge queues.
3534
merge_group:
@@ -75,7 +74,7 @@ jobs:
7574
persist-credentials: false
7675

7776
- name: Run Scorecard analysis
78-
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
77+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
7978
with:
8079
# Save the results
8180
results_file: scorecard-results.sarif
@@ -86,7 +85,7 @@ jobs:
8685
publish_results: true
8786

8887
- name: Upload results to code-scanning dashboard
89-
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5
88+
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5
9089
with:
9190
sarif_file: scorecard-results.sarif
9291

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. image:: https://raw.githubusercontent.com/quantumlib/OpenFermion/refs/heads/master/docs/images/logo_horizontal.svg
1+
.. image:: https://raw.githubusercontent.com/quantumlib/OpenFermion/refs/heads/main/docs/images/logo_horizontal.svg
22
:alt: OpenFermion logo
33
:width: 75%
44
:align: center
@@ -42,7 +42,7 @@ You can run the interactive Jupyter Notebooks in |Colab|_ or |MyBinder|_.
4242
.. _Colab: https://colab.research.google.com/github/quantumlib/OpenFermion
4343

4444
.. |MyBinder| replace:: MyBinder
45-
.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/master?filepath=examples
45+
.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/main?filepath=examples
4646

4747
Installation and Documentation
4848
==============================
@@ -64,7 +64,7 @@ the electronic structure plugins are only compatible on these platforms. However
6464
for those who would like to use Windows, or for anyone having other difficulties
6565
with installing OpenFermion or its plugins, we provide a Docker image
6666
and usage instructions in the
67-
`docker folder <https://github.com/quantumlib/OpenFermion/tree/master/docker>`__.
67+
`docker folder <https://github.com/quantumlib/OpenFermion/tree/main/docker>`__.
6868
The Docker image provides a virtual environment with OpenFermion and select plugins pre-installed.
6969
The Docker installation should run on any operating system where Docker can be used.
7070

check/format-incremental

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#
3232
# You can specify a base git revision to compare against (i.e. to use when
3333
# determining whether or not a file is considered to have "changed"). For
34-
# example, you can compare against 'origin/master' or 'HEAD~1'.
34+
# example, you can compare against 'origin/main' or 'HEAD~1'.
3535
#
3636
# If you don't specify a base revision, the following defaults will be tried, in
3737
# order, until one exists:
3838
#
39-
# 1. upstream/master
40-
# 2. origin/master
41-
# 3. master
39+
# 1. upstream/main
40+
# 2. origin/main
41+
# 3. main
4242
#
4343
# If none exists, the script fails.
4444
################################################################################
@@ -48,7 +48,6 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
4848
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
4949
cd "${topdir}" || exit $?
5050

51-
5251
# Parse arguments.
5352
only_print=1
5453
only_changed=1
@@ -74,14 +73,14 @@ typeset -a format_files
7473
if (( only_changed == 1 )); then
7574
# Figure out which branch to compare against.
7675
if [ -z "${rev}" ]; then
77-
if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
78-
rev=upstream/master
79-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
80-
rev=origin/master
81-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
82-
rev=master
76+
if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
77+
rev=upstream/main
78+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
79+
rev=origin/main
80+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
81+
rev=main
8382
else
84-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
83+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
8584
exit 1
8685
fi
8786
fi

check/pylint-changed-files

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
# If you don't specify a base revision, the following defaults will be tried,
2929
# in order, until one exists:
3030
#
31-
# 1. upstream/main or upstream/master
32-
# 2. origin/main or origin/master
33-
# 3. main or master
31+
# 1. upstream/main
32+
# 2. origin/main
33+
# 3. main
3434
#
3535
# If none exists, the script will exit with an error.
3636
#
@@ -43,22 +43,19 @@ thisdir=$(dirname "${BASH_SOURCE[0]:?}") || exit $?
4343
repo_dir=$(git -C "${thisdir}" rev-parse --show-toplevel) || exit $?
4444
cd "${repo_dir}" || exit $?
4545

46-
# Some old repos used "master" instead of main. Find out which one we have here.
47-
default=$(git branch --format '%(refname:short)' --list master main)
48-
4946
# Figure out which revision to compare against.
5047
if [ -n "$1" ] && [[ $1 != -* ]]; then
5148
if ! git rev-parse --verify --quiet --no-revs "$1^{commit}"; then
5249
echo -e "\033[31mNo revision '$1'.\033[0m" >&2
5350
exit 1
5451
fi
5552
rev=$1
56-
elif [ "$(git cat-file -t "upstream/${default}" 2> /dev/null)" == "commit" ]; then
57-
rev=upstream/${default}
58-
elif [ "$(git cat-file -t "origin/${default}" 2> /dev/null)" == "commit" ]; then
59-
rev=origin/${default}
60-
elif [ "$(git cat-file -t "${default}" 2> /dev/null)" == "commit" ]; then
61-
rev=${default}
53+
elif [ "$(git cat-file -t "upstream/main" 2> /dev/null)" == "commit" ]; then
54+
rev=upstream/main
55+
elif [ "$(git cat-file -t "origin/main" 2> /dev/null)" == "commit" ]; then
56+
rev=origin/main
57+
elif [ "$(git cat-file -t "main" 2> /dev/null)" == "commit" ]; then
58+
rev=main
6259
else
6360
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
6461
exit 1

check/pytest-and-incremental-coverage

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
# You can specify a base git revision to compare against (i.e. to use when
2323
# determining whether or not a line is considered to have "changed"). To make
2424
# the tool more consistent, it actually diffs against the most recent common
25-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
26-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
25+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
26+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
2727
#
2828
# If you don't specify a base revision, the following defaults will be tried,
2929
# in order, until one exists:
3030
#
31-
# 1. upstream/master
32-
# 2. origin/master
33-
# 3. master
31+
# 1. upstream/main
32+
# 2. origin/main
33+
# 3. main
3434
#
3535
# If none exists, the script fails.
3636
################################################################################
@@ -46,14 +46,14 @@ if [[ -n "$1" && $1 != -* ]]; then
4646
exit 1
4747
fi
4848
rev=$1
49-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
50-
rev=upstream/master
51-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
52-
rev=origin/master
53-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
54-
rev=master
49+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
50+
rev=upstream/main
51+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
52+
rev=origin/main
53+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
54+
rev=main
5555
else
56-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
56+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
5757
exit 1
5858
fi
5959
# shellcheck disable=SC2086

dev_tools/check_incremental_coverage_annotations.py

100644100755
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ def main():
2626
if len(sys.argv) < 2:
2727
print(
2828
shell_tools.highlight(
29-
'Must specify a comparison branch '
30-
'(e.g. "origin/master" or "HEAD~1").', shell_tools.RED))
29+
'Must specify a comparison branch (e.g. "origin/main" or "HEAD~1").',
30+
shell_tools.RED,
31+
)
32+
)
3133
sys.exit(1)
3234
comparison_branch = sys.argv[1]
3335

@@ -36,7 +38,8 @@ def main():
3638
actual_commit_id=None, # local uncommitted files
3739
compare_commit_id=comparison_branch,
3840
destination_directory=os.getcwd(),
39-
virtual_env_path=None)
41+
virtual_env_path=None,
42+
)
4043

4144
uncovered_count = check_for_uncovered_lines(env)
4245
if uncovered_count:

dev_tools/docs/build_api_docs.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@
2424

2525
import openfermion
2626

27-
flags.DEFINE_string("output_dir", "/tmp/openfermion_api",
28-
"Where to output the docs")
27+
flags.DEFINE_string("output_dir", "/tmp/openfermion_api", "Where to output the docs")
2928

30-
flags.DEFINE_string("code_url_prefix",
31-
("https://github.com/quantumlib/OpenFermion/tree/master/src"
32-
"openfermion"), "The url prefix for links to code.")
29+
flags.DEFINE_string(
30+
"code_url_prefix",
31+
("https://github.com/quantumlib/OpenFermion/tree/main/src" "openfermion"),
32+
"The url prefix for links to code.",
33+
)
3334

34-
flags.DEFINE_bool("search_hints", True,
35-
"Include metadata search hints in the generated files")
35+
flags.DEFINE_bool("search_hints", True, "Include metadata search hints in the generated files")
3636

37-
flags.DEFINE_string("site_path", "quark/openfermion/api_docs/python",
38-
"Path prefix in the _toc.yaml")
37+
flags.DEFINE_string(
38+
"site_path", "quark/openfermion/api_docs/python", "Path prefix in the _toc.yaml"
39+
)
3940

4041
FLAGS = flags.FLAGS
4142

@@ -55,7 +56,8 @@ def main(unused_argv):
5556
# Example:
5657
# "cirq.google.engine.client.quantum.QuantumEngineServiceClient":
5758
# ["enums"]
58-
})
59+
},
60+
)
5961

6062
doc_generator.build(output_dir=FLAGS.output_dir)
6163

0 commit comments

Comments
 (0)