Skip to content

Commit b632bb6

Browse files
authored
Links and titles (#5799)
Fix title sizing for XEB page Fix links in other pages Move Pauli observables to build, where it was intended to be in the first place. Move Representing Noise to noise.
1 parent 5a143e0 commit b632bb6

15 files changed

+63
-56
lines changed

dev_tools/notebooks/isolated_notebook_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
'docs/tutorials/google/visualizing_calibration_metrics.ipynb',
5555
'docs/noise/qcvv/xeb_calibration_example.ipynb',
5656
'docs/named_topologies.ipynb',
57-
'docs/representing_noise.ipynb',
5857
'docs/start/intro.ipynb',
5958
]
6059

docs/_book.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ upper_tabs:
6565
- heading: "Advanced"
6666
- title: "Operators"
6767
path: /cirq/build/operators
68+
- title: "Observables and PauliStrings"
69+
path: /cirq/build/pauli_observables
6870
- title: "Qudits"
6971
path: /cirq/build/qudits
7072
- title: "Protocols"
@@ -84,8 +86,6 @@ upper_tabs:
8486
path: /cirq/simulate/params
8587
- title: "State Histograms"
8688
path: /cirq/simulate/state_histograms
87-
- title: "Observables and PauliStrings"
88-
path: /cirq/simulate/pauli_observables
8989

9090
- heading: "Quantum Virtual Machine"
9191
- title: "Quantum Virtual Machine"
@@ -170,6 +170,8 @@ upper_tabs:
170170
contents:
171171
- title: "Overview"
172172
path: /cirq/noise
173+
- title: "Representing Noise"
174+
path: /cirq/noise/representing_noise
173175
#### CHARACTERIZATION AND COMPENSATION ####
174176
- heading: "Characterization and compensation"
175177
- title: "Calibration FAQ"

docs/build/_index.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ landing_page:
3535
- heading: Operators
3636
description: Unitary operators, measurements and noise channels.
3737
path: /cirq/build/operators
38+
- heading: Observables and PauliStrings
39+
description: Build and measure observables from sums and products of Pauli operators.
40+
path: /cirq/build/pauli_observables
3841
- heading: Qudits
3942
description: Qutrits and higher dimensional quantum systems.
4043
path: /cirq/build/qudits
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"\n",
8888
"[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",
8989
"\n",
90-
"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/bild/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. "
90+
"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. "
9191
]
9292
},
9393
{

docs/hardware/qubit_picking.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"source": [
133133
"### One qubit gate Pauli error data\n",
134134
"\n",
135-
"Pauli error defines decoherence of a single qubit in one of the Pauli [channels](/cirq/representing_noise) X, Y, or Z. If the errors are distributed in the uniform distribution over all three axes, the probability of applying an erroneous Pauli gate X, Y, or Z will be the Pauli error divided by three. See page 11 of [this Supplementary Information document](https://arxiv.org/abs/1910.11333){:.external} for more on Pauli error. \n",
135+
"Pauli error defines decoherence of a single qubit in one of the Pauli [channels](/cirq/noise/representing_noise) X, Y, or Z. If the errors are distributed in the uniform distribution over all three axes, the probability of applying an erroneous Pauli gate X, Y, or Z will be the Pauli error divided by three. See page 11 of [this Supplementary Information document](https://arxiv.org/abs/1910.11333){:.external} for more on Pauli error. \n",
136136
"\n",
137137
"Below is the single qubit Pauli error for the `cirq.PhasedXZGate` supported by the Rainbow processor, pulled from the `gate_pauli_errors` attribute of the noise properties object. You can inspect the error for the other supported one-qubit gates by replacing the `gate` variable below. However, as of July 19th, 2022, the error estimation process results in identical Pauli error for all one-qubit gates."
138138
]
@@ -222,7 +222,7 @@
222222
"source": [
223223
"### Two qubit gate FSim error\n",
224224
"\n",
225-
"FSim error represents [coherent](cirq/representing_noise#channels) two-qubit error that cannot be represented by Pauli channels (that is, it results from entanglement). Instead, it is represented as an additional `cirq.PhasedFSimGate` with small parameters that would be applied to a given qubit pair after any two-qubit gate's execution.\n",
225+
"FSim error represents [coherent](/cirq/noise/representing_noise#channels) two-qubit error that cannot be represented by Pauli channels (that is, it results from entanglement). Instead, it is represented as an additional `cirq.PhasedFSimGate` with small parameters that would be applied to a given qubit pair after any two-qubit gate's execution.\n",
226226
"\n",
227227
"The following example takes the norm of a couple of the parameters, as a rough approximate representation of the goodness of qubit pairs relative to one another. "
228228
]

docs/noise/_index.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ landing_page:
66
rows:
77
- heading: Manage noise when running circuits
88
description: Running circuits on quantum hardware devices means dealing with the noise those devices introduce to the computation. Cirq provides the following ways of managing that noise, to improve the quality of the measured results.
9+
options:
10+
- cards
11+
items:
12+
- heading: Representing Noise
13+
description: Noise models and channels and what types of error they replicate.
14+
path: /cirq/noise/representing_noise
915
- heading: Characterization and compensation
1016
description: Characterize the error a device is exhibiting, then compensate for that error by changing the circuit or reinterpreting the results.
1117
options:

docs/noise/qcvv/coherent_vs_incoherent_xeb.ipynb

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
"# limitations under the License."
3232
]
3333
},
34+
{
35+
"cell_type": "markdown",
36+
"metadata": {
37+
"id": "b5cbe21a91f4"
38+
},
39+
"source": [
40+
"# Coherent vs Incoherent Error with XEB"
41+
]
42+
},
3443
{
3544
"cell_type": "markdown",
3645
"metadata": {
@@ -39,16 +48,16 @@
3948
"source": [
4049
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
4150
" <td>\n",
42-
" <a target=\"_blank\" href=\"https://quantumai.google/cirq/qcvv/coherent_vs_incoherent_xeb>\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
51+
" <a target=\"_blank\" href=\"https://quantumai.google/cirq/noise/qcvv/coherent_vs_incoherent_xeb>\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
4352
" </td>\n",
4453
" <td>\n",
45-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/Cirq/blob/master/docs/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
54+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/Cirq/blob/master/docs/noise/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
4655
" </td>\n",
4756
" <td>\n",
48-
" <a target=\"_blank\" href=\"https://github.com/quantumlib/Cirq/blob/master/docs/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
57+
" <a target=\"_blank\" href=\"https://github.com/quantumlib/Cirq/blob/master/docs/noise/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
4958
" </td>\n",
5059
" <td>\n",
51-
" <a href=\"https://storage.googleapis.com/tensorflow_docs/Cirq/docs/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
60+
" <a href=\"https://storage.googleapis.com/tensorflow_docs/Cirq/docs/noise/qcvv/coherent_vs_incoherent_xeb.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
5261
" </td>\n",
5362
"</table>"
5463
]
@@ -61,11 +70,11 @@
6170
"source": [
6271
"This notebook demonstrates how to use Cross Entropy Benchmarking (XEB) end-to-end to compare coherent gate parameter error and incoherent depolarization error. It will mimic a small device graph of `cirq.GridQubit` pairs and simulate two-qubit XEB benchmarking circuits on them with noise models that introduce coherent and incoherent error before visualizing and comparing the results.\n",
6372
"\n",
64-
"For more information on types of error, see [Average, Pauli and Incoherent Error](../google/calibration.md#average-pauli-and-incoherent_error). \n",
73+
"For more information on types of error, see [Average, Pauli and Incoherent Error](/cirq/noise/calibration.md#average-pauli-and-incoherent_error). \n",
6574
"\n",
66-
"For more information on noise and noise models, see [Noise](../noise.ipynb).\n",
75+
"For more information on noise and noise models, see [Noise](/cirq/noise).\n",
6776
"\n",
68-
"For more information on how XEB works in detail, see [XEB Theory](./xeb_theory.ipynb) notebook."
77+
"For more information on how XEB works in detail, see [XEB Theory](/cirq/noise/qcvv/xeb_theory) notebook."
6978
]
7079
},
7180
{
@@ -74,7 +83,7 @@
7483
"id": "57flCRpJpup3"
7584
},
7685
"source": [
77-
"# Noisy Sampler Setup"
86+
"## Setup"
7887
]
7988
},
8089
{
@@ -135,7 +144,7 @@
135144
"source": [
136145
"## Prepare Noise Models\n",
137146
"\n",
138-
"To compare coherent and incoherent error, use two different noise models, which introduce coherent and incoherent error respectively. Also included are a noiseless model and a \"fused\" model that combines both coherent and incoherent error, for comparison. See [Noise](../noise.ipynb) for the difference between coherent and incoherent error. \n",
147+
"To compare coherent and incoherent error, use two different noise models, which introduce coherent and incoherent error respectively. Also included are a noiseless model and a \"fused\" model that combines both coherent and incoherent error, for comparison. See [Noise](/cirq/noise) for the difference between coherent and incoherent error. \n",
139148
"\n",
140149
"The coherent noise model is represented by a perturbed `SQRT_ISWAP` gate, which implements a slightly different unitary than a true `SQRT_ISWAP`. Perturbed gates are caused by hardware losing its calibrated tuning, which typically occurres naturally over time between device calibrations. \n",
141150
"\n",
@@ -355,8 +364,8 @@
355364
"id": "423f56a942f6"
356365
},
357366
"source": [
358-
"# Fidelity Data Collection\n",
359-
"## Sample Circuits\n",
367+
"## Fidelity Data Collection\n",
368+
"### Sample Circuits\n",
360369
"\n",
361370
"The following call will zip together the `circuit_library` circuits according to `combs_by_layer` into larger circuits that evaluate multiple qubit pairs in parallel, before sampling them. Remember that `samplers` contains coherent and incoherent noise samplers, an errorless sampler, and a fused sampler. Mapping `sample_2q_xeb_circuits` to the list of samplers produces sampled data, generated with identical parameters except for the difference in noise model. "
362371
]
@@ -442,9 +451,9 @@
442451
"id": "QDPtNQlPz3BL"
443452
},
444453
"source": [
445-
"# Visualizing Fidelity by Noise Model\n",
454+
"## Visualizing Fidelity by Noise Model\n",
446455
"\n",
447-
"## Qubit Pair Heatmaps\n",
456+
"### Qubit Pair Heatmaps\n",
448457
"The following cell visualizes the by-cycle fidelity error in qubit pair heatmaps."
449458
]
450459
},
@@ -495,7 +504,7 @@
495504
"id": "c47ti1_uKnLs"
496505
},
497506
"source": [
498-
"## Circuit Fidelity by Cycle\n",
507+
"### Circuit Fidelity by Cycle\n",
499508
"The qubit pair heatmaps are good, but summarize the fidelity data too much to reveal meaningful patterns. To rectify this, graph the circuit fidelity by cycle, alongside an exponential decay curve from the by-cycle fidelity estimation. For reference, an exponential decay associated with the original depolarization chance of `5e-3` is included. \n",
500509
"\n",
501510
"First some graphing utilities:\n"
@@ -656,7 +665,7 @@
656665
"id": "6025a292d19b"
657666
},
658667
"source": [
659-
"# Characterize Gate Parameters\n",
668+
"## Characterize Gate Parameters\n",
660669
"\n",
661670
"A classical optimizer can be used to approximate the two-qubit gate parameters that were actually used from the fidelity data. Here, the parameter of interest is the `phi` parameter, which is the one used to perturb `SQRT_ISWAP`. To characterize `phi`, flag it in the `SqrtISwapXEBOptions` object. Don't characterize the others parameters, for runtime reasons. This object, once passed into the optimizer wrapper `characterize_phased_fsim_parameters_with_xeb_by_pair`, denotes that the optimizer expects the two-qubit entangling gate used to be a `SQRT_ISWAP`, and that it will look for parameters to that gate (or the PhasedFSim version of it) which most closely replicate the observed fidelity data. \n",
662671
"\n",
@@ -780,7 +789,7 @@
780789
"id": "qvXyscaYfpUv"
781790
},
782791
"source": [
783-
"# Visualizing Refitted Fidelities by Noise Model\n",
792+
"## Visualizing Refitted Fidelities by Noise Model\n",
784793
"\n",
785794
"Finally, plot the original and refit circuit fidelities by cycle, with exponential decay curves, for each of the available datasets. "
786795
]
@@ -813,7 +822,7 @@
813822
"id": "E4xIRDi9gBnu"
814823
},
815824
"source": [
816-
"In the coherent error case, the optimization was able to refit the fidelities very well. The new curves of the refit data almost perfectly match the horizontal line at `1.0` fidelity. The success of this refit means that the estimated parameters for this case are very likely to represent the actual parameters of the gate operation used, which was seen in the fact that the optimization re-discovered the `phi` value that was originally used to perturb `SQRT_ISWAP`. In the real hardware case, identifying these parameters means identifying what unitary the gate control hardware actually implemented. If this unitary is far from the intended one, hardware re-calibration or [compensation](../tutorials/google/calibration_api.ipynb) must be performed in order to improve circuit fidelity. \n",
825+
"In the coherent error case, the optimization was able to refit the fidelities very well. The new curves of the refit data almost perfectly match the horizontal line at `1.0` fidelity. The success of this refit means that the estimated parameters for this case are very likely to represent the actual parameters of the gate operation used, which was seen in the fact that the optimization re-discovered the `phi` value that was originally used to perturb `SQRT_ISWAP`. In the real hardware case, identifying these parameters means identifying what unitary the gate control hardware actually implemented. If this unitary is far from the intended one, hardware re-calibration or [compensation](/cirq/noise/calibration_api) must be performed in order to improve circuit fidelity. \n",
817826
"\n",
818827
"In constrast, the optimizer was completely unable to refit the circuit fidelities in the incoherent error case. The refit fidelities find no meaningful fidelity improvement, instead following the same, expected `5e-3` exponential decay as the original fidelities. Unsurprisingly, the optimizer was unable to find any coherent error in the incoherent-only fidelity data. \n",
819828
"\n",
@@ -866,7 +875,7 @@
866875
"id": "E8BdVyNGLGnm"
867876
},
868877
"source": [
869-
"# Conclusion\n",
878+
"## Conclusion\n",
870879
"\n",
871880
"Cross Entropy Benchmarking and optimizer refitting has been shown here to effectively characterize patterns of coherent error, to find the (parameters of the) true unitary operation used on individual qubit pairs. Importantly, this is effective even in the case where incoherent error is also acting on the system, but with noticeably reduced accuracy. In a real hardware system, with many interacting sources of error, XEB can still be useful to identify consistent coherent error, but it's important to remember that other error can confound these results. "
872881
]
@@ -877,10 +886,10 @@
877886
"id": "wxvZ2plRMB-l"
878887
},
879888
"source": [
880-
"# What's Next?\n",
889+
"## What's Next?\n",
881890
"\n",
882891
"Now that you've identified coherent error, what can you do about it? \n",
883-
"- Depending on the parameter(s) identified to be out of tune, you may be able to change the circuits you want to run to compensate for that change. Read [Calibration API](../tutorials/google/calibration_api.ipynb) for further information.\n",
892+
"- Depending on the parameter(s) identified to be out of tune, you may be able to change the circuits you want to run to compensate for that change. Read [Calibration API](/cirq/noise/calibration_api) for further information.\n",
884893
"- In the real hardware case, the device may need to be re-calibrated in order to fix the tuning of particular gate operations on particular qubits. Reach out to your google contact to let us know!"
885894
]
886895
}
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939
"source": [
4040
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
4141
" <td>\n",
42-
" <a target=\"_blank\" href=\"https://quantumai.google/cirq/representing_noise\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
42+
" <a target=\"_blank\" href=\"https://quantumai.google/cirq/noise/representing_noise\"><img src=\"https://quantumai.google/site-assets/images/buttons/quantumai_logo_1x.png\" />View on QuantumAI</a>\n",
4343
" </td>\n",
4444
" <td>\n",
45-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/Cirq/blob/master/docs/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
45+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/quantumlib/Cirq/blob/master/docs/noise/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/colab_logo_1x.png\" />Run in Google Colab</a>\n",
4646
" </td>\n",
4747
" <td>\n",
48-
" <a target=\"_blank\" href=\"https://github.com/quantumlib/Cirq/blob/master/docs/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
48+
" <a target=\"_blank\" href=\"https://github.com/quantumlib/Cirq/blob/master/docs/noise/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/github_logo_1x.png\" />View source on GitHub</a>\n",
4949
" </td>\n",
5050
" <td>\n",
51-
" <a href=\"https://storage.googleapis.com/tensorflow_docs/Cirq/docs/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
51+
" <a href=\"https://storage.googleapis.com/tensorflow_docs/Cirq/docs/noise/representing_noise.ipynb\"><img src=\"https://quantumai.google/site-assets/images/buttons/download_icon_1x.png\" />Download notebook</a>\n",
5252
" </td>\n",
5353
"</table>"
5454
]
@@ -65,20 +65,11 @@
6565
" import cirq\n",
6666
"except ImportError:\n",
6767
" print(\"installing cirq...\")\n",
68-
" !pip install --quiet cirq --pre\n",
68+
" !pip install --quiet cirq\n",
6969
" print(\"installed cirq.\")\n",
7070
" import cirq"
7171
]
7272
},
73-
{
74-
"cell_type": "markdown",
75-
"metadata": {
76-
"id": "ea381f53cf89"
77-
},
78-
"source": [
79-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
80-
]
81-
},
8273
{
8374
"cell_type": "markdown",
8475
"metadata": {

0 commit comments

Comments
 (0)