Skip to content

Add recommended files for community support & update CONTRIBUTING.md #6898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
30 changes: 30 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Reporting security issues

The Cirq developers and community take security bugs in Cirq seriously. We
appreciate your efforts to responsibly disclose your findings, and will make
every effort to acknowledge your contributions.

Please **do not** use GitHub issues to report security vulnerabilities; GitHub
issues are public, and doing so could allow someone to exploit the information
before the problem can be addressed. Instead, please use the GitHub ["Report
a Vulnerability"](https://github.com/quantumlib/cirq/security/advisories/new)
interface from the _Security_ tab of the Cirq repository.

Please security bugs in third-party modules to the person or team maintaining
the module rather than the Cirq project stewards, unless you believe that some
action needs to be taken with Cirq in order to guard against the effects of a
security vulnerability in a third-party module.

## Responses to security reports

The project stewards at Google Quantum AI will send a response indicating the
next steps in handling your report. After the initial reply to your report, the
project stewards will keep you informed of the progress towards a fix and full
announcement, and may ask for additional information or guidance.

## Additional points of contact

Please contact the project stewards at Google Quantum AI via email at
[email protected] if you have questions or other concerns. If
for any reason you are uncomfortable reaching out to the project stewards,
please email [email protected].
32 changes: 32 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cff-version: 1.2.0
message: If you use this software, please cite it as below.
authors:
- name: Cirq Developers
website: https://github.com/quantumlib/Cirq/graphs/contributors
title: Cirq
abstract: Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators.
version: 1.4.1
date-released: 2024-06-26
url: https://quantumai.google/cirq
repository-code: https://github.com/quantumlib/cirq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit -

Suggested change
repository-code: https://github.com/quantumlib/cirq
repository-code: https://github.com/quantumlib/Cirq

license: Apache-2.0
identifiers:
- type: doi
value: 10.5281/zenodo.4062499
description: Archival DOI for Cirq software releases.
type: software
keywords:
- api
- nisq
- noisy intermediate-scale quantum
- python
- quantum algorithms
- quantum circuit simulation
- quantum circuits
- quantum computing
- quantum programming
- quantum programming languages
- quantum simulation
- sdk
- simulation
- software
92 changes: 50 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
We'd love to accept your patches and contributions to this project.
We do have some guidelines to follow, covered in this document, but don't
worry about (or expect to) get everything right the first time!
Create a pull request and we'll nudge you in the right direction. Please also
Create a [pull request](https://en.wikipedia.org/wiki/Fork_and_pull_model)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this wiki link here? The wiki article is very brief and not much clarifying for a novice GitHub user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point.

and we'll nudge you in the right direction. Please also
note that we have a [code of conduct](CODE_OF_CONDUCT.md) to make Cirq an
open and welcoming environment.
open and welcoming community environment.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
Contributions to this project must be accompanied by a [Contributor License
Agreement](https://cla.developers.google.com/about) (CLA). You
(or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
Expand All @@ -26,27 +28,29 @@ use GitHub pull requests for this purpose.
[GitHub Help](https://help.github.com/articles/about-pull-requests/) has
information on using pull requests.

The preferred manner for submitting pull requests is for users to fork
the Cirq [repo](https://github.com/quantumlib/Cirq) and then use a
branch from this fork to create a pull request to the main Cirq repo.

The basic process for setting up a fork is
1. Fork the Cirq repo (Fork button in upper right corner of
[repo page](https://github.com/quantumlib/Cirq)).
Forking creates a new github repo at the location
```https://github.com/USERNAME/cirq``` where ```USERNAME``` is
your github id. Use the directions on the
The preferred manner for submitting pull requests is for developers to
[fork](https://docs.github.com/articles/working-with-forks)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fork link might be redundant here - the process is described step-by-step below.

the Cirq [repository](https://github.com/quantumlib/Cirq) and then use a [git
branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)
from this fork to create a pull request to the main Cirq repo. The basic process for setting
up a fork is as follows:

1. Fork the Cirq repository (you can use the _Fork_ button in upper right
corner of the [repo home page](https://github.com/quantumlib/Cirq)).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit -

Suggested change
corner of the [repo home page](https://github.com/quantumlib/Cirq)).
corner of the [repository page](https://github.com/quantumlib/Cirq)).

Forking creates a new GitHub repo at the location
`https://github.com/USERNAME/cirq`, where `USERNAME` is
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - let us fix also other instances of cirq --> Cirq capitalization in URLs here

Suggested change
`https://github.com/USERNAME/cirq`, where `USERNAME` is
`https://github.com/USERNAME/Cirq`, where `USERNAME` is

your GitHub user name. Use the instructions on the
[development page](docs/dev/development.md) to download a copy to
your local machine. You need only do this once.
1. Checkout main and create a new branch from this main
1. Check out the `main` branch and create a new branch from `main`:
```shell
git checkout main -b new_branch_name
```
where ```new_branch_name``` is the name of your new branch.
where `new_branch_name` is the name of your new branch.
1. Do your work and commit your changes to this branch.
1. If you have drifted out of sync with the main from the
main cirq repo you may need to merge in changes. To do this,
first update your local main and then merge the local main
1. If your local copy has drifted out of sync with the `main` branch of the
the main Cirq repo, you may need to merge in the latest changes. To do this,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - de duplicate

Suggested change
the main Cirq repo, you may need to merge in the latest changes. To do this,
main Cirq repo, you may need to merge in the latest changes. To do this,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

first update your local `main` and then merge your local `main`
into your branch:
```shell
# Track the upstream repo (if your local repo hasn't):
Expand All @@ -60,37 +64,39 @@ into your branch:
git checkout new_branch_name
git merge main
```
You may need to fix merge conflicts for both of these merge
commands.
1. Finally, push your change to your clone
You may need to fix [merge
conflicts](https://docs.github.com/articles/about-merge-conflicts)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - readability as plain text

Suggested change
You may need to fix [merge
conflicts](https://docs.github.com/articles/about-merge-conflicts)
You may need to fix [merge conflicts](
https://docs.github.com/articles/about-merge-conflicts)

during one or both of these merge processes.
1. Finally, push your changes to your forked copy of the Cirq repo on GitHub:
```shell
git push origin new_branch_name
```
1. Now when you navigate to the cirq page on github,
[https://github.com/quantumlib/cirq](https://github.com/quantumlib/cirq)
1. Now when you navigate to the Cirq repository on GitHub
([https://github.com/quantumlib/cirq](https://github.com/quantumlib/cirq)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for expanded [TEXT](URL) syntax here -

Suggested change
([https://github.com/quantumlib/cirq](https://github.com/quantumlib/cirq)),
(https://github.com/quantumlib/Cirq),

Since you are at it, can you please also remove the redundant <> in the CLA link here -

part of the project. Head over to <https://cla.developers.google.com/> to see

you should see the option to create a new pull request from
your clone repository. Alternatively you can create the pull request
your clone repository. Alternatively, you can create the pull request
by navigating to the "Pull requests" tab in the page, and selecting
the appropriate branches.
1. The reviewer will comment on your code and may ask for changes,
you can perform these locally, and then push the new commit following
the same process as above.
1. A reviewer will comment on your code and may ask for changes.
You can perform the necessary changes locally, and then push the new commit
following the same process as above.

## Development Environment Setup

Please refer to our [development page](docs/dev/development.md) for instructions
on setting up your local development environment.
Please refer to our [development page](docs/dev/development.md) for
instructions on setting up your local development environment.

## Code Testing Standards

When a pull request is created or updated, various automatic checks will
run to ensure that the change won't break Cirq and meets our coding standards.
run on GitHub to ensure that the changes won't break Cirq, as well as to make
sure they meet the Cirq project's coding standards.

Cirq contains a continuous integration tool to verify testing. See our
Cirq includes a continuous integration tool to perform testing. See our
[development page](docs/dev/development.md) on how to run the continuous
integration checks locally.

Please be aware of the following code standards that will be applied to any
Please be aware of the following coding standards that will be applied to any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove the /en/latest suffix from the pytest and pytest-cov URLs below?
Their top pages already redirect to .../en/latest and are less likely to become invalid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These happen when I copy-paste the links. You’re right that they should be removed. This is something we should put into linter rules.

new changes.

- **Tests**.
Expand All @@ -107,23 +113,25 @@ place `# pragma: no cover` at the end of the line. To ignore coverage for
an entire block, start the block with a `# pragma: no cover` comment on its
own line.
- **Lint**.
Code should meet common style standards for python and be free of error-prone
constructs. We use [pylint](https://www.pylint.org/) to check for lint.
Code should meet common style standards for Python and be free of error-prone
constructs. We use [Pylint](https://www.pylint.org/) to check for code lint.
To see which lint checks we enforce, see the
[dev_tools/conf/.pylintrc](dev_tools/conf/.pylintrc) file. When pylint produces
a false positive, it can be squashed with annotations like
`# pylint: disable=unused-import`.
[dev_tools/conf/.pylintrc](dev_tools/conf/.pylintrc) file. When Pylint produces
a false positive, it can be silenced with annotations. For example, the
annotation `# pylint: disable=unused-import` would silence a warning about
an unused import.
- **Types**.
Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/).
We use [mypy](http://mypy-lang.org/) to check that type annotations are correct.
When type checking produces a false positive, it can be ignored with
annotations like `# type: ignore`.
When type checking produces a false positive, it can be silenced with
annotations such like `# type: ignore`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit -

Suggested change
annotations such like `# type: ignore`.
annotations such as `# type: ignore`.


## Request For Comment Process for New Major Features

For larger contributions that will benefit from design reviews, please use the
For larger contributions that will benefit from design reviews, please use the Cirq
[Request for Comment](docs/dev/rfc_process.md) process.

## Developing notebooks

Please refer to our [notebooks guide](docs/dev/notebooks.md) on how to develop iPython notebooks for documentation.
Please refer to our [notebooks guide](docs/dev/notebooks.md) on how to develop
iPython notebooks for documentation.
28 changes: 28 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Support

Thank you for your interest in this project! If you are experiencing problems
or have questions, the following are some suggestions for how to get help.

> [!NOTE]
> Before participating in our community, please read our [code of
> conduct](CODE_OF_CONDUCT.md). By interacting with this repository,
> organization, or community, you agree to abide by its terms.

## Report an issue or request a feature

To report an issue or request a feature in Cirq, please first search the [issue
tracker on GitHub](https://github.com/quantumlib/Cirq/issues) to check if there
is already an open issue identical or similar to your bug report/feature
request. If there is none, go ahead and file a new issue in the issue tracker.

## Attend the developer meetings

_Cirq Cynq_ is our biweekly virtual meeting of contributors to discuss
everything from issues to ongoing efforts, as well as to ask questions. Join
the [`cirq-dev` Google Group](https://groups.google.com/forum/#!forum/cirq-dev)
to get an automatic meeting invitation.

## Contact the maintainers

For any questions or concerns not addressed here, please email
[[email protected]](mailto:[email protected]).