Skip to content

Commit d936ee3

Browse files
authored
Overhaul top-level README and convert to Markdown (#6988)
* Overhaul top-level README and convert to Markdown This is a major overhaul of the main Cirq README file. Much of the content is rewritten, and there are numerous additions and enhancements all over. The changes include but are not limited to: - Updates and corrections - Addition of new sections - Centering and resizing the logo for a more professional look - Addition of GitHub badges for extra "pizzazz" - Addition of pointers to related Quantumlib software - Addition of a table of contents - Improvements to info about how to cite Cirq - Conversion to Markdown format to allow formatting that is compatible with both GitHub and PyPI This is a follow-on to now-closed PRs #6903 and #6901, which concerned making roughly the same changes while keeping with the reStructuredText format of the previous README file. Switching to Markdown allows use of some simple raw HTML to achieving formatting that is not possible in pure Markdown, and still do so in a way that works on both GitHub and PyPI. * Adapt setup.py to work with new Markdown-format README * Update to reference README.md instead of README.rst * Use md reference links for better plain-text readability No content edits (except possibly one or two trivial changes of wording). This changes some links to use Markdown "reference" link syntax, to make some of the source text more readable. * Fix list indentation to follow Google Markdown style * Fix links to bib records & reposition recontributors number The previous links for the bibliographic records went to Cirq 1.2 in Zenodo. There doesn’t seem to be a way to get Zenodo to produce bibtex for the latest version of a record (only specific versions of a record), so I ended up using doi.org, but that one doesn't have a way to produce MarcXML. So I removed that format, leaving the other two. This also moves the GitHub contributors badge/count, per recommendation by Pavol in the review of this PR. * Remove README.rst * Add link target for #how-to-cite This is so that existing links go to same section despite the renamed heading.
1 parent 26b1f46 commit d936ee3

5 files changed

Lines changed: 272 additions & 134 deletions

File tree

README.md

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
# <!-- H1 title omitted because our logo acts as the title. -->
2+
3+
<div align="center">
4+
<img width="280px" height="135px" alt="Cirq logo"
5+
src="https://raw.githubusercontent.com/quantumlib/Cirq/refs/heads/main/docs/images/Cirq_logo_color.svg">
6+
7+
Python package for writing, manipulating, and running [quantum
8+
circuits](https://en.wikipedia.org/wiki/Quantum_circuit) on quantum computers
9+
and simulators.
10+
11+
[![Licensed under the Apache 2.0
12+
license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative&logoColor=white&style=flat-square)](https://github.com/quantumlib/Cirq/blob/main/LICENSE)
13+
[![Compatible with Python versions 3.10 and
14+
higher](https://img.shields.io/badge/Python-3.10+-fcbc2c.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/)
15+
[![Cirq project on
16+
PyPI](https://img.shields.io/pypi/v/cirq.svg?logo=python&logoColor=white&label=PyPI&style=flat-square&color=fcbc2c)](https://pypi.org/project/cirq)
17+
[![Archived in
18+
Zenodo](https://img.shields.io/badge/10.5281%2Fzenodo.4062499-gray.svg?label=DOI&style=flat-square&colorA=gray&colorB=3c60b1)](https://doi.org/10.5281/zenodo.4062499)
19+
20+
[Features](#features) &ndash;
21+
[Installation](#installation) &ndash;
22+
[Quick Start](#quick-start--hello-qubit-example) &ndash;
23+
[Documentation](#cirq-documentation) &ndash;
24+
[Integrations](#integrations) &ndash;
25+
[Community](#community) &ndash;
26+
[Citing Cirq](#citing-cirq) &ndash;
27+
[Contact](#contact)
28+
29+
</div>
30+
31+
## Features
32+
33+
Cirq provides useful abstractions for dealing with today’s [noisy
34+
intermediate-scale quantum](https://arxiv.org/abs/1801.00862) (NISQ) computers,
35+
where the details of quantum hardware are vital to achieving state-of-the-art
36+
results. Some of its features include:
37+
38+
* Flexible gate definitions and custom gates
39+
* Parameterized circuits with symbolic variables
40+
* Circuit transformation, compilation and optimization
41+
* Hardware device modeling
42+
* Noise modeling
43+
* Multiple built-in quantum circuit simulators
44+
* Integration with [qsim](https://github.com/quantumlib/qsim) for
45+
high-performance simulation
46+
* Interoperability with [NumPy](https://numpy.org) and
47+
[SciPy](https://scipy.org)
48+
* Cross-platform compatibility
49+
50+
## Installation
51+
52+
Cirq supports Python version 3.10 and later, and can be used on Linux, MacOS,
53+
and Windows, as well as [Google Colab](https://colab.google). For complete
54+
installation instructions, please refer to the
55+
[Install](https://quantumai.google/cirq/start/install) section of the online
56+
Cirq documentation.
57+
58+
## Quick Start – “Hello Qubit” Example
59+
60+
Here is a simple example to get you up and running with Cirq after you have
61+
installed it. Start a Python interpreter, and then type the following:
62+
63+
```python
64+
import cirq
65+
66+
# Pick a qubit.
67+
qubit = cirq.GridQubit(0, 0)
68+
69+
# Create a circuit.
70+
circuit = cirq.Circuit(
71+
cirq.X(qubit)**0.5, # Square root of NOT.
72+
cirq.measure(qubit, key='m') # Measurement.
73+
)
74+
print("Circuit:")
75+
print(circuit)
76+
77+
# Simulate the circuit several times.
78+
simulator = cirq.Simulator()
79+
result = simulator.run(circuit, repetitions=20)
80+
print("Results:")
81+
print(result)
82+
```
83+
84+
Python should then print output similar to this:
85+
86+
```text
87+
Circuit:
88+
(0, 0): ───X^0.5───M('m')───
89+
Results:
90+
m=11000111111011001000
91+
```
92+
93+
Congratulations! You have run your first quantum simulation in Cirq. You can
94+
continue to learn more by exploring the [many Cirq tutorials](#tutorials)
95+
described below.
96+
97+
## Cirq Documentation
98+
99+
The primary documentation site for Cirq is the [Cirq home page on the Quantum
100+
AI website](https://quantumai.google/cirq). There and elsewhere, a variety of
101+
documentation for Cirq is available.
102+
103+
### Tutorials
104+
105+
* [Video tutorials] on YouTube are an engaging way to learn Cirq.
106+
* [Jupyter notebook-based tutorials] let you learn Cirq from your browser – no
107+
installation needed.
108+
* [Text-based tutorials] on the Cirq home page are great when combined with a
109+
local [installation] of Cirq on your computer. After starting with the
110+
[basics], you'll be ready to dive into tutorials on circuit building and
111+
circuit simulation under the [Build] and [Simulate] tabs, respectively. Check
112+
out the other tabs for more!
113+
114+
[Video tutorials]: https://www.youtube.com/playlist?list=PLpO2pyKisOjLVt_tDJ2K6ZTapZtHXPLB4
115+
[Jupyter notebook-based tutorials]: https://colab.research.google.com/github/quantumlib/Cirq
116+
[Text-based tutorials]: https://quantumai.google/cirq
117+
[installation]: https://quantumai.google/cirq/start/install
118+
[basics]: https://quantumai.google/cirq/start/basics
119+
[Build]: https://quantumai.google/cirq/build
120+
[Simulate]: https://quantumai.google/cirq/simula
121+
122+
### Reference Documentation
123+
124+
* Docs for the [current stable release] correspond to what you get with
125+
`pip install cirq`.
126+
* Docs for the [pre-release] correspond to what you get with
127+
`pip install cirq~=1.0.dev`.
128+
129+
[current stable release]: https://quantumai.google/reference/python/cirq/all_symbols
130+
[pre-release]: https://quantumai.google/reference/python/cirq/all_symbols?version=nightly
131+
132+
### Examples
133+
134+
* The [examples subdirectory](./examples/) of the Cirq GitHub repo has many
135+
programs illustrating the application of Cirq to everything from common
136+
textbook algorithms to more advanced methods.
137+
* The [Experiments page](https://quantumai.google/cirq/experiments/) on the
138+
Cirq documentation site has yet more examples, from simple to advanced.
139+
140+
### Change log
141+
142+
* The [Cirq releases](https://github.com/quantumlib/cirq/releases) page on
143+
GitHub lists the changes in each release.
144+
145+
## Integrations
146+
147+
Google Quantum AI has a suite of open-source software that lets you do more
148+
with Cirq. From high-performance simulators, to novel tools for expressing and
149+
analyzing fault-tolerant quantum algorithms, our software stack lets you
150+
develop quantum programs for a variety of applications.
151+
152+
<div align="center">
153+
154+
| Your interests | Software to explore |
155+
|-------------------------------------------------|----------------------|
156+
| Quantum algorithms?<br>Fault-tolerant quantum computing (FTQC)? | [Qualtran] |
157+
| Large circuits and/or a lot of simulations? | [qsim] |
158+
| Circuits with thousands of qubits and millions of Clifford operations? | [Stim] |
159+
| Quantum error correction (QEC)? | [Stim] |
160+
| Chemistry and/or material science? | [OpenFermion]<br>[OpenFermion-FQE]<br>[OpenFermion-PySCF]<br>[OpenFermion-Psi4] |
161+
| Quantum machine learning (QML)? | [TensorFlow Quantum] |
162+
| Real experiments using Cirq? | [ReCirq] |
163+
164+
</div>
165+
166+
[Qualtran]: https://github.com/quantumlib/qualtran
167+
[qsim]: https://github.com/quantumlib/qsim
168+
[Stim]: https://github.com/quantumlib/ssim
169+
[OpenFermion]: https://github.com/quantumlib/openfermion
170+
[OpenFermion-FQE]: https://github.com/quantumlib/OpenFermion-FQE
171+
[OpenFermion-PySCF]: https://github.com/quantumlib/OpenFermion-PySCF
172+
[OpenFermion-Psi4]: https://github.com/quantumlib/OpenFermion-Psi4
173+
[TensorFlow Quantum]: https://github.com/tensorflow/quantum
174+
[ReCirq]: https://github.com/quantumlib/ReCirq
175+
176+
## Community
177+
178+
<a href="https://github.com/quantumlib/Cirq/graphs/contributors"><img
179+
width="160em" alt="Total number of contributors to Cirq"
180+
src="https://img.shields.io/github/contributors/quantumlib/cirq?label=Contributors&logo=github&color=ccc&style=flat-square"/></a>
181+
182+
Cirq has benefited from [open-source contributions] by over 200 people and
183+
counting. We are dedicated to cultivating an open and inclusive community to
184+
build software for quantum computers, and have a [code of conduct] for our
185+
community.
186+
187+
[open-source contributions]: https://github.com/quantumlib/Cirq/graphs/contributors
188+
[code of conduct]: https://github.com/quantumlib/cirq/blob/main/CODE_OF_CONDUCT.md
189+
190+
### Announcements
191+
192+
Stay on top of Cirq developments using the approach that best suits your needs:
193+
194+
* For releases and major announcements: sign up to the low-volume mailing list
195+
[`cirq-announce`].
196+
* For releases only:
197+
* Via GitHub notifications: configure [repository notifications] for Cirq.
198+
* Via Atom/RSS from GitHub: subscribe to the GitHub [Cirq releases Atom feed].
199+
* Via RSS from PyPI: subscribe to the [PyPI releases RSS feed] for Cirq.
200+
201+
Cirq releases take place approximately every quarter.
202+
203+
[`cirq-announce`]: https://groups.google.com/forum/#!forum/cirq-announce
204+
[repository notifications]: https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/configuring-notifications
205+
[Cirq releases Atom feed]: https://github.com/quantumlib/Cirq/releases.atom
206+
[PyPI releases RSS feed]: https://pypi.org/rss/project/cirq/releases.xml
207+
208+
### Questions and Discussions
209+
210+
* Do you have questions about using Cirq? Post them to the [Quantum Computing
211+
Stack Exchange] and tag them with the [`cirq`] tag. You can also search past
212+
questions using that tag – it's a great way to learn!
213+
* Would you like to get more involved in Cirq development? _Cirq Cynq_ is our
214+
biweekly virtual meeting of contributors to discuss everything from issues to
215+
ongoing efforts, as well as to ask questions. Become a member of
216+
[_cirq-dev_](https://groups.google.com/forum/#!forum/cirq-dev) to get an
217+
automatic meeting invitation!
218+
219+
[Quantum Computing Stack Exchange]: https://quantumcomputing.stackexchange.com
220+
[`cirq`]: https://quantumcomputing.stackexchange.com/questions/tagged/cirq
221+
222+
### Issues and Pull Requests
223+
224+
* Do you have a feature request or want to report a bug? [Open an issue on
225+
GitHub] to report it!
226+
* Do you have a code contribution? Read our [contribution guidelines], then
227+
open a [pull request]!
228+
229+
[Open an issue on GitHub]: https://github.com/quantumlib/Cirq/issues/new/choose
230+
[contribution guidelines]: https://github.com/quantumlib/cirq/blob/main/CONTRIBUTING.md
231+
[pull request]: https://help.github.com/articles/about-pull-requests
232+
233+
## Citing Cirq<a name="how-to-cite-cirq"></a>
234+
235+
When publishing articles or otherwise writing about Cirq, please cite the Cirq
236+
version you use – it will help others reproduce your results. We use Zenodo to
237+
preserve releases. The following links let you download the bibliographic
238+
record for the latest stable release of Cirq in some popular formats:
239+
240+
<div align="center">
241+
242+
[![Download BibTeX bibliography record for latest Cirq
243+
release](https://img.shields.io/badge/Download%20record-e0e0e0.svg?style=flat-square&logo=LaTeX&label=BibTeX&labelColor=106f6e)](https://citation.doi.org/format?doi=10.5281/zenodo.4062499&style=bibtex)&nbsp;&nbsp;
244+
[![Download CSL JSON bibliography record for latest Cirq
245+
release](https://img.shields.io/badge/Download%20record-e0e0e0.svg?style=flat-square&label=CSL&labelColor=2d98e0&logo=json)](https://citation.doi.org/metadata?doi=10.5281/zenodo.4062499)
246+
247+
</div>
248+
249+
For formatted citations and records in other formats, as well as records for
250+
all releases of Cirq past and present, please visit the [Cirq page on
251+
Zenodo](https://doi.org/10.5281/zenodo.4062499).
252+
253+
## Contact
254+
255+
For any questions or concerns not addressed here, please email
256+
<quantum-oss-maintainers@google.com>.
257+
258+
## Disclaimer
259+
260+
Cirq is not an official Google product. Copyright 2019 The Cirq Developers.

README.rst

Lines changed: 0 additions & 126 deletions
This file was deleted.

dev_tools/snippets_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
def test_can_run_readme_code_snippets():
7171
# Get the contents of the README.md file at the project root.
72-
readme_path = 'README.rst'
72+
readme_path = 'README.md'
7373
assert readme_path is not None
7474

7575
assert_file_has_working_code_snippets(readme_path, assume_import=False)

0 commit comments

Comments
 (0)