Skip to content

Commit 3161d30

Browse files
authored
Merge branch 'main' into 2023-11-blacklist-these-terms
2 parents 0d4ba9a + ced1383 commit 3161d30

File tree

108 files changed

+2077
-1128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2077
-1128
lines changed

.github/workflows/ci-daily.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous Integration - Daily
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * *'
77

88
concurrency:

.github/workflows/ci-weekly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous Integration - Weekly
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * 0'
77

88
concurrency:

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Continuous Integration
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * *'
77
pull_request:
88
branches:
9-
- master
9+
- main
1010

1111
concurrency:
1212
group: ${{ github.head_ref || github.run_id }}

.github/workflows/release-master.yml renamed to .github/workflows/release-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pre-release cirq to PyPi
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
jobs:
88
push_to_pypi:
99
if: github.repository == 'quantumlib/Cirq'

asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"project_url": "https://quantumai.google/cirq",
55
"repo": ".",
66
"repo_subdir": "cirq-core/",
7-
"branches": ["master"],
7+
"branches": ["main"],
88
"dvcs": "git",
99
"environment_type": "virtualenv",
1010
"show_commit_url": "https://github.com/quantumlib/Cirq/commit/",

check/build-changed-protos

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
#
1212
# You can specify a base git revision to compare against (i.e. to use when
1313
# determining whether or not a line is considered to have "changed"). For
14-
# example, you can compare against 'origin/master' or 'HEAD~1'.
14+
# example, you can compare against 'origin/main' or 'HEAD~1'.
1515
#
1616
# If you don't specify a base revision, the following defaults will be tried, in
1717
# order, until one exists:
1818
#
19-
# 1. upstream/master
20-
# 2. origin/master
21-
# 3. master
19+
# 1. upstream/main
20+
# 2. origin/main
21+
# 3. main
2222
#
2323
# If none exists, the script fails.
2424
#
@@ -37,14 +37,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3737
exit 1
3838
fi
3939
rev=$1
40-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
41-
rev=upstream/master
42-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
43-
rev=origin/master
44-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
45-
rev=master
40+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
41+
rev=upstream/main
42+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
43+
rev=origin/main
44+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
45+
rev=main
4646
else
47-
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
47+
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
4848
exit 1
4949
fi
5050
base="$(git merge-base "${rev}" HEAD)"

check/format-incremental

+11-11
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#
1919
# You can specify a base git revision to compare against (i.e. to use when
2020
# determining whether or not a file is considered to have "changed"). For
21-
# example, you can compare against 'origin/master' or 'HEAD~1'.
21+
# example, you can compare against 'origin/main' or 'HEAD~1'.
2222
#
2323
# If you don't specify a base revision, the following defaults will be tried, in
2424
# order, until one exists:
2525
#
26-
# 1. upstream/master
27-
# 2. origin/master
28-
# 3. master
26+
# 1. upstream/main
27+
# 2. origin/main
28+
# 3. main
2929
#
3030
# If none exists, the script fails.
3131
################################################################################
@@ -61,14 +61,14 @@ typeset -a format_files
6161
if (( only_changed == 1 )); then
6262
# Figure out which branch to compare against.
6363
if [ -z "${rev}" ]; then
64-
if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
65-
rev=upstream/master
66-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
67-
rev=origin/master
68-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
69-
rev=master
64+
if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
65+
rev=upstream/main
66+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
67+
rev=origin/main
68+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
69+
rev=main
7070
else
71-
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
71+
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
7272
exit 1
7373
fi
7474
fi

check/pylint-changed-files

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
# You can specify a base git revision to compare against (i.e. to use when
1010
# determining whether or not a line is considered to have "changed"). To make
1111
# the tool more consistent, it actually diffs against the most recent common
12-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
13-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
12+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
13+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
1414
#
1515
# If you don't specify a base revision, the following defaults will be tried,
1616
# in order, until one exists:
1717
#
18-
# 1. upstream/master
19-
# 2. origin/master
20-
# 3. master
18+
# 1. upstream/main
19+
# 2. origin/main
20+
# 3. main
2121
#
2222
# If none exists, the script fails.
2323
#
@@ -36,14 +36,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3636
exit 1
3737
fi
3838
rev=$1
39-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
40-
rev=upstream/master
41-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
42-
rev=origin/master
43-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
44-
rev=master
39+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
40+
rev=upstream/main
41+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
42+
rev=origin/main
43+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
44+
rev=main
4545
else
46-
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
46+
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
4747
exit 1
4848
fi
4949
base="$(git merge-base "${rev}" HEAD)"

check/pytest-and-incremental-coverage

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
# You can specify a base git revision to compare against (i.e. to use when
1010
# determining whether or not a line is considered to have "changed"). To make
1111
# the tool more consistent, it actually diffs against the most recent common
12-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
13-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
12+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
13+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
1414
#
1515
# If you don't specify a base revision, the following defaults will be tried,
1616
# in order, until one exists:
1717
#
18-
# 1. upstream/master
19-
# 2. origin/master
20-
# 3. master
18+
# 1. upstream/main
19+
# 2. origin/main
20+
# 3. main
2121
#
2222
# If none exists, the script fails.
2323
################################################################################
@@ -50,14 +50,14 @@ if [ -n "${BASEREV}" ]; then
5050
exit 1
5151
fi
5252
rev="${BASEREV}"
53-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
54-
rev=upstream/master
55-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
56-
rev=origin/master
57-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
58-
rev=master
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
5959
else
60-
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
60+
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
6161
exit 1
6262
fi
6363
base="$(git merge-base "${rev}" HEAD)"

check/pytest-changed-files

+11-11
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
#
1313
# You can specify a base git revision to compare against (i.e. to use when
1414
# determining whether or not a file is considered to have "changed"). For
15-
# example, you can compare against 'origin/master' or 'HEAD~1'.
15+
# example, you can compare against 'origin/main' or 'HEAD~1'.
1616
#
1717
# If you don't specify a base revision, the following defaults will be tried, in
1818
# order, until one exists:
1919
#
20-
# 1. upstream/master
21-
# 2. origin/master
22-
# 3. master
20+
# 1. upstream/main
21+
# 2. origin/main
22+
# 3. main
2323
#
2424
# If none exists, the script fails.
2525
#
@@ -41,14 +41,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
4141
fi
4242
rev=$1
4343
rest=( "${@:2}" )
44-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
45-
rev=upstream/master
46-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
47-
rev=origin/master
48-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
49-
rev=master
44+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
45+
rev=upstream/main
46+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
47+
rev=origin/main
48+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
49+
rev=main
5050
else
51-
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
51+
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
5252
exit 1
5353
fi
5454
echo "Comparing against revision '${rev}'." >&2

check/pytest-changed-files-and-incremental-coverage

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# You can specify a base git revision to compare against (i.e. to use when
1616
# determining whether or not a line is considered to have "changed"). To make
1717
# the tool more consistent, it actually diffs against the most recent common
18-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
19-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
18+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
19+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
2020
#
2121
# If you don't specify a base revision, the following defaults will be tried,
2222
# in order, until one exists:
2323
#
24-
# 1. upstream/master
25-
# 2. origin/master
26-
# 3. master
24+
# 1. upstream/main
25+
# 2. origin/main
26+
# 3. main
2727
#
2828
# If none exists, the script fails.
2929
################################################################################
@@ -39,14 +39,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3939
exit 1
4040
fi
4141
rev=$1
42-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
43-
rev=upstream/master
44-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
45-
rev=origin/master
46-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
47-
rev=master
42+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
43+
rev=upstream/main
44+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
45+
rev=origin/main
46+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
47+
rev=main
4848
else
49-
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
49+
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
5050
exit 1
5151
fi
5252
base="$(git merge-base "${rev}" HEAD)"

cirq-aqt/cirq_aqt/aqt_sampler_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_aqt_sampler_ms():
204204
_, qubits = get_aqt_device(num_qubits)
205205
sampler = AQTSamplerLocalSimulator()
206206
circuit = cirq.Circuit(cirq.Z.on_each(*qubits), cirq.Z.on_each(*qubits))
207-
for _dummy in range(9):
207+
for _ in range(9):
208208
circuit.append(cirq.XX(qubits[0], qubits[1]) ** 0.5)
209209
circuit.append(cirq.Z(qubits[0]) ** 0.5)
210210
results = sampler.run(circuit, repetitions=repetitions)

cirq-core/cirq/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@
441441

442442
from cirq.sim import (
443443
CIRCUIT_LIKE,
444+
ClassicalStateSimulator,
444445
CliffordSimulator,
445446
CliffordState,
446447
CliffordSimulatorStepResult,

cirq-core/cirq/circuits/qasm_output_test.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,26 @@ class UnsupportedOperation(cirq.Operation):
248248

249249

250250
def _all_operations(q0, q1, q2, q3, q4, include_measurements=True):
251-
class DummyOperation(cirq.Operation):
251+
class ExampleOperation(cirq.Operation):
252252
qubits = (q0,)
253253
with_qubits = NotImplemented
254254

255255
def _qasm_(self, args: cirq.QasmArgs) -> str:
256-
return '// Dummy operation\n'
256+
return '// Example operation\n'
257257

258258
def _decompose_(self):
259259
# Only used by test_output_unitary_same_as_qiskit
260260
return () # pragma: no cover
261261

262-
class DummyCompositeOperation(cirq.Operation):
262+
class ExampleCompositeOperation(cirq.Operation):
263263
qubits = (q0,)
264264
with_qubits = NotImplemented
265265

266266
def _decompose_(self):
267267
return cirq.X(self.qubits[0])
268268

269269
def __repr__(self):
270-
return 'DummyCompositeOperation()'
270+
return 'ExampleCompositeOperation()'
271271

272272
return (
273273
cirq.I(q0),
@@ -328,8 +328,8 @@ def __repr__(self):
328328
)
329329
if include_measurements
330330
else (),
331-
DummyOperation(),
332-
DummyCompositeOperation(),
331+
ExampleOperation(),
332+
ExampleCompositeOperation(),
333333
)
334334

335335

@@ -539,9 +539,9 @@ def filter_unpredictable_numbers(text):
539539
x q[2]; // Undo the inversion
540540
measure q[3] -> m_multi[2];
541541
542-
// Dummy operation
542+
// Example operation
543543
544-
// Operation: DummyCompositeOperation()
544+
// Operation: ExampleCompositeOperation()
545545
x q[0];
546546
"""
547547
)

0 commit comments

Comments
 (0)