Skip to content

Commit 8a106dd

Browse files
committed
Merge branch 'main' into use-future-annotations-1
2 parents 7332338 + c50ce1e commit 8a106dd

34 files changed

+201
-165
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ cb6940a40141dba95cba84f5acc27acbeb65b17c
2424

2525
# Format proto files (#7133)
2626
5cf0e8df8f3e097b8d496cba1c2d4bd04cb83546
27+
28+
# Sort import statements - no change in the effective code (#7195)
29+
250f12964f027c68775c5c7989f7b6000f989f06

cirq-core/cirq/contrib/paulistring/pauli_string_measurement_with_readout_mitigation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,13 @@ def measure_pauli_strings(
283283
"""Measures expectation values of Pauli strings on given circuits with/without
284284
readout error mitigation.
285285
286-
This function takes a list of circuits and corresponding List[Pauli string] to measure.
287-
For each circuit-List[Pauli string] pair, it:
286+
This function takes a list of circuits and corresponding List[PauliString] to measure.
287+
For each circuit-List[PauliString] pair, it:
288288
1. Constructs circuits to measure the Pauli string expectation value by
289289
adding basis change moments and measurement operations.
290290
2. Runs shuffled readout benchmarking on these circuits to calibrate readout errors.
291291
3. Mitigates readout errors using the calibrated confusion matrices.
292-
4. Calculates and returns both error-mitigated and unmitigatedexpectation values for
292+
4. Calculates and returns both error-mitigated and unmitigated expectation values for
293293
each Pauli string.
294294
295295
Args:
@@ -300,9 +300,9 @@ def measure_pauli_strings(
300300
Pauli strings.
301301
readout_repetitions: The number of repetitions for readout calibration
302302
in the shuffled benchmarking.
303-
num_random_bitstrings: The number of random bitstrings to use in shuffled
303+
num_random_bitstrings: The number of random bitstrings to use in readout
304304
benchmarking.
305-
rng_or_seed: A random number generator or seed for the shuffled benchmarking.
305+
rng_or_seed: A random number generator or seed for the readout benchmarking.
306306
307307
Returns:
308308
A list of CircuitToPauliStringsMeasurementResult objects, where each object contains:

docs/_book.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ upper_tabs:
239239
path: /cirq/dev/versions
240240
- title: "Triage process"
241241
path: /cirq/dev/triage
242-
- title: "Issues / requests / questions"
242+
- title: "Issues, requests, and questions"
243243
path: /cirq/dev/support
244244

245245
- name: "Reference"

docs/build/_index.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ landing_page:
4040
description: Build and measure observables from sums and products of Pauli operators.
4141
path: /cirq/build/pauli_observables
4242
- heading: Qudits
43-
description: Qutrits and higher dimensional quantum systems.
43+
description: Qutrits and higher-dimensional quantum systems.
4444
path: /cirq/build/qudits
4545
- heading: Protocols
4646
description: Magic methods supported by Cirq's classes.

docs/build/ecosystem.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,66 @@
1-
The following document provides an ecosystem overview of how the various tools compatible with Cirq can work together to enable quantum computing research.
1+
# Research libraries and tools
2+
3+
The following document provides an ecosystem overview of various open-source tools compatible with Cirq and that can work together to enable quantum computing research.
24

35
![image alt text](../images/ecosystem.png)
46

5-
* **Research Libraries and Tools:** Libraries and tools used for researching new quantum algorithms and designing and preparing experiments on quantum devices.
7+
* **Research Libraries and Tools**: Libraries and tools used for researching new quantum algorithms and designing and preparing experiments on quantum devices.
68

79
* **Cirq**: A framework specifically for programming noisy intermediate-scale quantum computers.
810

9-
* **Quantum Cloud Services:** Cirq can connect to a variety of quantum cloud services. Behind each cloud service, quantum algorithms run on either a quantum processor or simulator.
11+
* **Quantum Cloud Services**: Cirq can connect to a variety of quantum cloud services. Behind each cloud service, quantum algorithms run on either a quantum processor or simulator.
1012

11-
* **Quantum Circuit Simulators:** Cirq is compatible with a number of quantum circuit simulators that can run either locally or in a distributed fashion.
12-
13-
# Research libraries and tools
13+
* **Quantum Circuit Simulators**: Cirq is compatible with a number of quantum circuit simulators that can run either locally or in a distributed fashion.
1414

1515
## Algorithm libraries and experiments
1616

1717
|Name|Main sponsor|Description|
1818
|--- |--- |--- |
19-
|[Cirq](https://github.com/quantumlib/Cirq)|Google|An open-source framework for creating, editing, and invoking Noisy Intermediate-Scale Quantum (NISQ) circuits.|
20-
|[OpenFermion](https://github.com/quantumlib/OpenFermion)|Google|An open-source algorithms library for developing new quantum chemistry and materials simulation algorithms|
21-
|[TensorFlow Quantum](https://tensorflow.org/quantum)|Google|An open-source algorithms library for developing new quantum machine learning algorithms|
22-
|[Qualtran](https://github.com/quantumlib/qualtran)|Google|An open-source library for expressing and analyzing fault-tolerant quantum algorithms|
23-
|[Stim](https://github.com/quantumlib/stim)|Google|An open-source library for high-speed simulation of Clifford circuits and quantum error correction|
24-
|[ReCirq](https://github.com/quantumlib/ReCirq)|Google|An open-source repository of example experiments, tools, and tutorials in quantum computing|
25-
|[Forge](https://forge.qcware.com/)|QCWare|A proprietary library for domain-specific quantum algorithms and applications|
26-
|[Pennylane](https://pennylane.ai/)|Xanadu|An open-source library for quantum machine learning with TensorFlow, PyTorch, or NumPy|
19+
|[Cirq](https://github.com/quantumlib/Cirq)|Google|A framework for creating, editing, and invoking Noisy Intermediate-Scale Quantum (NISQ) circuits.|
20+
|[OpenFermion](https://github.com/quantumlib/OpenFermion)|Google|An algorithms library for developing new quantum chemistry and materials simulation algorithms|
21+
|[Qualtran](https://github.com/quantumlib/qualtran)|Google|A library for expressing and analyzing fault-tolerant quantum algorithms|
22+
|[ReCirq](https://github.com/quantumlib/ReCirq)|Google|A repository of example experiments, tools, and tutorials in quantum computing|
23+
|[Stim](https://github.com/quantumlib/stim)|Google|A library for high-speed simulation of Clifford circuits and quantum error correction|
24+
|[TensorFlow Quantum](https://tensorflow.org/quantum)|Google|A library for developing new quantum machine learning algorithms|
25+
|[unitary](https://github.com/quantumlib/unitary)|Google|An API library providing common operations for adding quantum behaviors to games|
26+
|[Pennylane](https://pennylane.ai/)|Xanadu|A library for quantum machine learning with TensorFlow, PyTorch, or NumPy|
2727

2828
## Development tools
2929

3030
|Name|Main sponsor|Description|
3131
|--- |--- |--- |
32-
|[Mitiq](https://github.com/unitaryfund/mitiq)|Unitary Foundation|An open-source library for error mitigation|
33-
|[pyGSTi](https://www.pygsti.info/)|Sandia National Labs|An open-source library for modeling and characterizing noisy quantum information processors|
34-
|[QUEKO](https://github.com/UCLA-VAST/QUEKO-benchmark)|UCLA|An open-source tool to generate benchmarks with the known optimal solutions|
35-
|[tket](https://cqcl.github.io/tket/pytket/api/index.html)|Cambridge Quantum|An open-source and platform agnostic SDK for circuit optimisation, compilation and noise mitigation|
36-
|[True-Q](https://trueq.quantumbenchmark.com/)|Quantum Benchmark|A proprietary library for assessing and optimizing quantum hardware and algorithm performance.|
32+
|[BQSKit](https://bqskit.lbl.gov/)|Lawrence Berkeley Labs|A portable quantum compiler framework with circuit optimization, synthesis, and gate set transpilation|
33+
|[Mitiq](https://github.com/unitaryfund/mitiq)|Unitary Foundation|A library for error mitigation|
34+
|[pyGSTi](https://www.pygsti.info/)|Sandia National Labs|A library for modeling and characterizing noisy quantum information processors|
35+
|[Qristal](https://github.com/qbrilliance/qristal)|Quantum Brilliance|A library for designing, optimizing, simulating and running hybrid quantum programs|
36+
|[Quantum Programming Studio](https://quantum-circuit.com/)|Quantastica|Web system for constructing and simulating quantum algorithms|
37+
|[QUEKO](https://github.com/UCLA-VAST/QUEKO-benchmark)|UCLA|A tool for generating benchmarks with known optimal solutions|
38+
|[QuTiP](https://github.com/qutip)|QuTiP|Toolbox for user-friendly and efficient numerical simulations of a wide variety of Hamiltonians|
39+
|[staq](https://github.com/softwareQinc/staq)|softwareQ Inc|C++ library for the synthesis, transformation, optimization, and compilation of quantum circuits|
40+
|[Superstaq](https://github.com/Infleqtion/client-superstaq/tree/main)|Infleqtion|An SDK that optimizes the execution of quantum programs by tailoring to underlying hardware primitives|
41+
|[tket](https://docs.quantinuum.com/tket/index.html)|Quantinuum|A platform-agnostic SDK for circuit optimization, compilation and noise mitigation|
42+
|[XACC](https://github.com/ORNL-QCI/xacc)|Oak Ridge National Labs|Extensible compilation framework using a novel, polymorphic quantum intermediate representation|
3743

38-
## Supported quantum cloud services
44+
## Quantum computing cloud services
3945

4046
|Company|Type of Quantum Computer|
4147
|--- |--- |
4248
|[Alpine Quantum Technologies](https://quantumai.google/cirq/hardware/aqt/getting_started)|Trapped ions|
4349
|[IonQ](https://quantumai.google/cirq/hardware/ionq/getting_started)|Trapped ions|
50+
|[IQM](https://iqm-finland.github.io/cirq-on-iqm/)|Superconducting qubits|
4451
|[Microsoft Azure Quantum](https://quantumai.google/cirq/hardware/azure-quantum/getting_started_ionq)|Trapped ions (Honeywell and IonQ)|
4552
|[Pasqal](https://quantumai.google/cirq/hardware/pasqal/getting_started)|Neutral atoms|
46-
|[Rigetti](https://quantumai.google/cirq/hardware/rigetti/getting_started)|Superconducting qubits|
4753

48-
For more information for vendors about integrating with cirq,
54+
For more information for vendors about integrating with Cirq,
4955
see our [RFC page](../dev/rfc_process.md#new_hardware_integrations).
5056

5157
## High performance quantum circuit simulators
5258

5359
|Name|Main sponsor|Description|
5460
|--- |--- |--- |
55-
|[qsim](https://github.com/quantumlib/qsim)|Google|An open-source, high-performance circuit simulator for Schrödinger simulations|
56-
|[quimb](https://github.com/jcmgray/quimb)|Johnny Gray|An open-source, high-performance circuit simulator using tensor-networks|
57-
|[qulacs](https://github.com/qulacs/cirq-qulacs)|Quansys|An open-source, high-performance circuit simulator for Schrödinger simulations|
58-
|[Stim](https://github.com/quantumlib/stim)|Google|An open-source library for high-speed simulation of Clifford circuits and quantum error correction|
59-
|[cuQuantum](https://developer.nvidia.com/cuquantum-sdk)|Nvidia|Tools for speeding up quantum simulation on GPUs|
61+
|[Qibo](https://qibo.science/)|Technology Innovation Institute|API library for hardware-accelerated quantum simulation and quantum hardware control|
62+
|[qsim](https://github.com/quantumlib/qsim)|Google|A high-performance circuit simulator for Schrödinger simulations|
63+
|[quimb](https://github.com/jcmgray/quimb)|Johnnie Gray|A high-performance circuit simulator using tensor-networks|
64+
|[qulacs](https://github.com/qulacs/cirq-qulacs)|Quansys|A high-performance circuit simulator for Schrödinger simulations|
65+
|[Stim](https://github.com/quantumlib/stim)|Google|A library for high-speed simulation of Clifford circuits and quantum error correction|
66+
|[cuQuantum](https://github.com/NVIDIA/cuQuantum)|NVIDIA|API libraries for speeding up quantum simulation on NVIDIA GPUs|

docs/citation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ When using our projects, please cite them according to the following guide:
1111
| ReCirq | https://github.com/quantumlib/ReCirq#how-to-cite-recirq |
1212
| Stim | https://github.com/quantumlib/stim#how-cite-stim |
1313
| Tensorflow Quantum | https://github.com/tensorflow/quantum#references|
14+
| Tesseract Decoder | https://github.com/quantumlib/tesseract-decoder#citation|

docs/dev/development.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cd Cirq
1515

1616
## Recommended git setup
1717

18-
The following command will setup large refactoring revisions to be ignored, when using git blame.
18+
The following command will set up large refactoring revisions to be ignored, when using git blame.
1919

2020
```
2121
git config blame.ignoreRevsFile .git-blame-ignore-revs
@@ -24,7 +24,7 @@ git config blame.ignoreRevsFile .git-blame-ignore-revs
2424
Note that if you are using PyCharm, you might have to use the command Restart & Invalidate Caches to have the change be picked up.
2525

2626
## Docker
27-
You can build the stable and pre_release Docker images with our `Dockerfile`.
27+
You can build the stable and pre-release Docker images with our `Dockerfile`.
2828

2929
```bash
3030
docker build -t cirq --target cirq_stable .
@@ -105,11 +105,10 @@ See the previous section for instructions.
105105
Docker or configure permissions on your system; see the
106106
[Docker installation instructions](https://docs.docker.com/engine/install/ubuntu/)
107107
for more information.
108-
Note that Docker is necessary only for the `cirq-rigetti` module.
109108

110109
There are some extra steps if Protocol Buffers are changed; see the next section.
111110

112-
2. Prepare a virtual environment including the dev tools (such as Mypy).
111+
2. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy).
113112

114113
One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to create virtual environments.
115114
If you did not have `virtualenvwrapper` previously, you may need to re-open your terminal or run `source ~/.bashrc` before these commands will work:
@@ -123,7 +122,7 @@ See the previous section for instructions.
123122

124123
(When you later open another terminal, you can activate the virtualenv with `workon cirq-py3`.)
125124

126-
**Note:** Some highly managed or customized devices have configurations that interfere with `virtualenv`.
125+
**Note**: Some highly managed or customized devices have configurations that interfere with `virtualenv`.
127126
In that case, [anaconda](https://www.anaconda.com/) environments may be a better choice.
128127

129128
3. Check that the tests pass.
@@ -147,7 +146,7 @@ See the previous section for instructions.
147146
```bash
148147
add2virtualenv <paste modules from last command>
149148
```
150-
(Typically `add2virtualenv` is not executable using xargs, so this two step process is necessary.)
149+
(Typically `add2virtualenv` is not executable using `xargs`, so this two step process is necessary.)
151150

152151
## Editable installs
153152

docs/dev/gates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ In some cases the default behavior of using `__str__` is sufficient.
4646

4747
4. If the `__repr__` is cumbersome, gates should specify a `_repr_pretty_`
4848
method.
49-
This method will be used preferentially by Jupyter notebooks, ipython, etc.
49+
This method will be used preferentially by Jupyter notebooks, iPython, etc.
5050

5151
5. Gates should specify an `_apply_unitary_` method.
5252
This is not necessary for single or two qubit gates, but it is a huge
@@ -62,6 +62,6 @@ generally surprising to users.
6262
If you have to use an operation, try to have the `.gate` property of the
6363
operation can return something useful instead of `None`.
6464

65-
8. Consider adding interop methods like `_qasm_`.
65+
8. Consider adding interoperability methods like `_qasm_`.
6666
These methods will fallback to using things like `_decompose_`, but the output
6767
is usually much better when specialized.

docs/dev/modules.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cirq modules
22

3-
Cirq has a modular architecture and is organized in a monorepo, all of the modules follow the same folder structure.
3+
Cirq has a modular architecture and is organized in a monorepo. All of the modules follow the same folder structure.
44
Each module is structured as follows. Let's take as example a module named `cirq-example`:
55

66
```
@@ -21,14 +21,14 @@ cirq-example
2121

2222
Note that typically there is only a single top level package, `cirq_example` - but there might be exceptions.
2323

24-
Additionally, there is a metapackage "cirq" that's a completely different beast and just depends on the modules.
24+
Additionally, there is a metapackage named `cirq` that's a completely different beast and just depends on the modules.
2525
This enables `pip install cirq` to have all the included modules to be installed for our users.
2626

2727
All modules should depend on `cirq-core`, which is the central, core library for Cirq.
2828

2929
## Packaging
3030

31-
Each package gets published to PyPi as a separate package. To build all the wheel files locally, use
31+
Each package gets published to PyPI as a separate package. To build all the wheel files locally, use
3232

3333
```bash
3434
dev_tools/packaging/produce-package.sh ./dist `./dev_tools/packaging/generate-dev-version-id.sh`
@@ -38,13 +38,13 @@ Packages are versioned together, share the same version number, and are released
3838

3939
## Setting up a new module
4040

41-
To setup a new module follow these steps:
41+
To set up a new module follow these steps:
4242

4343
1. Create the folder structure above, copy the files based on an existing module
44-
1. LICENSE should be the same
45-
2. README.md will be the documentation that appears in PyPi
46-
3. setup.py should specify an `install_requires` configuration that has `cirq-core=={module.version}` at the minimum
47-
2. Setup JSON serialization for each top level python package
44+
1. The `LICENSE` file should be the same
45+
2. The `README.md` file will be the documentation that appears in PyPI
46+
3. The `setup.py` file should specify an `install_requires` configuration that has `cirq-core=={module.version}` at the minimum
47+
2. Set up JSON serialization for each top level Python package
4848

4949

5050
### Setting up JSON serialization
@@ -85,7 +85,7 @@ To setup a new module follow these steps:
8585
```
8686
2. `__init__.py` should import `TestSpec` from `spec.py`
8787
3. in `cirq/protocols/json_serialization_test.py` add `'cirq_example':None` to the `TESTED_MODULES` variable. `TESTED_MODULES` is also used to prepare the test framework for deprecation warnings.
88-
With new modules, we use`None` as there is no deprecation setup.
88+
With new modules, we use `None` as there is no deprecation setup.
8989

9090
You can run `check/pytest-changed-files` and that should execute the script `json_serialization_test.py` as well.
9191

docs/dev/notebooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ them to `SKIP_NOTEBOOKS` within the file `dev_tools/notebooks/notebook_test.py`.
6262

6363
External dependencies, for these purposes, are calls to external services and
6464
APIs, such as vendor endpoints for cloud services. These can also include
65-
external downloads, such as installing packages from unknown debian
65+
external downloads, such as installing packages from unknown Debian
6666
repositories, which may be blocked for security reasons.
6767

6868
The site that generates the outputs for notebooks also can't handle external dependencies.
@@ -71,7 +71,7 @@ Thus, for notebooks with external dependencies, **all cells must have their outp
7171

7272
## Lifecycle
7373

74-
You should configure notebooks differently depending on whether they rely on features in the pre-release build of cirq or not.
74+
You should configure notebooks differently depending on whether they rely on features in the pre-release build of Cirq or not.
7575

7676
### Pre-release notebooks
7777

0 commit comments

Comments
 (0)