Skip to content
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

Fix typos in notebooks.md and a plenty of relative links #6089

Merged
merged 10 commits into from
May 16, 2023
2 changes: 1 addition & 1 deletion dev_tools/cirq-infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This doc describes cirq-infra, the GCP project supporting our open source project.
The following things are planned to be running on GCP:

- [X] Cirq bot / Automerge - see [../auto_merge](../auto_merge/README.md)
- [X] Cirq bot / PR monitor - see [../pr_monitor](../pr_monitor/README.md)
- [X] Triage party for triaging
- [ ] Performance tests and reports

Expand Down
6 changes: 3 additions & 3 deletions docs/build/circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,9 @@
"- [Operators](operators.ipynb) - more complicated structures to put in circuits\n",
"\n",
"Once you've built your circuit, read these to learn what you can do with it: \n",
"- [Simulation](/cirq/simulate/simulation.ipynb) - run your circuit on the Cirq simulator to see what it does\n",
"- [Quantum Virtual Machine](/cirq/simulate/quantum_virtual_machine) - run your circuit on a specialized simulator that mimics actual quantum hardware, including noise.\n",
"- [Transform circuits](/cirq/transform/transformers.ipynb) - run transformer functions to change your circuit in different ways\n",
"- [Simulation](../simulate/simulation.ipynb) - run your circuit on the Cirq simulator to see what it does\n",
"- [Quantum Virtual Machine](../simulate/quantum_virtual_machine.ipynb) - run your circuit on a specialized simulator that mimics actual quantum hardware, including noise.\n",
"- [Transform circuits](../transform/transformers.ipynb) - run transformer functions to change your circuit in different ways\n",
"\n",
"If you need to import or export circuits into or out of Cirq, see: \n",
"- [Import/export circuits](interop.ipynb) - features to serialize/deserialize circuits into/from different formats"
Expand Down
6 changes: 3 additions & 3 deletions docs/build/classical_control.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"id": "8ccb64c25e3a"
},
"source": [
"While some quantum algorithms can be defined entirely at the quantum level, there are many others (notably including [teleportation](/cirq/experiments/textbook_algorithms#quantum_teleportation) and [error correction](https://www.nature.com/articles/s41586-021-03588-y)) which rely on classical measurement results from one part of the algorithm to control operations in a later section.\n",
"While some quantum algorithms can be defined entirely at the quantum level, there are many others (notably including [teleportation](../experiments/textbook_algorithms.ipynb#quantum_teleportation) and [error correction](https://www.nature.com/articles/s41586-021-03588-y)) which rely on classical measurement results from one part of the algorithm to control operations in a later section.\n",
"\n",
"To represent this, Cirq provides the `ClassicallyControlledOperation`. Following the pattern of controlled operations, a classically-controlled version of any `Operation` can be constructed by calling its `with_classical_controls` method with the control condition(s)."
]
Expand Down Expand Up @@ -120,7 +120,7 @@
"source": [
"The results from running the circuit on the simulator match expectation. `H` applied to qubit `q0` means that qubit will be $|1\\rangle$ half of the time on average. When `H` is then applied to qubit `q1`, (half of the time), `q1` will measure $|1\\rangle$ a quarter of the time and $|0\\rangle$ three-quarters of the time.\n",
"\n",
"Using just these conditions, we can construct the [quantum teleportation](/cirq/experiments/textbook_algorithms#quantum_teleportation) circuit:"
"Using just these conditions, we can construct the [quantum teleportation](../experiments/textbook_algorithms.ipynb#quantum_teleportation) circuit:"
]
},
{
Expand Down Expand Up @@ -320,7 +320,7 @@
"source": [
"## Using with transformers\n",
"\n",
"Cirq [transformers](/cirq/transform/transformers.ipynb) are aware of classical control and will avoid changes which move a control before its corresponding measurement. Additionally, for some simple cases the [`defer_measurements` transformer](https://github.com/quantumlib/Cirq/blob/6e0e164e8ac1c2f28a1f3389370fffb50a4d2a4f/cirq-core/cirq/transformers/measurement_transformers.py#L58) can convert a classically-controlled circuit into a purely-quantum circuit:"
"Cirq [transformers](../transform/transformers.ipynb) are aware of classical control and will avoid changes which move a control before its corresponding measurement. Additionally, for some simple cases the [`defer_measurements` transformer](https://github.com/quantumlib/Cirq/blob/6e0e164e8ac1c2f28a1f3389370fffb50a4d2a4f/cirq-core/cirq/transformers/measurement_transformers.py#L58) can convert a classically-controlled circuit into a purely-quantum circuit:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/build/custom_gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
"These gates can be understood by the simulator, optimizers, and other code.\n",
"3. All that matters is functional equivalence.\n",
"Don't worry about staying within or reaching a particular gate set; it's too hard to predict what the caller will want. Gate-set-aware decomposition is useful, but *this is not the protocol that does that*.\n",
"Instead, use features available in the [transformer API](/cirq/transform/transformers.ipynb#compiling_to_nisq_targets_cirqcompilationtargetgateset).\n",
"Instead, use features available in the [transformer API](../transform/transformers.ipynb#compiling_to_nisq_targets_cirqcompilationtargetgateset).\n",
"\n",
"For example, `cirq.CCZ` decomposes into a series of `cirq.CNOT` and `cirq.T` operations.\n",
"This allows code that doesn't understand three-qubit operation to work with `cirq.CCZ`; by decomposing it into operations they do understand.\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/build/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following document provides an ecosystem overview of how the various tools c
|[Rigetti](https://quantumai.google/cirq/hardware/rigetti/getting_started)|Superconducting qubits|

For more information for vendors about integrating with cirq,
see our [RFC page](/cirq/dev/rfc_process#new_hardware_integrations).
see our [RFC page](../dev/rfc_process.md#new_hardware_integrations).


## High performance quantum circuit simulators
Expand Down
2 changes: 1 addition & 1 deletion docs/build/gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"unitaries and associated probabilities of a mixture can be accessed by\n",
"`cirq.mixture(gate)`. The Kraus operator representation of a channel can be\n",
"accessed by `cirq.kraus(gate)`. Non-unitary gates are often used in the\n",
"simulation of noise. See [noise documentation](/cirq/simulate/noisy_simulation.ipynb) for more details.\n",
"simulation of noise. See [noise documentation](../simulate/noisy_simulation.ipynb) for more details.\n",
"\n",
"Many arithmetic operators will work in the expected way when applied to\n",
"gates. For instance, ``cirq.X**0.5`` represents a square root of X gate.\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/build/operators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
"id": "00e6acd6ca82"
},
"source": [
"The `key` can be used to identify results of measurements when [simulating circuits](/cirq/simulate/simulation.ipynb). A measurement gate acting on a qubit forms an operation."
"The `key` can be used to identify results of measurements when [simulating circuits](../simulate/simulation.ipynb). A measurement gate acting on a qubit forms an operation."
]
},
{
Expand Down Expand Up @@ -529,7 +529,7 @@
"id": "aa5f8ad751d3"
},
"source": [
"Custom noisy channels can be defined as described in [this guide](/cirq/simulate/noisy_simulation.ipynb)."
"Custom noisy channels can be defined as described in [this guide](../simulate/noisy_simulation.ipynb)."
]
},
{
Expand Down Expand Up @@ -572,7 +572,7 @@
"id": "9eeae0d8a85e"
},
"source": [
"The general input to the circuit constructor is a `cirq.OP_TREE`, i.e., an operation or nested collection of operations. Circuits can be manipulated as described in the [circuits guide](circuits.ipynb) and simulated as described in the [simulation guide](/cirq/simulate/simulation.ipynb)."
"The general input to the circuit constructor is a `cirq.OP_TREE`, i.e., an operation or nested collection of operations. Circuits can be manipulated as described in the [circuits guide](circuits.ipynb) and simulated as described in the [simulation guide](../simulate/simulation.ipynb)."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/build/pauli_observables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"\n",
"[Observables](https://en.wikipedia.org/wiki/Observable){:.external} are, in general, some sort of measurable property of a circuit. At its very simplest, this could be whether a qubit measures to be $|0\\rangle$ or $|1\\rangle$ in the standard computational basis. In the Pauli basis, this corresponds to the `Z` observable. In general, this is roughly a way to measure qubit state in a basis other than the computational one, by applying basis-changing operations before measurement. \n",
"\n",
"In Cirq, compositions, linear combinations, and tensor products of Pauli operators are represented with `cirq.PauliString` and `cirq.PauliSum`, which this tutorial will demonstrate next. Fundamentally, these objects are still [Operations](/cirq/build/operators), and can be added to circuits like any other operation. The second half of this tutorial will cover the second use of `PauliString`s, as observables in measurement. "
"In Cirq, compositions, linear combinations, and tensor products of Pauli operators are represented with `cirq.PauliString` and `cirq.PauliSum`, which this tutorial will demonstrate next. Fundamentally, these objects are still [Operations](./operators.ipynb), and can be added to circuits like any other operation. The second half of this tutorial will cover the second use of `PauliString`s, as observables in measurement. "
]
},
{
Expand Down Expand Up @@ -653,7 +653,7 @@
"If you need to measure many different `PauliString`s (not `PauliSum`s), for a circuit, `cirq.measure_observables` may fit your needs. It serves to estimate each observable in a provided iterable by computing the mean and variance over a number of repetitions defined by the `stopping_criteria` argument. In the example below, this stopping criteria is fixed at `50,000` repetitions. \n",
"\n",
"The function also supports the following optional arguments, which expand its functionality: \n",
"- circuit_sweep: A parameter sweep as in [Parameter Sweeps](/cirq/simulate/params)\n",
"- circuit_sweep: A parameter sweep as in [Parameter Sweeps](../simulate/params.ipynb)\n",
"- readout_calibrations: An input to make use of previously-collected readout error data.\n",
"- grouper: A strategy to group the observables so multiple observables can be measured in the same run (uses default greedy strategy).\n",
"- readout_symmetrization: Applies a bit flip after half of the runs to make readout error seem symmetric"
Expand Down
2 changes: 1 addition & 1 deletion docs/build/qudits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"source": [
"### Unitaries, mixtures, and channels on qudits\n",
"\n",
"The magic methods `_unitary_`, `_apply_unitary_`, `_mixture_`, and `_kraus_` can be used to define unitary gates, mixtures, and channels can be used with qudits (see [protocols](protocols.md) for how these work.)\n",
"The magic methods `_unitary_`, `_apply_unitary_`, `_mixture_`, and `_kraus_` can be used to define unitary gates, mixtures, and channels can be used with qudits (see [protocols](protocols.ipynb) for how these work.)\n",
"\n",
"Because the state space for qudits for $d>2$ live on larger dimensional spaces, the corresponding objects returned by the magic methods will be of corresponding higher dimension. "
]
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ To setup a new module follow these steps:

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

That's it! Now, you can follow the [Serialization guide](/cirq/dev/serialization.md) for adding and removing serializable objects.
That's it! Now, you can follow the [Serialization guide](./serialization.md) for adding and removing serializable objects.

# Utilities

Expand Down
4 changes: 2 additions & 2 deletions docs/dev/notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ In order to speed up the execution of these tests an auxiliary file may be suppl
to reduce the number of repetitions in sampling from a simulator).

To do this, for a notebook file notebook.ipynb, one can supply a file notebook.tst which contains the substitutes.
The substitutions are provide in the form `pattern->replacement` where the pattern is what is matched and will be replaced.
While the pattern is compiled, it is considered best practice to not sure complicated regular expressions.
The substitutions are provided in the form `pattern->replacement` where the pattern is what is matched and will be replaced.
While the pattern is compiled, it is considered best practice to not use complicated regular expressions.
Lines in this file that do not have `->` are ignored. Note that because the pattern is
compiled, it may be necessary to escape the pattern, however it is best to try to avoid
such complicated expressions.
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/rfc_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ review process is to ensure all integrations end up with a well-maintained, user
friendly interface with a high reliability.

Examples of other integrations can be found on the
[Hardware page](/cirq/hardware).
[Hardware page](../hardware).

There are a range of possibilities for integrating with cirq, including:

Expand Down
4 changes: 2 additions & 2 deletions docs/dev/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ If the returned object has a `_from_json_dict_` attribute, it is called instead.
## Adding a new serializable value

All of Cirq's public classes should be serializable. Public classes are the ones that can be found in the Cirq module top level
namespaces, i.e. `cirq.*`, `cirq_google.*`, `cirq_aqt.*`, etc, (see [Cirq modules](/cirq/dev/modules.md) for setting up JSON serialization for a module).
namespaces, i.e. `cirq.*`, `cirq_google.*`, `cirq_aqt.*`, etc, (see [Cirq modules](./modules.md) for setting up JSON serialization for a module).
This is enforced by the `test_json_test_data_coverage` test in
`cirq-core/cirq/protocols/json_serialization_test.py`, which iterates over cirq's API
looking for types with no associated json test data.
Expand Down Expand Up @@ -162,4 +162,4 @@ given top level package's spec.py (`<module>/<top level package>/json_test_data/
name to `should_not_serialize`.

We allow for incremental introduction of new objects to serializability - if an object should be
serialized but is not yet serializable, it should be added to the `not_yet_serializable` list in the `spec.py` file.
serialized but is not yet serializable, it should be added to the `not_yet_serializable` list in the `spec.py` file.
2 changes: 1 addition & 1 deletion docs/experiments/variational_algorithm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"source": [
"## Create a circuit on a Grid\n",
"\n",
"To build the above variational quantum algorithm using Cirq, one begins by building the appropriate circuit. Because the problem we have defined has a natural structure on a grid, we will use Cirq’s built-in `cirq.GridQubit`s as our qubits. We will demonstrate some of how this works in an interactive Python environment, the following code can be run in series in a Python environment where you have Cirq installed. For more about circuits and how to create them, see the [Tutorial](/cirq/start/basics.ipynb) or the [Circuits](/cirq/build/circuits.ipynb) page."
"To build the above variational quantum algorithm using Cirq, one begins by building the appropriate circuit. Because the problem we have defined has a natural structure on a grid, we will use Cirq’s built-in `cirq.GridQubit`s as our qubits. We will demonstrate some of how this works in an interactive Python environment, the following code can be run in series in a Python environment where you have Cirq installed. For more about circuits and how to create them, see the [Tutorial](../start/basics.ipynb) or the [Circuits](../build/circuits.ipynb) page."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/google/access.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sponsor so that they can be added.
## Next Steps

At this point, you should now have access to the Quantum Computing Service.
You can try out our [Getting Started Guide](/cirq/tutorials/google/start.ipynb).
You can try out our [Getting Started Guide](../tutorials/google/start.ipynb).

You can also learn more about how to use the [Engine class](engine.md) to
access Google hardware or about [Google devices](devices.md) in the
Expand Down
18 changes: 9 additions & 9 deletions docs/google/best_practices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"`cg.Sycamore.validate_circuit(circuit)` will test a lot of these\n",
"conditions. Calling the `validate_circuit` function will work with any\n",
"device, including those retrieved directly from the API using the\n",
"[engine object](/cirq/google/specification.md#conversion-to-cirq.device), which can help\n",
"[engine object](./specification.md#conversion-to-cirq.device), which can help\n",
"identify any qubits used in the circuit that have been disabled on the actual\n",
"device."
]
Expand Down Expand Up @@ -398,7 +398,7 @@
"good moment structure that avoids problematic missteps that can cause\n",
"unwanted noise and error.\n",
"\n",
"Note: See the [Circuit optimization, gate alignment, and spin echoes tutorial](/cirq/tutorials/google/spin_echoes.ipynb) for an example of the best practices discussed in this section.\n",
"Note: See the [Circuit optimization, gate alignment, and spin echoes tutorial](../tutorials/google/spin_echoes.ipynb) for an example of the best practices discussed in this section.\n",
"\n",
"### Short gate depth\n",
"\n",
Expand Down Expand Up @@ -478,7 +478,7 @@
"calibration procedure. These metrics can be used as a baseline to evaluate\n",
"circuit performance or identify outliers to avoid. This data can be inspected\n",
"programmatically by retrieving metrics from the [API](calibration.md) or\n",
"[visually by applying a cirq.Heatmap](/cirq/tutorials/google/visualizing_calibration_metrics.ipynb)\n",
"[visually by applying a cirq.Heatmap](../tutorials/google/visualizing_calibration_metrics.ipynb)\n",
"to that data or by using the built-in\n",
"heatmaps in the Cloud console page for the processor. Note that, since this\n",
"data is only taken during calibration (e.g. at most daily), drifts and other\n",
Expand All @@ -488,11 +488,11 @@
"* Loschmidt echo: Running a small circuit on a string of qubits and then\n",
"applying the circuit's inverse can be used as a quick but effective way to\n",
"judge qubit quality. See\n",
"[this tutorial](/cirq/tutorials/google/echoes.ipynb) for instructions.\n",
"[this tutorial](../tutorials/google/echoes.ipynb) for instructions.\n",
"* XEB: Cross-entropy benchmarking is another way to gauge qubit performance\n",
"on a set of random circuits. See tutorials on\n",
"[parallel XEB](/cirq/noise/qcvv/parallel_xeb.ipynb)\n",
"or [isolated XEB](/cirq/noise/qcvv/isolated_xeb.ipynb) for instructions.\n",
"[parallel XEB](../noise/qcvv/parallel_xeb.ipynb)\n",
"or [isolated XEB](../noise/qcvv/isolated_xeb.ipynb) for instructions.\n",
"\n",
"\n",
"### Refitting gates\n",
Expand Down Expand Up @@ -525,9 +525,9 @@
"\n",
"For more on calibration and detailed instructions on how to perform these procedures, see the following tutorials:\n",
"\n",
"* [Calibration API](/cirq/noise/calibration_api.ipynb)\n",
"* [Floquet calibration example](/cirq/noise/floquet_calibration_example.ipynb)\n",
"* [XEB calibration example](/cirq/noise/qcvv/xeb_calibration_example.ipynb)"
"* [Calibration API](../noise/calibration_api.ipynb)\n",
"* [Floquet calibration example](../noise/floquet_calibration_example.ipynb)\n",
"* [XEB calibration example](../noise/qcvv/xeb_calibration_example.ipynb)"
]
}
],
Expand Down