Skip to content

Commit

Permalink
Add recommended files for community support & update CONTRIBUTING.md (#…
Browse files Browse the repository at this point in the history
…6898)

* Add ./github/SECURITY.md

Per GitHub best practices, this give people instructions for reporting
security vulnerabilities in this project.

* Add SUPPORT.md file

SUPPORT.md files are another GitHub best practice; they're used to to
let people know about ways to get help with a project.

* Add CITATION.cff file

[`CITATION.cff`](https://citation-file-format.github.io/) files are
plain text files with human- and machine-readable citation information
for software. Code developers can include them in their repositories
to let others know how to correctly cite their software. GitHub
supports them, and uses `CITATION.cff` files to automatically produce
citation metadata records for the "Cite this repository" button on a
repository's front page.

* Make small corrections & enhancements to CONTRIBUTING.md

This contains a variety of small changes:
- capitalization fixes (e.g., cirq → Cirq)
- clarifications
- links to more information

* Update CITATION.cff

Correction to capitalization.

* Fixes for CONTRIBUTING.md issues raised during code review
  • Loading branch information
mhucka authored Jan 10, 2025
1 parent de81235 commit 5d317ba
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 44 deletions.
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
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
94 changes: 50 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ 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
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
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.

You generally only need to submit a CLA once, so if you've already submitted one
Expand All @@ -26,27 +27,28 @@ 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
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 [repository 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 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
main Cirq repo, you may need to merge in the latest changes. To do this,
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,70 +62,74 @@ 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)
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),
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
new changes.

- **Tests**.
Existing tests must continue to pass (or be updated) when new changes are
introduced. We use [pytest](https://docs.pytest.org/en/latest/) to run our
introduced. We use [pytest](https://docs.pytest.org) to run our
tests.
- **Coverage**.
Code should be covered by tests.
We use [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) to compute
We use [pytest-cov](https://pytest-cov.readthedocs.io) to compute
coverage, and custom tooling to filter down the output to only include new or
changed code. We don't require 100% coverage, but any uncovered code must
be annotated with `# pragma: no cover`. To ignore coverage of a single line,
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 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]).

0 comments on commit 5d317ba

Please sign in to comment.