Skip to content

Commit 886611a

Browse files
authored
Merge branch 'master' into 2022-04-engineresult
2 parents c34bfb7 + 63afb7a commit 886611a

File tree

262 files changed

+23363
-398
lines changed

Some content is hidden

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

262 files changed

+23363
-398
lines changed

.editorconfig

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
# Common editor configurations for this project.
17+
#
18+
# EditorConfig is a file format for specifying some common style parameters.
19+
# Many IDEs & editors read .editorconfig files, either natively or via plugins.
20+
# We mostly follow Google's style guides (https://google.github.io/styleguide/)
21+
# with only a few deviations for line length and indentation in some files.
22+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23+
24+
root = true
25+
26+
[*]
27+
charset = utf-8
28+
indent_style = space
29+
insert_final_newline = true
30+
spelling_language = en-US
31+
trim_trailing_whitespace = true
32+
max_line_length = 100
33+
34+
[*.json]
35+
# Not stated explicitly in Google's guidelines, but the examples use 2.
36+
indent_size = 2
37+
38+
[*.py]
39+
# Google style guidelines use 4.
40+
indent_size = 4
41+
42+
[*.sh]
43+
# Google style guidelines use 2.
44+
indent_size = 4
45+
46+
[{*.yaml,*.yml}]
47+
# Google doesn't have style guidelines for YAML. Most people use indent = 2.
48+
indent_size = 2
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bug report
2+
description: Report a problem with this software or project
3+
type: Bug
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this bug report!
9+
10+
- type: textarea
11+
attributes:
12+
label: Describe the issue
13+
description: >-
14+
Please explain clearly and in detail what the issue is. What led up
15+
to it, or how did you encounter it?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: How can the issue be reproduced?
22+
description: >-
23+
Explain in a step-by-step fashion what someone else would need to
24+
do in order to reproduce the issue. If possible, include literal
25+
examples of commands or code using [Markdown fenced code
26+
blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks).
27+
For long output, paste the text into [collapsed
28+
sections](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
29+
or attach text files.
30+
validations:
31+
required: false
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Feature request
2+
description: Request a new feature or change
3+
type: Enhancement
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this feature request form!
9+
10+
- type: textarea
11+
attributes:
12+
label: Is your feature request related to a use case or problem?
13+
description: >-
14+
Please tell us the context of your request. Is it to help you do
15+
something that you currently cannot due to limitations in the software,
16+
or is it an idea for an enhancement or new functionality, or something
17+
else?
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
attributes:
23+
label: What solution or approach do you envision?
24+
description: >-
25+
If you have ideas or preferences for the solution, you can let us know
26+
here. If you are aware of other similar or related work, please let us
27+
know about it here.
28+
validations:
29+
required: false
30+
31+
- type: dropdown
32+
attributes:
33+
label: How urgent is this for you?
34+
description: >-
35+
Please choose from among the following options. If the lack of this
36+
feature is blocking important work, please choose from among P0–P2.
37+
options:
38+
- P0 – needed no later than a week
39+
- P1 – needed by the next release
40+
- P2 – needed within two quarters
41+
- P3 – not blocked; it's an idea
42+
validations:
43+
required: false

.github/ISSUE_TEMPLATE/3-task.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Task
2+
description: Describe a task that needs to be done
3+
type: Task
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this feature request form!
9+
10+
- type: textarea
11+
attributes:
12+
label: What is the task?
13+
validations:
14+
required: true
15+
16+
- type: textarea
17+
attributes:
18+
label: (Optional) Do you have ideas or preferences for the approach?
19+
validations:
20+
required: false
21+
22+
- type: dropdown
23+
attributes:
24+
label: How urgent is this for you?
25+
description: >-
26+
Please choose from among the following options. If the lack of this
27+
feature is blocking important work, please choose from among P0–P2.
28+
options:
29+
- P0 – needed no later than a week
30+
- P1 – needed by the next release
31+
- P2 – needed within two quarters
32+
- P3 – not blocked; it's an idea
33+
validations:
34+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true

.github/SECURITY.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Reporting security issues
2+
3+
This project's developers and community are committed to addressing security
4+
bugs promptly and effectively. We appreciate your efforts to disclose your
5+
findings responsibly, and will make every effort to acknowledge your
6+
contributions.
7+
8+
Please **do not** use GitHub issues to report security vulnerabilities; GitHub
9+
issues are public, and doing so could allow someone to exploit the information
10+
before the problem can be addressed. Instead, please use the *Report a
11+
vulnerability* interface from the *Security* tab at the top of this GitHub
12+
repository page.
13+
14+
<div align="center">
15+
<img width="75%" alt="Location of the report button on the repository page"
16+
src="/.github/report-vulnerability-button.png">
17+
</div>
18+
19+
Please report security issues in third-party modules to the person or team
20+
maintaining the module rather than this project's stewards, unless you believe
21+
that some action needs to be taken specifically with this project in order to
22+
guard against the effects of a security vulnerability in third-party software.
23+
24+
## Responses to security reports
25+
26+
The project stewards at Google Quantum AI will send a response indicating the
27+
next steps in handling your report. After the initial reply to your report, the
28+
project stewards will keep you informed of the progress towards a fix and full
29+
announcement, and may ask for additional information or guidance.
30+
31+
## Additional points of contact
32+
33+
Please contact the project stewards at Google Quantum AI via email at
34+
[email protected] if you have questions or other concerns. If
35+
for any reason you are uncomfortable reaching out to the project stewards,
36+
please email [email protected] instead.
37.5 KB
Loading

.github/workflows/ci.yaml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Copyright 2020 Google, LLC.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Continuous integration tests
16+
run-name: >-
17+
Test code and notebooks in
18+
${{github.event_name == 'pull_request' && format('PR #{0}', github.event.pull_request.number)
19+
|| format('push to {0}', github.ref_name) }}
20+
by @${{github.actor}}
21+
22+
on:
23+
push:
24+
branches:
25+
- master
26+
- main
27+
28+
pull_request:
29+
branches:
30+
- master
31+
- main
32+
33+
merge_group:
34+
types:
35+
- checks_requested
36+
37+
workflow_dispatch:
38+
39+
# Declare default workflow permissions as read only.
40+
permissions: read-all
41+
42+
concurrency:
43+
# Cancel any previously-started but still active runs on the same branch.
44+
cancel-in-progress: true
45+
group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}}
46+
47+
env:
48+
# Python version to use.
49+
python_version: 3.11
50+
51+
# Files containing lists of dependencies installed using pip. This is used as
52+
# a parameter to setup-python to check whether its pip cache needs updating.
53+
python_dep_files: |-
54+
requirements.txt
55+
recirq/**/extra-requirements.txt
56+
dev_tools/requirements/deps/*.txt
57+
dev_tools/check_notebooks.py
58+
dev_tools/write-ci-requirements.py
59+
60+
jobs:
61+
pytest:
62+
name: Run Python tests
63+
runs-on: ubuntu-24.04
64+
timeout-minutes: 15
65+
strategy:
66+
matrix:
67+
cirq-version:
68+
- 'current'
69+
- 'previous'
70+
- 'next'
71+
fail-fast: false
72+
steps:
73+
- name: Check out a copy of the git repository
74+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
75+
76+
- name: Set up Python with caching of pip dependencies
77+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
78+
with:
79+
python-version: ${{env.python_version}}
80+
cache: pip
81+
cache-dependency-path: ${{env.python_dep_files}}
82+
83+
- name: Install Python dependencies
84+
run: |
85+
python -m pip install --upgrade pip
86+
pip install -r requirements.txt
87+
python dev_tools/write-ci-requirements.py \
88+
--relative-cirq-version=${{ matrix.cirq-version }} --all-extras
89+
pip install -r ci-requirements.txt
90+
pip install --no-deps -e .
91+
92+
- name: Test with pytest
93+
run: |
94+
# OMP_NUM_THREADS: PySCF's poor OpenMP performance slows down QCQMC tests.
95+
# RECIRQ_IMPORT_FAILSAFE: skip tests on unsupported Cirq configurations.
96+
export OMP_NUM_THREADS=1
97+
RECIRQ_IMPORT_FAILSAFE=y pytest -v --skipslow
98+
99+
pylint:
100+
name: Run Python linters
101+
runs-on: ubuntu-24.04
102+
timeout-minutes: 15
103+
steps:
104+
- name: Check out a copy of the git repository
105+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
106+
107+
- name: Set up Python with caching of pip dependencies
108+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
109+
with:
110+
python-version: ${{env.python_version}}
111+
cache: pip
112+
cache-dependency-path: ${{env.python_dep_files}}
113+
114+
- name: Install Python dependencies
115+
run: |
116+
python -m pip install --upgrade pip
117+
pip install flake8
118+
119+
- name: Lint with flake8
120+
run: |
121+
# Stop the build if there are Python syntax errors or undefined names.
122+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
123+
# `exit-zero` treats all errors as warnings. The GitHub editor is 127 chars wide.
124+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
125+
126+
nbformat:
127+
name: Check notebook formatting
128+
runs-on: ubuntu-24.04
129+
timeout-minutes: 15
130+
steps:
131+
- name: Check out a copy of the git repository
132+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
133+
134+
- name: Set up Python with caching of pip dependencies
135+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
136+
with:
137+
python-version: ${{env.python_version}}
138+
cache: pip
139+
cache-dependency-path: ${{env.python_dep_files}}
140+
141+
- name: Install Python dependencies
142+
run: |
143+
pip install --upgrade pip
144+
pip install -r dev_tools/requirements/deps/tensorflow-docs.txt
145+
146+
- name: Check notebook formatting
147+
run: |
148+
dev_tools/nbformat

0 commit comments

Comments
 (0)