From fc62b3d55d370082c04c3be0a23191f48e672126 Mon Sep 17 00:00:00 2001 From: augustehirth Date: Tue, 21 Jun 2022 14:38:39 -0700 Subject: [PATCH] Restructure file relocation (#5442) 1. Move files into the directories which represent the tabs they are indexed with. 2. Fix the indices to point to the new locations 3. Fix links across all pages to point to the new locations 4. Fix some other links to make them absolute instead of relative. This should only be merged with the CL that has redirects for everything moved: cl/452987763. --- .github/CODEOWNERS | 17 +- dev_tools/codeowners_test.py | 14 +- dev_tools/notebooks/isolated_notebook_test.py | 8 +- dev_tools/notebooks/notebook_test.py | 5 +- docs/_book.yaml | 104 +++++------ docs/build/_index.yaml | 18 +- docs/{ => build}/circuits.ipynb | 12 +- docs/{ => build}/classical_control.ipynb | 14 +- docs/{ => build}/custom_gates.ipynb | 10 +- docs/{ => build}/ecosystem.md | 11 +- docs/{ => build}/gates.ipynb | 10 +- docs/{ => build}/interop.ipynb | 8 +- docs/{ => build}/operators.ipynb | 14 +- docs/{ => build}/protocols.ipynb | 8 +- docs/{ => build}/qubits.ipynb | 8 +- docs/{ => build}/qudits.ipynb | 8 +- docs/dev/modules.md | 60 +++--- docs/dev/notebooks.md | 2 +- docs/dev/serialization.md | 38 ++-- docs/{ => dev}/support.md | 0 docs/experiments/_index.yaml | 12 +- .../fourier_checking.ipynb | 8 +- .../fourier_checking.tst | 0 .../hidden_linear_function.ipynb | 8 +- .../hidden_linear_function.tst | 0 .../quantum_walks.ipynb | 12 +- .../quantum_walks.tst | 0 docs/{tutorials => experiments}/shor.ipynb | 8 +- .../textbook_algorithms.ipynb | 8 +- .../textbook_algorithms.tst | 0 .../variational_algorithm.ipynb | 10 +- .../variational_algorithm.tst | 0 docs/google/access.md | 4 +- docs/google/best_practices.ipynb | 18 +- docs/google/concepts.ipynb | 6 +- docs/google/devices.md | 6 +- docs/google/engine.md | 36 ++-- docs/hardware/_index.yaml | 36 ++-- docs/{ => hardware}/aqt/access.md | 2 +- .../aqt/getting_started.ipynb | 8 +- docs/{ => hardware}/azure-quantum/access.md | 6 +- .../azure-quantum-resource-id.png | Bin .../getting_started_honeywell.ipynb | 8 +- .../azure-quantum/getting_started_ionq.ipynb | 8 +- docs/{ => hardware}/devices.ipynb | 0 docs/{ => hardware}/ionq/access.md | 0 docs/{ => hardware}/ionq/calibrations.md | 0 docs/{ => hardware}/ionq/circuits.md | 0 .../ionq/getting_started.ipynb | 16 +- docs/{ => hardware}/ionq/jobs.md | 0 docs/{ => hardware}/ionq/service.md | 0 docs/{ => hardware}/pasqal/access.md | 4 +- docs/{ => hardware}/pasqal/devices.md | 0 .../pasqal/getting_started.ipynb | 18 +- docs/{ => hardware}/pasqal/sampler.md | 0 docs/{ => hardware}/rigetti/access.md | 2 +- .../rigetti/getting_started.ipynb | 8 +- docs/noise/_index.yaml | 8 +- .../google => noise}/calibration_api.ipynb | 18 +- .../google => noise}/calibration_api.tst | 0 docs/{google => noise}/calibration_faq.md | 174 +++++++++--------- .../floquet_calibration_example.ipynb | 10 +- docs/{tutorials => noise}/heatmaps.ipynb | 12 +- docs/{ => noise}/qcvv/isolated_xeb.ipynb | 8 +- docs/{ => noise}/qcvv/isolated_xeb.tst | 0 docs/{ => noise}/qcvv/parallel_xeb.ipynb | 8 +- docs/{ => noise}/qcvv/parallel_xeb.tst | 0 .../qcvv}/xeb_calibration_example.ipynb | 10 +- .../{ => noise}/qcvv/xeb_coherent_noise.ipynb | 10 +- docs/{ => noise}/qcvv/xeb_coherent_noise.tst | 0 docs/{ => noise}/qcvv/xeb_theory.ipynb | 8 +- docs/{ => noise}/qcvv/xeb_theory.tst | 0 docs/simulate/_index.yaml | 8 +- docs/{ => simulate}/noisy_simulation.ipynb | 12 +- docs/{ => simulate}/params.ipynb | 8 +- docs/{ => simulate}/simulation.ipynb | 12 +- .../state_histograms.ipynb | 10 +- docs/{tutorials => start}/basics.ipynb | 30 +-- docs/{ => start}/install.md | 0 .../educators => start}/intro.ipynb | 10 +- docs/{tutorials/educators => start}/intro.tst | 0 docs/{ => start}/start.ipynb | 18 +- docs/transform/_index.yaml | 2 +- docs/transform/custom_transformers.ipynb | 2 +- docs/{ => transform}/transformers.ipynb | 8 +- docs/tutorials/_index.yaml | 161 ---------------- docs/tutorials/google/colab.ipynb | 4 +- .../google/identifying_hardware_changes.ipynb | 26 +-- docs/tutorials/google/start.ipynb | 10 +- .../visualizing_calibration_metrics.ipynb | 4 +- 90 files changed, 523 insertions(+), 689 deletions(-) rename docs/{ => build}/circuits.ipynb (96%) rename docs/{ => build}/classical_control.ipynb (90%) rename docs/{ => build}/custom_gates.ipynb (96%) rename docs/{ => build}/ecosystem.md (85%) rename docs/{ => build}/gates.ipynb (95%) rename docs/{ => build}/interop.ipynb (95%) rename docs/{ => build}/operators.ipynb (95%) rename docs/{ => build}/protocols.ipynb (95%) rename docs/{ => build}/qubits.ipynb (88%) rename docs/{ => build}/qudits.ipynb (95%) rename docs/{ => dev}/support.md (100%) rename docs/{tutorials => experiments}/fourier_checking.ipynb (98%) rename docs/{tutorials => experiments}/fourier_checking.tst (100%) rename docs/{tutorials => experiments}/hidden_linear_function.ipynb (96%) rename docs/{tutorials => experiments}/hidden_linear_function.tst (100%) rename docs/{tutorials => experiments}/quantum_walks.ipynb (97%) rename docs/{tutorials => experiments}/quantum_walks.tst (100%) rename docs/{tutorials => experiments}/shor.ipynb (98%) rename docs/{tutorials/educators => experiments}/textbook_algorithms.ipynb (98%) rename docs/{tutorials/educators => experiments}/textbook_algorithms.tst (100%) rename docs/{tutorials => experiments}/variational_algorithm.ipynb (96%) rename docs/{tutorials => experiments}/variational_algorithm.tst (100%) rename docs/{ => hardware}/aqt/access.md (96%) rename docs/{tutorials => hardware}/aqt/getting_started.ipynb (91%) rename docs/{ => hardware}/azure-quantum/access.md (84%) rename docs/{tutorials => hardware}/azure-quantum/azure-quantum-resource-id.png (100%) rename docs/{tutorials => hardware}/azure-quantum/getting_started_honeywell.ipynb (92%) rename docs/{tutorials => hardware}/azure-quantum/getting_started_ionq.ipynb (93%) rename docs/{ => hardware}/devices.ipynb (100%) rename docs/{ => hardware}/ionq/access.md (100%) rename docs/{ => hardware}/ionq/calibrations.md (100%) rename docs/{ => hardware}/ionq/circuits.md (100%) rename docs/{tutorials => hardware}/ionq/getting_started.ipynb (88%) rename docs/{ => hardware}/ionq/jobs.md (100%) rename docs/{ => hardware}/ionq/service.md (100%) rename docs/{ => hardware}/pasqal/access.md (82%) rename docs/{ => hardware}/pasqal/devices.md (100%) rename docs/{tutorials => hardware}/pasqal/getting_started.ipynb (93%) rename docs/{ => hardware}/pasqal/sampler.md (100%) rename docs/{ => hardware}/rigetti/access.md (90%) rename docs/{tutorials => hardware}/rigetti/getting_started.ipynb (98%) rename docs/{tutorials/google => noise}/calibration_api.ipynb (93%) rename docs/{tutorials/google => noise}/calibration_api.tst (100%) rename docs/{google => noise}/calibration_faq.md (79%) rename docs/{tutorials/google => noise}/floquet_calibration_example.ipynb (97%) rename docs/{tutorials => noise}/heatmaps.ipynb (90%) rename docs/{ => noise}/qcvv/isolated_xeb.ipynb (93%) rename docs/{ => noise}/qcvv/isolated_xeb.tst (100%) rename docs/{ => noise}/qcvv/parallel_xeb.ipynb (95%) rename docs/{ => noise}/qcvv/parallel_xeb.tst (100%) rename docs/{tutorials/google => noise/qcvv}/xeb_calibration_example.ipynb (99%) rename docs/{ => noise}/qcvv/xeb_coherent_noise.ipynb (94%) rename docs/{ => noise}/qcvv/xeb_coherent_noise.tst (100%) rename docs/{ => noise}/qcvv/xeb_theory.ipynb (96%) rename docs/{ => noise}/qcvv/xeb_theory.tst (100%) rename docs/{ => simulate}/noisy_simulation.ipynb (97%) rename docs/{ => simulate}/params.ipynb (97%) rename docs/{ => simulate}/simulation.ipynb (96%) rename docs/{tutorials => simulate}/state_histograms.ipynb (90%) rename docs/{tutorials => start}/basics.ipynb (93%) rename docs/{ => start}/install.md (100%) rename docs/{tutorials/educators => start}/intro.ipynb (99%) rename docs/{tutorials/educators => start}/intro.tst (100%) rename docs/{ => start}/start.ipynb (77%) rename docs/{ => transform}/transformers.ipynb (96%) delete mode 100644 docs/tutorials/_index.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 50411cad96b..866d69af216 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -37,22 +37,17 @@ docs/**/*.* @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck docs/google/**/*.* @wcourtney @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck @verult docs/tutorials/google/**/*.* @wcourtney @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck @verult -docs/ionq/**/*.* @dabacon @ColemanCollins @nakardo @gmauricio @aasfaw @rmlarose @Cynocracy @quantumlib/cirq-maintainers @vtomole @cduck -docs/tutorials/ionq/**/*.* @dabacon @ColemanCollins @nakardo @gmauricio @aasfaw @rmlarose @Cynocracy @quantumlib/cirq-maintainers @vtomole @cduck +docs/hardware/ionq/**/*.* @dabacon @ColemanCollins @nakardo @gmauricio @aasfaw @rmlarose @Cynocracy @quantumlib/cirq-maintainers @vtomole @cduck -docs/aqt/**/*.* @ma5x @pschindler @alfrisch @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck -docs/tutorials/aqt/**/*.* @ma5x @pschindler @alfrisch @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck +docs/hardware/aqt/**/*.* @ma5x @pschindler @alfrisch @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck -docs/pasqal/**/*.* @HGSilveri @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck -docs/tutorials/pasqal/**/*.* @HGSilveri @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck +docs/hardware/pasqal/**/*.* @HGSilveri @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck -docs/rigetti/**/*.* @erichulburd @kalzoo @dbanty @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck -docs/tutorials/rigetti/**/*.* @erichulburd @kalzoo @dbanty @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck +docs/hardware/rigetti/**/*.* @erichulburd @kalzoo @dbanty @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck -docs/azure-quantum/**/*.* @guenp @anpaz @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck -docs/tutorials/azure-quantum/**/*.* @guenp @anpaz @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck +docs/hardware/azure-quantum/**/*.* @guenp @anpaz @aasfaw @quantumlib/cirq-maintainers @vtomole @cduck ############################################################# # qcvv docs maintainers: docs maintainers + mrwojtek + aasfaw ############################################################# -docs/qcvv/**/*.* @mrwojtek @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck +docs/noise/qcvv/**/*.* @mrwojtek @aasfaw @rmlarose @quantumlib/cirq-maintainers @vtomole @cduck diff --git a/dev_tools/codeowners_test.py b/dev_tools/codeowners_test.py index 5a6e3c336a4..b0e788371f5 100644 --- a/dev_tools/codeowners_test.py +++ b/dev_tools/codeowners_test.py @@ -53,22 +53,22 @@ ("docs/_book.yaml", DOCS_MAINTAINERS), # qcvv ("cirq-core/cirq/experiments/__init__.py", QCVV_MAINTAINERS), - ("docs/qcvv/isolated_xeb.ipynb", QCVV_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/noise/qcvv/isolated_xeb.ipynb", QCVV_MAINTAINERS.union(DOCS_MAINTAINERS)), # aqt ("cirq-aqt/cirq_aqt/__init__.py", AQT_MAINTAINERS), ("cirq-aqt/setup.py", AQT_MAINTAINERS), - ("docs/aqt/access.md", AQT_MAINTAINERS.union(DOCS_MAINTAINERS)), - ("docs/tutorials/aqt/getting_started.ipynb", AQT_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/aqt/access.md", AQT_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/aqt/getting_started.ipynb", AQT_MAINTAINERS.union(DOCS_MAINTAINERS)), # pasqal ("cirq-pasqal/cirq_pasqal/__init__.py", PASQAL_MAINTAINERS), ("cirq-pasqal/setup.py", PASQAL_MAINTAINERS), - ("docs/pasqal/access.md", PASQAL_MAINTAINERS.union(DOCS_MAINTAINERS)), - ("docs/tutorials/pasqal/getting_started.ipynb", PASQAL_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/pasqal/access.md", PASQAL_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/pasqal/getting_started.ipynb", PASQAL_MAINTAINERS.union(DOCS_MAINTAINERS)), # ionq ("cirq-ionq/cirq_ionq/__init__.py", IONQ_MAINTAINERS), ("cirq-ionq/setup.py", IONQ_MAINTAINERS), - ("docs/ionq/access.md", IONQ_MAINTAINERS.union(DOCS_MAINTAINERS)), - ("docs/tutorials/ionq/getting_started.ipynb", IONQ_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/ionq/access.md", IONQ_MAINTAINERS.union(DOCS_MAINTAINERS)), + ("docs/hardware/ionq/getting_started.ipynb", IONQ_MAINTAINERS.union(DOCS_MAINTAINERS)), # google ("cirq-google/cirq_google/__init__.py", GOOGLE_MAINTAINERS), ("cirq-google/setup.py", GOOGLE_MAINTAINERS), diff --git a/dev_tools/notebooks/isolated_notebook_test.py b/dev_tools/notebooks/isolated_notebook_test.py index 8305d01bb56..4aed4c39e04 100644 --- a/dev_tools/notebooks/isolated_notebook_test.py +++ b/dev_tools/notebooks/isolated_notebook_test.py @@ -44,17 +44,17 @@ # Hardcoded qubit placement 'docs/google/qubit-placement.ipynb', # get_qcs_objects_for_notebook - 'docs/tutorials/google/calibration_api.ipynb', + 'docs/noise/calibration_api.ipynb', 'docs/tutorials/google/colab.ipynb', 'docs/tutorials/google/identifying_hardware_changes.ipynb', 'docs/tutorials/google/echoes.ipynb', - 'docs/tutorials/google/floquet_calibration_example.ipynb', + 'docs/noise/floquet_calibration_example.ipynb', 'docs/tutorials/google/spin_echoes.ipynb', 'docs/tutorials/google/start.ipynb', 'docs/tutorials/google/visualizing_calibration_metrics.ipynb', - 'docs/tutorials/google/xeb_calibration_example.ipynb', + 'docs/noise/qcvv/xeb_calibration_example.ipynb', 'docs/named_topologies.ipynb', - 'docs/tutorials/educators/intro.ipynb', + 'docs/start/intro.ipynb', ] # By default all notebooks should be tested, however, this list contains exceptions to the rule diff --git a/dev_tools/notebooks/notebook_test.py b/dev_tools/notebooks/notebook_test.py index 63cbbadceb1..d2ca59bc7a9 100644 --- a/dev_tools/notebooks/notebook_test.py +++ b/dev_tools/notebooks/notebook_test.py @@ -37,7 +37,10 @@ # skipping fidelity estimation due to # https://github.com/quantumlib/Cirq/issues/3502 "examples/*fidelity*", - 'docs/noise.ipynb', + # tutorials that use QCS and arent skipped due to one or more cleared output cells + 'docs/noise/qcvv/xeb_calibration_example.ipynb', + 'docs/noise/calibration_api.ipynb', + 'docs/noise/floquet_calibration_example.ipynb', ] diff --git a/docs/_book.yaml b/docs/_book.yaml index ba08d0ccdca..5a9613622da 100644 --- a/docs/_book.yaml +++ b/docs/_book.yaml @@ -32,16 +32,16 @@ upper_tabs: #### FIRST STEPS #### - heading: "First steps" - title: "Install" - path: /cirq/install + path: /cirq/start/install - title: "Hello Qubit Example" - path: /cirq/start + path: /cirq/start/start - title: "Cirq Basics" - path: /cirq/tutorials/basics + path: /cirq/start/basics #### TEST UNDERSTANDING #### - heading: "Test understanding" - title: "Cirq Intro Workshop" - path: /cirq/tutorials/educators/intro + path: /cirq/start/intro - name: "Build" contents: @@ -50,45 +50,45 @@ upper_tabs: #### CIRCUIT CONSTRUCTION #### - heading: "Circuit construction" - title: "Circuits" - path: /cirq/circuits + path: /cirq/build/circuits - title: "Qubits" - path: /cirq/qubits + path: /cirq/build/qubits - title: "Gates and operations" - path: /cirq/gates + path: /cirq/build/gates - title: "Custom gates" - path: /cirq/custom_gates + path: /cirq/build/custom_gates - title: "Import/export circuits" - path: /cirq/interop + path: /cirq/build/interop #### ADVANCED #### - heading: "Advanced" - title: "Operators" - path: /cirq/operators + path: /cirq/build/operators - title: "Qudits" - path: /cirq/qudits + path: /cirq/build/qudits - title: "Protocols" - path: /cirq/protocols + path: /cirq/build/protocols - title: "Tools Ecosystem" - path: /cirq/ecosystem + path: /cirq/build/ecosystem - name: "Simulate" contents: - title: "Overview" path: /cirq/simulate - title: "Exact Simulation" - path: /cirq/simulation + path: /cirq/simulate/simulation - title: "Noisy Simulation" - path: /cirq/noisy_simulation + path: /cirq/simulate/noisy_simulation - title: "Parameter Sweeps" - path: /cirq/params + path: /cirq/simulate/params - title: "State Histograms" - path: /cirq/tutorials/state_histograms + path: /cirq/simulate/state_histograms - name: "Transform" contents: - title: "Overview" path: /cirq/transform - title: "Circuit Transformers" - path: /cirq/transformers + path: /cirq/transform/transformers - title: "Custom Transformers" path: /cirq/transform/custom_transformers @@ -97,56 +97,56 @@ upper_tabs: - title: "Overview" path: /cirq/hardware - title: "Devices" - path: /cirq/devices + path: /cirq/hardware/devices #### AQT #### - heading: "AQT hardware" - title: "Access and authentication" - path: /cirq/aqt/access + path: /cirq/hardware/aqt/access - title: "Getting started with AQT hardware" - path: /cirq/tutorials/aqt/getting_started + path: /cirq/hardware/aqt/getting_started #### Azure Quantum #### - heading: "Azure Quantum" - title: "Access and authentication" - path: /cirq/azure-quantum/access + path: /cirq/hardware/azure-quantum/access - title: "Getting started with Honeywell on Azure Quantum" - path: /cirq/tutorials/azure-quantum/getting_started_honeywell + path: /cirq/hardware/azure-quantum/getting_started_honeywell - title: "Getting started with IonQ on Azure Quantum" - path: /cirq/tutorials/azure-quantum/getting_started_ionq + path: /cirq/hardware/azure-quantum/getting_started_ionq ##### IonQ #### - heading: "IonQ hardware" - title: "Access and authentication" - path: /cirq/ionq/access + path: /cirq/hardware/ionq/access - title: "Getting started with IonQ hardware" - path: /cirq/tutorials/ionq/getting_started + path: /cirq/hardware/ionq/getting_started - title: "IonQ API service" - path: /cirq/ionq/service + path: /cirq/hardware/ionq/service - title: "IonQ API circuits" - path: /cirq/ionq/circuits + path: /cirq/hardware/ionq/circuits - title: "Running IonQ API jobs" - path: /cirq/ionq/jobs + path: /cirq/hardware/ionq/jobs - title: "IonQ API calibrations" - path: /cirq/ionq/calibrations + path: /cirq/hardware/ionq/calibrations #### PASQAL #### - heading: "Pasqal hardware" - title: "Access and authentication" - path: /cirq/pasqal/access + path: /cirq/hardware/pasqal/access - title: "Getting started with Pasqal hardware" - path: /cirq/tutorials/pasqal/getting_started + path: /cirq/hardware/pasqal/getting_started - title: "Pasqal devices" - path: /cirq/pasqal/devices + path: /cirq/hardware/pasqal/devices - title: "Pasqal sampler" - path: /cirq/pasqal/sampler + path: /cirq/hardware/pasqal/sampler ##### RIGETTI #### - heading: "Rigetti hardware" - title: "Access and authentication" - path: /cirq/rigetti/access + path: /cirq/hardware/rigetti/access - title: "Getting started with Rigetti hardware" - path: /cirq/tutorials/rigetti/getting_started + path: /cirq/hardware/rigetti/getting_started - name: "Noise" contents: @@ -154,27 +154,25 @@ upper_tabs: path: /cirq/noise #### CHARACTERIZATION AND COMPENSATION #### - heading: "Characterization and compensation" - - title: "Calibration: Overview and API" - path: /cirq/tutorials/google/calibration_api + - title: "Calibration FAQ" + path: /cirq/noise/calibration_faq - title: "Floquet Calibration" - path: /cirq/tutorials/google/floquet_calibration_example + path: /cirq/noise/floquet_calibration_example - title: "Cross Entropy Benchmarking (XEB)" style: accordion section: - title: "Cross Entropy Benchmarking Theory" - path: /cirq/qcvv/xeb_theory + path: /cirq/noise/qcvv/xeb_theory - title: "XEB and coherent error" - path: /cirq/qcvv/xeb_coherent_noise + path: /cirq/noise/qcvv/xeb_coherent_noise - title: "Parallel XEB" - path: /cirq/qcvv/parallel_xeb + path: /cirq/noise/qcvv/parallel_xeb - title: "XEB calibration: Example and Benchmark" - path: /cirq/tutorials/google/xeb_calibration_example - - title: "Calibration FAQ" - path: /cirq/google/calibration_faq + path: /cirq/noise/qcvv/xeb_calibration_example #### VISUALIZING NOISE #### - heading: "Visualizing noise" - title: "Heatmaps" - path: /cirq/tutorials/heatmaps + path: /cirq/noise/heatmaps - name: "Experiments" contents: @@ -182,17 +180,17 @@ upper_tabs: path: /cirq/experiments - heading: "Algorithms in Cirq" - title: "Textbook Algorithms Workshop" - path: /cirq/tutorials/educators/textbook_algorithms + path: /cirq/experiments/textbook_algorithms - title: "Shor's Algorithm" - path: /cirq/tutorials/shor + path: /cirq/experiments/shor - title: "Variational Quantum Eigensolver" - path: /cirq/tutorials/variational_algorithm + path: /cirq/experiments/variational_algorithm - title: "Quantum Walks" - path: /cirq/tutorials/quantum_walks + path: /cirq/experiments/quantum_walks - title: "Fourier Checking" - path: /cirq/tutorials/fourier_checking + path: /cirq/experiments/fourier_checking - title: "Hidden Linear Function problem" - path: /cirq/tutorials/hidden_linear_function + path: /cirq/experiments/hidden_linear_function - heading: "Algorithms in ReCirq" - include: /cirq/experiments/_toc.yaml @@ -221,7 +219,7 @@ upper_tabs: - title: "Triage process" path: /cirq/dev/triage - title: "Issues / requests / questions" - path: /cirq/support + path: /cirq/dev/support - name: "Reference" skip_translation: true diff --git a/docs/build/_index.yaml b/docs/build/_index.yaml index 153476d97eb..d125b38e106 100644 --- a/docs/build/_index.yaml +++ b/docs/build/_index.yaml @@ -13,19 +13,19 @@ landing_page: items: - heading: Circuits description: Quantum circuits and how to create them. - path: /cirq/circuits + path: /cirq/build/circuits - heading: Qubits description: The quantum bit data structure. - path: /cirq/qubits + path: /cirq/build/qubits - heading: Gates and Operations description: Quantum gates to apply to qubits in a circuit. - path: /cirq/gates + path: /cirq/build/gates - heading: Custom gates description: Create your own gates with unitaries or decomposition. - path: /cirq/custom_gates + path: /cirq/build/custom_gates - heading: Import/export circuits description: Importing or exporting circuits into/out of Cirq. - path: /cirq/interop + path: /cirq/build/interop - heading: Advanced construction description: More elaborate ways to build quantum circuits. @@ -34,13 +34,13 @@ landing_page: items: - heading: Operators description: Unitary operators, measurements and noise channels. - path: /cirq/operators + path: /cirq/build/operators - heading: Qudits description: Qutrits and higher dimensional quantum systems. - path: /cirq/qudits + path: /cirq/build/qudits - heading: Protocols description: Magic methods supported by Cirq's classes. - path: /cirq/protocols + path: /cirq/build/protocols - heading: Tools ecosystem description: External tools for circuit construction. - path: /cirq/ecosystem + path: /cirq/build/ecosystem diff --git a/docs/circuits.ipynb b/docs/build/circuits.ipynb similarity index 96% rename from docs/circuits.ipynb rename to docs/build/circuits.ipynb index b87157d13a1..30b6802c6bb 100644 --- a/docs/circuits.ipynb +++ b/docs/build/circuits.ipynb @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -756,8 +756,8 @@ "- [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](simulation.ipynb) - run your circuit on the Cirq simulator to see what it does\n", - "- [Transform circuits](transformers.ipynb) - run transformer functions to change your circuit in different ways\n", + "- [Simulation](/cirq/simulate/simulation.ipynb) - run your circuit on the Cirq simulator to see what it does\n", + "- [Transform circuits](/cirq/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" diff --git a/docs/classical_control.ipynb b/docs/build/classical_control.ipynb similarity index 90% rename from docs/classical_control.ipynb rename to docs/build/classical_control.ipynb index aa6364a8a43..e18dbb1f6ae 100644 --- a/docs/classical_control.ipynb +++ b/docs/build/classical_control.ipynb @@ -39,16 +39,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -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/tutorials/educators/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](/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", "\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)." ] @@ -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/tutorials/educators/textbook_algorithms#quantum_teleportation) circuit:" + "Using just these conditions, we can construct the [quantum teleportation](/cirq/experiments/textbook_algorithms#quantum_teleportation) circuit:" ] }, { @@ -320,7 +320,7 @@ "source": [ "## Using with transformers\n", "\n", - "Cirq [transformers](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](/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:" ] }, { diff --git a/docs/custom_gates.ipynb b/docs/build/custom_gates.ipynb similarity index 96% rename from docs/custom_gates.ipynb rename to docs/build/custom_gates.ipynb index d71ceb30bc9..a13ce73e11a 100644 --- a/docs/custom_gates.ipynb +++ b/docs/build/custom_gates.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -552,7 +552,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](transformers.ipynb#compiling_to_nisq_targets_cirqcompilationtargetgateset).\n", + "Instead, use features available in the [transformer API](/cirq/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", diff --git a/docs/ecosystem.md b/docs/build/ecosystem.md similarity index 85% rename from docs/ecosystem.md rename to docs/build/ecosystem.md index fba9a12be3c..0e95be0d5ad 100644 --- a/docs/ecosystem.md +++ b/docs/build/ecosystem.md @@ -38,12 +38,11 @@ The following document provides an ecosystem overview of how the various tools c |Company|Type of Quantum Computer| |--- |--- | -|[Google QCS](https://quantumai.google/cirq/tutorials/google/start)|Superconducting qubits| -|[Alpine Quantum Technologies](https://quantumai.google/cirq/tutorials/aqt/getting_started)|Trapped ions| -|[IonQ](https://quantumai.google/cirq/tutorials/ionq/getting_started)|Trapped ions| -|[Microsoft Azure Quantum](https://quantumai.google/cirq/tutorials/azure-quantum/getting_started_ionq)|Trapped ions (Honeywell and IonQ)| -|[Pasqal](https://quantumai.google/cirq/tutorials/pasqal/getting_started)|Neutral atoms| -|[Rigetti](https://quantumai.google/cirq/tutorials/rigetti/getting_started)|Superconducting qubits| +|[Alpine Quantum Technologies](https://quantumai.google/cirq/hardware/aqt/getting_started)|Trapped ions| +|[IonQ](https://quantumai.google/cirq/hardware/ionq/getting_started)|Trapped ions| +|[Microsoft Azure Quantum](https://quantumai.google/cirq/hardware/azure-quantum/getting_started_ionq)|Trapped ions (Honeywell and IonQ)| +|[Pasqal](https://quantumai.google/cirq/hardware/pasqal/getting_started)|Neutral atoms| +|[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). diff --git a/docs/gates.ipynb b/docs/build/gates.ipynb similarity index 95% rename from docs/gates.ipynb rename to docs/build/gates.ipynb index 07113fa1a51..15cbee13f99 100644 --- a/docs/gates.ipynb +++ b/docs/build/gates.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -177,7 +177,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](noisy_simulation.ipynb) for more details.\n", + "simulation of noise. See [noise documentation](/cirq/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", diff --git a/docs/interop.ipynb b/docs/build/interop.ipynb similarity index 95% rename from docs/interop.ipynb rename to docs/build/interop.ipynb index 8c03a06669c..d1bbad9fa04 100644 --- a/docs/interop.ipynb +++ b/docs/build/interop.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/operators.ipynb b/docs/build/operators.ipynb similarity index 95% rename from docs/operators.ipynb rename to docs/build/operators.ipynb index 5f88d3b0b90..a3285410940 100644 --- a/docs/operators.ipynb +++ b/docs/build/operators.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -318,7 +318,7 @@ "id": "00e6acd6ca82" }, "source": [ - "The `key` can be used to identify results of measurements when [simulating circuits](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](/cirq/simulate/simulation.ipynb). A measurement gate acting on a qubit forms an operation." ] }, { @@ -529,7 +529,7 @@ "id": "aa5f8ad751d3" }, "source": [ - "Custom noisy channels can be defined as described in [this guide](noisy_simulation.ipynb)." + "Custom noisy channels can be defined as described in [this guide](/cirq/simulate/noisy_simulation.ipynb)." ] }, { @@ -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](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](/cirq/simulate/simulation.ipynb)." ] }, { diff --git a/docs/protocols.ipynb b/docs/build/protocols.ipynb similarity index 95% rename from docs/protocols.ipynb rename to docs/build/protocols.ipynb index ea1a10f7f44..fb641e53d1b 100644 --- a/docs/protocols.ipynb +++ b/docs/build/protocols.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/qubits.ipynb b/docs/build/qubits.ipynb similarity index 88% rename from docs/qubits.ipynb rename to docs/build/qubits.ipynb index 2e93404a2b8..63a0b96812e 100644 --- a/docs/qubits.ipynb +++ b/docs/build/qubits.ipynb @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/qudits.ipynb b/docs/build/qudits.ipynb similarity index 95% rename from docs/qudits.ipynb rename to docs/build/qudits.ipynb index 88f4e70fa0b..8a6b56ba76f 100644 --- a/docs/qudits.ipynb +++ b/docs/build/qudits.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/dev/modules.md b/docs/dev/modules.md index 0879688bb0c..23b75d6186b 100644 --- a/docs/dev/modules.md +++ b/docs/dev/modules.md @@ -1,7 +1,7 @@ -# Cirq modules +# Cirq modules Cirq has a modular architecture and is organized in a monorepo, all of the modules follow the same folder structure. -Each module is structured as follows. Let's take as example a module named `cirq-example`: +Each module is structured as follows. Let's take as example a module named `cirq-example`: ``` cirq-example @@ -19,37 +19,37 @@ cirq-example └── setup.py ``` -Note that typically there is only a single top level package, `cirq_example` - but there might be exceptions. +Note that typically there is only a single top level package, `cirq_example` - but there might be exceptions. -Additionally, there is a metapackage "cirq" that's a completely different beast and just depends on the modules. +Additionally, there is a metapackage "cirq" that's a completely different beast and just depends on the modules. This enables `pip install cirq` to have all the included modules to be installed for our users. -All modules should depend on `cirq-core`, which is the central, core library for Cirq. +All modules should depend on `cirq-core`, which is the central, core library for Cirq. -## Packaging +## Packaging Each package gets published to PyPi as a separate package. To build all the wheel files locally, use ```bash dev_tools/packaging/produce-package.sh ./dist `./dev_tools/packaging/generate-dev-version-id.sh` ``` - -Packages are versioned together, share the same version number, and are released together. + +Packages are versioned together, share the same version number, and are released together. ## Setting up a new module -To setup a new module follow these steps: +To setup a new module follow these steps: 1. Create the folder structure above, copy the files based on an existing module 1. LICENSE should be the same 2. README.rst will be the documentation that appears in PyPi 3. setup.py should specify an `install_requires` configuration that has `cirq-core=={module.version}` at the minimum -2. Setup JSON serialization for each top level python package +2. Setup JSON serialization for each top level python package ### Setting up JSON serialization -1. Add the `/json_resolver_cache.py` file +1. Add the `/json_resolver_cache.py` file ```python @functools.lru_cache() # coverage: ignore def _class_resolver_dictionary() -> Dict[str, ObjectFactory]: # coverage: ignore @@ -57,22 +57,22 @@ To setup a new module follow these steps: ``` 2. Register the resolver cache - at _the end_ of the `/__init__.py`: ```python - + # Registers cirq_example's public classes for JSON serialization. from cirq.protocols.json_serialization import _register_resolver from cirq_example.json_resolver_cache import _class_resolver_dictionary _register_resolver(_class_resolver_dictionary) - - ``` -3. Add the `/json_test_data` folder with the following content: - 1. `spec.py` contains the core test specification for JSON testing, that plugs into the central framework: + + ``` +3. Add the `/json_test_data` folder with the following content: + 1. `spec.py` contains the core test specification for JSON testing, that plugs into the central framework: ```python import pathlib import cirq_example from cirq_example.json_resolver_cache import _class_resolver_dictionary - + from cirq.testing.json import ModuleJsonTestSpec - + TestSpec = ModuleJsonTestSpec( name="cirq_example", packages=[cirq_example], @@ -84,22 +84,22 @@ To setup a new module follow these steps: ) ``` 2. `__init__.py` should import `TestSpec` from `spec.py` - 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. - With new modules, we use`None` as there is no deprecation setup. - -You can run `check/pytest-changed-files` and that should execute the json_serialization_test.py as well. + 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. + With new modules, we use`None` as there is no deprecation setup. + +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 -# Utilities +## List modules -## List modules +To iterate through modules, you can list them by invoking `dev_tools/modules.py`. -To iterate through modules, you can list them by invoking `dev_tools/modules.py`. - ```bash -python dev_tools/modules.py --list +python dev_tools/modules.py --list ``` -There are different modes of listing (e.g the folder, package-path, top level package), -you can refer to `python dev_tools/modules.py --list --help` for the most up to date features. +There are different modes of listing (e.g the folder, package-path, top level package), +you can refer to `python dev_tools/modules.py --list --help` for the most up to date features. diff --git a/docs/dev/notebooks.md b/docs/dev/notebooks.md index 9c2df2d820e..65dd6a528c9 100644 --- a/docs/dev/notebooks.md +++ b/docs/dev/notebooks.md @@ -21,7 +21,7 @@ We also expect a standard header to be included in all of our notebooks: Example header: -![notebook header](../images/notebook_header.png) +![notebook header](/cirq/images/notebook_header.png) You can use [our template notebook](https://storage.googleapis.com/tensorflow_docs/Cirq/docs/_template.ipynb) to get started - please remember to change the `$$$REPLACE_WITH_TITLE$$$`, `$$$REPLACE_WITH_SITE_URL$$$` and `$$$REPLACE_WITH_NOTEBOOK_PATH$$$` placeholders. diff --git a/docs/dev/serialization.md b/docs/dev/serialization.md index 4b8983e3b79..009ef77f548 100644 --- a/docs/dev/serialization.md +++ b/docs/dev/serialization.md @@ -79,13 +79,13 @@ 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](./modules.md) for setting up JSON serialization for a module). +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). 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 +`cirq-core/cirq/protocols/json_serialization_test.py`, which iterates over cirq's API looking for types with no associated json test data. -There are several steps needed to support an object's serialization and deserialization, +There are several steps needed to support an object's serialization and deserialization, and pass `cirq-core/cirq/protocols/json_serialization_test.py`: 1. The object should have a `_json_dict_` method that returns a dictionary @@ -93,10 +93,10 @@ containing keys for each of the value's attributes. If these keys do not match t the class' initializer arguments, a `_from_json_dict_` class method must also be defined. 2. In `class_resolver_dictionary` within the packages's `json_resolver_cache.py` file, -for each serializable class, the `cirq_type` of the class should be mapped to the imported class -within the package. The key may also be mapped to a helper method that -returns the class (important for backwards compatibility if e.g. a class is later replaced -by another one). After doing this, `cirq.to_json` and `cirq.read_json` should start +for each serializable class, the `cirq_type` of the class should be mapped to the imported class +within the package. The key may also be mapped to a helper method that +returns the class (important for backwards compatibility if e.g. a class is later replaced +by another one). After doing this, `cirq.to_json` and `cirq.read_json` should start working for your object. 3. Add test data files to the package's `json_test_data` directory. @@ -112,11 +112,11 @@ Ideally, the contents of the `.repr` file are exactly the output of the test value from `your_class_name.repr`. ## Deprecating a serializable value -When a serializable value is marked deprecated, but is not yet removed, the -`.json` and `.repr` files continue to exist but `json_serialization_test.py` -will start complaining that deprecated values cannot be used in tests. +When a serializable value is marked deprecated, but is not yet removed, the +`.json` and `.repr` files continue to exist but `json_serialization_test.py` +will start complaining that deprecated values cannot be used in tests. In order to fix this, one should add an entry corresponding to deprecated value to the `deprecated` dict in -`cirq-/cirq/protocols/json_test_data/spec.py`, of the form: +`cirq-/cirq/protocols/json_test_data/spec.py`, of the form: ```python deprecated={ 'DeprecatedClass': 'deprecation_deadline', @@ -137,7 +137,7 @@ There are several steps: 1. Find the object's test files in relevant package's `json_test_data` directory. Change the file name extensions from `.json` to `.json_inward` and `.repr` to `.repr_inward`. This indicates that only deserialization needs to be tested, not deserialization -and serialization. If `_inward` files already exist, merge into them (e.g. by +and serialization. If `_inward` files already exist, merge into them (e.g. by ensuring they encode lists and then appending into those lists). 2. Define a parsing method to stand in for the object. @@ -145,7 +145,7 @@ This parsing method must return an object with the same basic behavior as the object being removed, but does not have to return an exactly identical object. For example, an X could be replaced by a PhasedX with no phasing. Edit the entry in the in `cirq-/json_test_data/spec.py` or in the - relevant package's `class_resolver_dictionary` (`cirq-/cirq_module/json_resolver_cache.py`) to + relevant package's `class_resolver_dictionary` (`cirq-/cirq_module/json_resolver_cache.py`) to point at this method instead of the object being removed. (There will likely be debate about exactly how to do this, on a case by case basis.) @@ -153,9 +153,9 @@ basis.) ## Marking a public object as non-serializable -Some public objects will be exceptional and should not be serialized ever. These could be marked in the -given top level package's spec.py (`//json_test_data/spec.py`) by adding its -name to `should_not_serialize`. +Some public objects will be exceptional and should not be serialized ever. These could be marked in the +given top level package's spec.py (`//json_test_data/spec.py`) by adding its +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. \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/support.md b/docs/dev/support.md similarity index 100% rename from docs/support.md rename to docs/dev/support.md diff --git a/docs/experiments/_index.yaml b/docs/experiments/_index.yaml index b106a7722e1..89eaa875ec8 100644 --- a/docs/experiments/_index.yaml +++ b/docs/experiments/_index.yaml @@ -18,22 +18,22 @@ landing_page: items: - heading: Textbook Algorithms Workshop description: A workshop notebook with examples that covers algorithms commonly shown in quantum textbooks. - path: /cirq/tutorials/educators/textbook_algorithms + path: /cirq/experiments/textbook_algorithms - heading: Shor's Algorithm description: The famous integer factorization algorithm by Peter Shor. - path: /cirq/tutorials/shor + path: /cirq/experiments/shor - heading: Variational Quantum Eigensolver description: Compute the ground state of a Hamiltonian using the variational principle. - path: /cirq/tutorials/variational_algorithm + path: /cirq/experiments/variational_algorithm - heading: Quantum Walks description: The quantum analog of a random walk algorithm. - path: /cirq/tutorials/quantum_walks + path: /cirq/experiments/quantum_walks - heading: Fourier Checking description: Demonstrate the separation between quantum and classical computers. - path: /cirq/tutorials/fourier_checking + path: /cirq/experiments/fourier_checking - heading: Hidden Linear Function problem description: Show quantum separation with a constant depth solution. - path: /cirq/tutorials/hidden_linear_function + path: /cirq/experiments/hidden_linear_function - heading: ReCirq Experiments description: Research experiments that use additional library code that resides in the external ReCirq repository. diff --git a/docs/tutorials/fourier_checking.ipynb b/docs/experiments/fourier_checking.ipynb similarity index 98% rename from docs/tutorials/fourier_checking.ipynb rename to docs/experiments/fourier_checking.ipynb index 5b8887f9768..df7a713bc3f 100644 --- a/docs/tutorials/fourier_checking.ipynb +++ b/docs/experiments/fourier_checking.ipynb @@ -50,16 +50,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " \">View on QuantumAI\n", + " \">View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/fourier_checking.tst b/docs/experiments/fourier_checking.tst similarity index 100% rename from docs/tutorials/fourier_checking.tst rename to docs/experiments/fourier_checking.tst diff --git a/docs/tutorials/hidden_linear_function.ipynb b/docs/experiments/hidden_linear_function.ipynb similarity index 96% rename from docs/tutorials/hidden_linear_function.ipynb rename to docs/experiments/hidden_linear_function.ipynb index 3e36e09eebc..15697daf3bb 100644 --- a/docs/tutorials/hidden_linear_function.ipynb +++ b/docs/experiments/hidden_linear_function.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/hidden_linear_function.tst b/docs/experiments/hidden_linear_function.tst similarity index 100% rename from docs/tutorials/hidden_linear_function.tst rename to docs/experiments/hidden_linear_function.tst diff --git a/docs/tutorials/quantum_walks.ipynb b/docs/experiments/quantum_walks.ipynb similarity index 97% rename from docs/tutorials/quantum_walks.ipynb rename to docs/experiments/quantum_walks.ipynb index 5b20a974ebf..1591f5db71c 100644 --- a/docs/tutorials/quantum_walks.ipynb +++ b/docs/experiments/quantum_walks.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -323,7 +323,7 @@ "looks something like this:\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "Going back to our original idea of some position vector $\\lvert j\\rangle$, it is apparent that in order to \n", @@ -476,7 +476,7 @@ "\n", "2. Based on the state of the coin qubit after the flip, either perform the operation $|j\\rangle \\ \\rightarrow \\ |j \\ + \\ 1\\rangle$ or $|j\\rangle \\ \\rightarrow \\ |j \\ - \\ 1\\rangle$ on the register of qubits encoding the position vector of the walker on the graph. This will involve having two operations controlled by opposite states of the coin quibt, each representing a step forward or a step backward on the graph. Thus, our evolution operation will look something like this:\n", "\n", - "\n", + "\n", "\n", "\n", "If we construct our evolution operator in this fashion, the coin qubit is able to dictate whether the walker \n", diff --git a/docs/tutorials/quantum_walks.tst b/docs/experiments/quantum_walks.tst similarity index 100% rename from docs/tutorials/quantum_walks.tst rename to docs/experiments/quantum_walks.tst diff --git a/docs/tutorials/shor.ipynb b/docs/experiments/shor.ipynb similarity index 98% rename from docs/tutorials/shor.ipynb rename to docs/experiments/shor.ipynb index eb54abc15c1..abb928865bb 100644 --- a/docs/tutorials/shor.ipynb +++ b/docs/experiments/shor.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/educators/textbook_algorithms.ipynb b/docs/experiments/textbook_algorithms.ipynb similarity index 98% rename from docs/tutorials/educators/textbook_algorithms.ipynb rename to docs/experiments/textbook_algorithms.ipynb index 1f271172744..2287dcc5fad 100644 --- a/docs/tutorials/educators/textbook_algorithms.ipynb +++ b/docs/experiments/textbook_algorithms.ipynb @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/educators/textbook_algorithms.tst b/docs/experiments/textbook_algorithms.tst similarity index 100% rename from docs/tutorials/educators/textbook_algorithms.tst rename to docs/experiments/textbook_algorithms.tst diff --git a/docs/tutorials/variational_algorithm.ipynb b/docs/experiments/variational_algorithm.ipynb similarity index 96% rename from docs/tutorials/variational_algorithm.ipynb rename to docs/experiments/variational_algorithm.ipynb index 9f3e105f4f8..9757bb4d90c 100644 --- a/docs/tutorials/variational_algorithm.ipynb +++ b/docs/experiments/variational_algorithm.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -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](basics.ipynb) or the [Circuits](../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](/cirq/start/basics.ipynb) or the [Circuits](/cirq/build/circuits.ipynb) page." ] }, { diff --git a/docs/tutorials/variational_algorithm.tst b/docs/experiments/variational_algorithm.tst similarity index 100% rename from docs/tutorials/variational_algorithm.tst rename to docs/experiments/variational_algorithm.tst diff --git a/docs/google/access.md b/docs/google/access.md index 6afbf105bc3..afa6694ed83 100644 --- a/docs/google/access.md +++ b/docs/google/access.md @@ -37,7 +37,7 @@ You do not need billing information to use the service at this time. You will need to configure your project to be able to access the API. * Log in and agree to Terms of Service -* Follow this link to +* Follow this link to [enable the Quantum Engine API](https://console.cloud.google.com/apis/library/quantum.googleapis.com?returnUrl=quantum) in your Google Cloud Platform project. @@ -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](../tutorials/google/start.ipynb). +You can try out our [Getting Started Guide](/cirq/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 diff --git a/docs/google/best_practices.ipynb b/docs/google/best_practices.ipynb index 2c82fd644fe..7ccedac0e99 100644 --- a/docs/google/best_practices.ipynb +++ b/docs/google/best_practices.ipynb @@ -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](./specification.md#serializable-devices), which can help\n", + "[engine object](/cirq/google/specification.md#serializable-devices), which can help\n", "identify any qubits used in the circuit that have been disabled on the actual\n", "device." ] @@ -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](../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](/cirq/tutorials/google/spin_echoes.ipynb) for an example of the best practices discussed in this section.\n", "\n", "### Short gate depth\n", "\n", @@ -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](../tutorials/google/visualizing_calibration_metrics.ipynb)\n", + "[visually by applying a cirq.Heatmap](/cirq/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", @@ -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](../tutorials/google/echoes.ipynb) for instructions.\n", + "[this tutorial](/cirq/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](../qcvv/parallel_xeb.ipynb)\n", - "or [isolated XEB](../qcvv/isolated_xeb.ipynb) for instructions.\n", + "[parallel XEB](/cirq/noise/qcvv/parallel_xeb.ipynb)\n", + "or [isolated XEB](/cirq/noise/qcvv/isolated_xeb.ipynb) for instructions.\n", "\n", "\n", "### Refitting gates\n", @@ -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](../tutorials/google/calibration_api.ipynb)\n", - "* [Floquet calibration example](../tutorials/google/floquet_calibration_example.ipynb)\n", - "* [XEB calibration example](../tutorials/google/xeb_calibration_example.ipynb)" + "* [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)" ] } ], diff --git a/docs/google/concepts.ipynb b/docs/google/concepts.ipynb index 5829196369d..092d937f9e9 100644 --- a/docs/google/concepts.ipynb +++ b/docs/google/concepts.ipynb @@ -111,7 +111,7 @@ "source": [ "### Circuits\n", "\n", - "The language of quantum computing is the quantum circuit model. Cirq is our open source framework which allows one to write a quantum circuit model in Python. To learn more about Cirq itself, we recommend starting with the [Tutorial](../tutorials/basics.ipynb). Conceptually, Cirq can be thought of as a way to create a quantum circuit as an object in Python. For example, we create a single circuit made up of square root of NOT gates, controlled-Z gates, and a measurement:" + "The language of quantum computing is the quantum circuit model. Cirq is our open source framework which allows one to write a quantum circuit model in Python. To learn more about Cirq itself, we recommend starting with the [Tutorial](/cirq/start/basics.ipynb). Conceptually, Cirq can be thought of as a way to create a quantum circuit as an object in Python. For example, we create a single circuit made up of square root of NOT gates, controlled-Z gates, and a measurement:" ] }, { @@ -140,7 +140,7 @@ "source": [ "### Quantum Engine API\n", "\n", - "Quantum Engine is the name of the cloud API which one can call to run the circuits you create in Cirq on quantum computers. When access is enabled, users can call this API to run circuits on Google’s quantum hardware. Read more about how to do this using cirq's `Engine` class [here](./engine.ipynb).\n", + "Quantum Engine is the name of the cloud API which one can call to run the circuits you create in Cirq on quantum computers. When access is enabled, users can call this API to run circuits on Google’s quantum hardware. Read more about how to do this using cirq's `Engine` class [here](/cirq/google/engine.ipynb).\n", "\n", "![Quantum Engine Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_diagram.png?raw=1)" ] @@ -176,7 +176,7 @@ "\n", "![Quantum Cloud Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_cloud.png?raw=1)\n", "\n", - "See the [Getting Started](../tutorials/google/start.ipynb) guide for step-by-step instructions on how to create a project and enable the API." + "See the [Getting Started](/cirq/tutorials/google/start.ipynb) guide for step-by-step instructions on how to create a project and enable the API." ] }, { diff --git a/docs/google/devices.md b/docs/google/devices.md index d1a237424e8..52c758e0844 100644 --- a/docs/google/devices.md +++ b/docs/google/devices.md @@ -68,14 +68,14 @@ if a moment has gates of duration 12ns, 25ns, and 32ns, the entire moment will take 32ns. Qubits executing the shorter gtes will idle during the rest of the time. To minimize the duration of the circuit, it is best to align gates of the same duration together when possible. See the -[best practices](./best_practices.ipynb) for more details. +[best practices](/cirq/google/best_practices.ipynb) for more details. ## Gates supported The following lists the gates supported by Google devices. Please note that gate durations are subject to change as hardware is updated and modified, so please refer to the -[device specification](./specification.md) +[device specification](/cirq/google/specification.md) to get up-to-date information on supported gates and durations for specific processors. @@ -85,7 +85,7 @@ This can include both incoherent as well as coherent error. Note: Gate durations are subject to change based on device or configuration. To get gates durations for a specific device, see the -[Device specification](./specification.md#gate-durations) page. Also +[Device specification](/cirq/google/specification.md#gate-durations) page. Also note that some gates (such as Z gates or Fsim gates) have multiple variations that can have different durations. diff --git a/docs/google/engine.md b/docs/google/engine.md index 59540721965..f23d9ea711c 100644 --- a/docs/google/engine.md +++ b/docs/google/engine.md @@ -1,12 +1,12 @@ # Quantum Engine API -Google's Quantum Computing Service provides the Quantum Engine API to execute -circuits on Google's quantum processor or simulator backends and -to access or manage the jobs, programs, reservations and calibrations. As of Cirq is -the only supported client for this API, using the `cirq_google.Engine` class. -For other use cases (e.g. from a different language), contact -[cirq-maintainers@googlegroups.com](mailto:cirq-maintainers@googlegroups.com) -with a short proposal or submit an [RFC](../dev/rfc_process.md). +Google's Quantum Computing Service provides the Quantum Engine API to execute +circuits on Google's quantum processor or simulator backends and +to access or manage the jobs, programs, reservations and calibrations. As of Cirq is +the only supported client for this API, using the `cirq_google.Engine` class. +For other use cases (e.g. from a different language), contact +[cirq-maintainers@googlegroups.com](mailto:cirq-maintainers@googlegroups.com) +with a short proposal or submit an [RFC](/cirq/dev/rfc_process.md). Note: the Quantum Engine API is not yet open for public access. @@ -97,7 +97,7 @@ print(results.data) ## Device Specification Several public devices have been released and can be found in the `cirq_google` -package. These are documented further on the [Google Device](devices.md) page. +package. These are documented further on the [Google Device](devices.md) page. However, you can also retrieve the device using the `get_device_specification` of an `Engine` object. This is a [protocol buffer](https://developers.google.com/protocol-buffers) @@ -148,7 +148,7 @@ Results can be retrieved in two different forms: * `EngineJob.results()` will return a single `List` object, with all the sweeps of the first circuit in the batch -followed by all the sweeps in the second circuit, and so on. +followed by all the sweeps in the second circuit, and so on. * EngineJob.batched_results()` will return a `List` of `List`s. The first index will refer to the circuit run, and the second index will refer to the sweep result in that circuit. @@ -274,13 +274,13 @@ historical_results = historical_job.results() If you did not save the ids, you can still find them from your job using the [Cloud Console](https://console.cloud.google.com/quantum/jobs) or -by using our list methods. +by using our list methods. -### Listing jobs +### Listing jobs -To list the executions of your circuit, i.e. the jobs, you can use `cirq_google.Engine.list_jobs()`. -You can search in all the jobs within your project using filtering criteria on creation time, execution state and labels. +To list the executions of your circuit, i.e. the jobs, you can use `cirq_google.Engine.list_jobs()`. +You can search in all the jobs within your project using filtering criteria on creation time, execution state and labels. ```python from cirq_google.engine.client.quantum import enums @@ -293,13 +293,13 @@ jobs = engine.list_jobs(created_after=datetime.date(2020,9,20), execution_states=[enums.ExecutionStatus.State.SUCCESS]) for j in jobs: print(j.job_id, j.status(), j.create_time()) -``` +``` ### Listing programs To list the different instances of your circuits uploaded, i.e. the programs, you can use `cirq_google.Engine.list_programs()`. Similar to jobs, filtering makes it possible to list programs by creation time and labels. -With an existing `cirq_google.EngineProgram` object, you can list any jobs that were run using that program. +With an existing `cirq_google.EngineProgram` object, you can list any jobs that were run using that program. ```python from cirq_google.engine.client.quantum import enums @@ -307,8 +307,8 @@ from cirq_google.engine.client.quantum import enums # Initialize the engine object engine = cirq_google.Engine(project_id='YOUR_PROJECT_ID') -# List all the programs on the project since 2020/09/20 that have -# the "variational" label with any value and the "experiment" label +# List all the programs on the project since 2020/09/20 that have +# the "variational" label with any value and the "experiment" label # with value "vqe001": programs = engine.list_programs( created_after=datetime.date(2020,9,20), @@ -320,5 +320,5 @@ for p in programs: # for example here we list the jobs under the programs that failed for j in p.list_jobs(execution_states=[enums.ExecutionStatus.State.FAILURE]): print(j.job_id, j.status()) -``` +``` diff --git a/docs/hardware/_index.yaml b/docs/hardware/_index.yaml index 515dd7d9301..47182dfc1b9 100644 --- a/docs/hardware/_index.yaml +++ b/docs/hardware/_index.yaml @@ -11,7 +11,7 @@ landing_page: items: - heading: Devices description: Represent the constraints a device imposes on runnable circuits with the Device class. - path: /cirq/devices + path: /cirq/hardware/devices - heading: Run a circuit on a hardware device description: Cirq provides interfaces for running your circuits on quantum hardware provided by many different services. @@ -23,10 +23,10 @@ landing_page: items: - heading: Access and authentication description: How to gain access. - path: /cirq/aqt/access + path: /cirq/hardware/aqt/access - heading: Getting started with AQT hardware description: How to run your first circuit. - path: /cirq/tutorials/aqt/getting_started + path: /cirq/hardware/aqt/getting_started - heading: Azure Quantum description: Cirq's interface with Microsoft Azure Quantum services. @@ -35,13 +35,13 @@ landing_page: items: - heading: Access and authentication description: How to gain access. - path: /cirq/azure-quantum/access + path: /cirq/hardware/azure-quantum/access - heading: Getting started with Honeywell on AQT hardware description: How to run your first circuit on a Honeywell device. - path: /cirq/tutorials/azure-quantum/getting_started_honeywell + path: /cirq/hardware/azure-quantum/getting_started_honeywell - heading: Getting started with IonQ on AQT hardware description: How to run your first circuit on an IonQ device. - path: /cirq/tutorials/azure-quantum/getting_started_ionq + path: /cirq/hardware/azure-quantum/getting_started_ionq - heading: IonQ hardware description: Cirq's interface with IonQ hardware. @@ -50,22 +50,22 @@ landing_page: items: - heading: Access and authentication description: How to gain access. - path: /cirq/ionq/access + path: /cirq/hardware/ionq/access - heading: Getting started with IonQ hardware description: How to run your first circuit. - path: /cirq/tutorials/ionq/getting_started + path: /cirq/hardware/ionq/getting_started - heading: IonQ API Service description: Using the IonQ API. - path: /cirq/ionq/service + path: /cirq/hardware/ionq/service - heading: IonQ API circuits description: Writing circuits for the IonQ API. - path: /cirq/ionq/circuits + path: /cirq/hardware/ionq/circuits - heading: Running IonQ API jobs description: How to run jobs with the IonQ API. - path: /cirq/ionq/jobs + path: /cirq/hardware/ionq/jobs - heading: IonQ API calibrations description: How to get hardware device calibration data through the IonQ API. - path: /cirq/ionq/calibrations + path: /cirq/hardware/ionq/calibrations - heading: Pasqal hardware description: Cirq's interface with Pasqal hardware. @@ -74,16 +74,16 @@ landing_page: items: - heading: Access and authentication description: How to gain access. - path: /cirq/pasqal/access + path: /cirq/hardware/pasqal/access - heading: Getting started with Pasqal hardware description: How to run your first circuit. - path: /cirq/tutorials/pasqal/getting_started + path: /cirq/hardware/pasqal/getting_started - heading: Pasqal devices description: Device objects to specify Pasqal hardware. - path: /cirq/pasqal/devices + path: /cirq/hardware/pasqal/devices - heading: Pasqal sampler description: Sampler objects to run on Pasqal hardware. - path: /cirq/pasqal/sampler + path: /cirq/hardware/pasqal/sampler - heading: Rigetti hardware description: Cirq's interface with Rigetti hardware. @@ -92,7 +92,7 @@ landing_page: items: - heading: Access and authentication description: How to gain access. - path: /cirq/rigetti/access + path: /cirq/hardware/rigetti/access - heading: Getting started with Rigetti hardware description: How to run your first circuit. - path: /cirq/tutorials/rigetti/getting_started + path: /cirq/hardware/rigetti/getting_started diff --git a/docs/aqt/access.md b/docs/hardware/aqt/access.md similarity index 96% rename from docs/aqt/access.md rename to docs/hardware/aqt/access.md index 028e9caf7ca..bdbf24d8006 100644 --- a/docs/aqt/access.md +++ b/docs/hardware/aqt/access.md @@ -41,4 +41,4 @@ with the token on the At this point, you should now have access to the AQT service. You can now try out our -[Getting Started Guide](../tutorials/aqt/getting_started.ipynb). +[Getting Started Guide](/cirq/hardware/aqt/getting_started.ipynb). diff --git a/docs/tutorials/aqt/getting_started.ipynb b/docs/hardware/aqt/getting_started.ipynb similarity index 91% rename from docs/tutorials/aqt/getting_started.ipynb rename to docs/hardware/aqt/getting_started.ipynb index 805a68cf0dd..5d4d12dbeee 100644 --- a/docs/tutorials/aqt/getting_started.ipynb +++ b/docs/hardware/aqt/getting_started.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/azure-quantum/access.md b/docs/hardware/azure-quantum/access.md similarity index 84% rename from docs/azure-quantum/access.md rename to docs/hardware/azure-quantum/access.md index 1b38e7abc7f..a1f8ec27bd6 100644 --- a/docs/azure-quantum/access.md +++ b/docs/hardware/azure-quantum/access.md @@ -2,7 +2,7 @@ [Azure Quantum](https://docs.microsoft.com/azure/quantum/overview-azure-quantum) is Microsoft's cloud service for running quantum computing programs or solving optimization problems and is currently in [Public Preview](https://cloudblogs.microsoft.com/quantum/2021/02/01/azure-quantum-preview/). You can try Azure Quantum for free today and submit quantum programs to Azure Quantum's partners and technologies. To send quantum programs with Cirq to IonQ* or Honeywell via an Azure Quantum subscription, follow the simple steps below to set up access. -> *) Note that there are two packages that can be used to access IonQ devices with `cirq`: `azure-quantum` or `cirq-ionq`. If you would like to access IonQ via a new or existing Azure subscription, use `azure-quantum` by following the steps in this tutorial. If you already have a preexisting IonQ API key through other means, follow the steps outlined in [Cirq with the IonQ API](../ionq/access.md) to use `cirq-ionq` instead. +> *) Note that there are two packages that can be used to access IonQ devices with `cirq`: `azure-quantum` or `cirq-ionq`. If you would like to access IonQ via a new or existing Azure subscription, use `azure-quantum` by following the steps in this tutorial. If you already have a preexisting IonQ API key through other means, follow the steps outlined in [Cirq with the IonQ API](/cirq/hardware/ionq/access.md) to use `cirq-ionq` instead. ## 1. Create an Azure Subscription @@ -24,6 +24,6 @@ pip install azure-quantum[cirq] You're now all set up to get started submitting quantum circuits to Azure Quantum hardware providers with Cirq. To try it out, check out the tutorials below: -[Getting started with IonQ and Cirq on Azure Quantum](../tutorials/azure-quantum/getting_started_ionq.ipynb) +[Getting started with IonQ and Cirq on Azure Quantum](/cirq/hardware/azure-quantum/getting_started_ionq.ipynb) -[Getting started with Honeywell and Cirq on Azure Quantum](../tutorials/azure-quantum/getting_started_honeywell.ipynb) +[Getting started with Honeywell and Cirq on Azure Quantum](/cirq/hardware/azure-quantum/getting_started_honeywell.ipynb) diff --git a/docs/tutorials/azure-quantum/azure-quantum-resource-id.png b/docs/hardware/azure-quantum/azure-quantum-resource-id.png similarity index 100% rename from docs/tutorials/azure-quantum/azure-quantum-resource-id.png rename to docs/hardware/azure-quantum/azure-quantum-resource-id.png diff --git a/docs/tutorials/azure-quantum/getting_started_honeywell.ipynb b/docs/hardware/azure-quantum/getting_started_honeywell.ipynb similarity index 92% rename from docs/tutorials/azure-quantum/getting_started_honeywell.ipynb rename to docs/hardware/azure-quantum/getting_started_honeywell.ipynb index aacc6518477..c92b35bfb39 100644 --- a/docs/tutorials/azure-quantum/getting_started_honeywell.ipynb +++ b/docs/hardware/azure-quantum/getting_started_honeywell.ipynb @@ -9,16 +9,16 @@ "# Getting started with Honeywell and Cirq on Azure Quantum\n", "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/azure-quantum/getting_started_ionq.ipynb b/docs/hardware/azure-quantum/getting_started_ionq.ipynb similarity index 93% rename from docs/tutorials/azure-quantum/getting_started_ionq.ipynb rename to docs/hardware/azure-quantum/getting_started_ionq.ipynb index b1141861841..c7fd639ecca 100644 --- a/docs/tutorials/azure-quantum/getting_started_ionq.ipynb +++ b/docs/hardware/azure-quantum/getting_started_ionq.ipynb @@ -9,16 +9,16 @@ "# Getting started with IonQ and Cirq on Azure Quantum\n", "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/devices.ipynb b/docs/hardware/devices.ipynb similarity index 100% rename from docs/devices.ipynb rename to docs/hardware/devices.ipynb diff --git a/docs/ionq/access.md b/docs/hardware/ionq/access.md similarity index 100% rename from docs/ionq/access.md rename to docs/hardware/ionq/access.md diff --git a/docs/ionq/calibrations.md b/docs/hardware/ionq/calibrations.md similarity index 100% rename from docs/ionq/calibrations.md rename to docs/hardware/ionq/calibrations.md diff --git a/docs/ionq/circuits.md b/docs/hardware/ionq/circuits.md similarity index 100% rename from docs/ionq/circuits.md rename to docs/hardware/ionq/circuits.md diff --git a/docs/tutorials/ionq/getting_started.ipynb b/docs/hardware/ionq/getting_started.ipynb similarity index 88% rename from docs/tutorials/ionq/getting_started.ipynb rename to docs/hardware/ionq/getting_started.ipynb index a3a2d6fd225..bc6eb2f033a 100644 --- a/docs/tutorials/ionq/getting_started.ipynb +++ b/docs/hardware/ionq/getting_started.ipynb @@ -17,16 +17,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -127,7 +127,7 @@ "\n", "## Running a simple circuit\n", "\n", - "The IonQ API supports a limited set of gates natively. Circuit built with these gates do not need any modification and can be run directly against the API. For a list of the API supported gates see [circuit documentation](../../ionq/circuit.md). One supported gate is the square root of not gate, which we use here in conjunction with a controlled-not gate. The following cell will run the circuit below, blocking until the program has run and results have been returned:" + "The IonQ API supports a limited set of gates natively. Circuit built with these gates do not need any modification and can be run directly against the API. For a list of the API supported gates see [circuit documentation](/cirq/hardware/ionq/circuit.md). One supported gate is the square root of not gate, which we use here in conjunction with a controlled-not gate. The following cell will run the circuit below, blocking until the program has run and results have been returned:" ] }, { @@ -342,11 +342,11 @@ "\n", "Check out the documentation on fully using the Cirq IonQ integration\n", "\n", - "[Learn how to build circuits for the API](../../ionq/circuits.md)\n", + "[Learn how to build circuits for the API](/cirq/hardware/ionq/circuits.md)\n", "\n", - "[How to use the service API](../../ionq/jobs.md)\n", + "[How to use the service API](/cirq/hardware/ionq/jobs.md)\n", "\n", - "[Learn how to query the performace of a processor by accessing IonQ calibrations](../../ionq/calibrations.md)" + "[Learn how to query the performace of a processor by accessing IonQ calibrations](/cirq/hardware/ionq/calibrations.md)" ] } ], diff --git a/docs/ionq/jobs.md b/docs/hardware/ionq/jobs.md similarity index 100% rename from docs/ionq/jobs.md rename to docs/hardware/ionq/jobs.md diff --git a/docs/ionq/service.md b/docs/hardware/ionq/service.md similarity index 100% rename from docs/ionq/service.md rename to docs/hardware/ionq/service.md diff --git a/docs/pasqal/access.md b/docs/hardware/pasqal/access.md similarity index 82% rename from docs/pasqal/access.md rename to docs/hardware/pasqal/access.md index bdb669f9437..67b29431e31 100644 --- a/docs/pasqal/access.md +++ b/docs/hardware/pasqal/access.md @@ -13,7 +13,7 @@ this, visit [Pasqal Sampler](sampler.md). ## Next Steps Access to Pasqal's API is not required for using Cirq to create quantum circuits -specifically tailored for our devices. +specifically tailored for our devices. Regardless of whether you have access or not, you can start playing around with Pasqal's classes with the -tutorial [Quantum Circuits on Pasqal Devices](../tutorials/pasqal/getting_started.ipynb). +tutorial [Quantum Circuits on Pasqal Devices](/cirq/hardware/pasqal/getting_started.ipynb). diff --git a/docs/pasqal/devices.md b/docs/hardware/pasqal/devices.md similarity index 100% rename from docs/pasqal/devices.md rename to docs/hardware/pasqal/devices.md diff --git a/docs/tutorials/pasqal/getting_started.ipynb b/docs/hardware/pasqal/getting_started.ipynb similarity index 93% rename from docs/tutorials/pasqal/getting_started.ipynb rename to docs/hardware/pasqal/getting_started.ipynb index e0e9e675072..c23bbe18440 100644 --- a/docs/tutorials/pasqal/getting_started.ipynb +++ b/docs/hardware/pasqal/getting_started.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -85,7 +85,7 @@ "id": "785bc8599470" }, "source": [ - "\n", + "\n", "\n", "In this notebook, we show how to program a quantum circuit for Pasqal using cirq. The first step is to import cirq, and Pasqal custom classes. We use ``PasqalVirtualDevice`` to showcase how Cirq enforces Pasqal's devices' restrictions throughout the process." ] @@ -111,11 +111,11 @@ "\n", "The QPU of Pasqal is made of neutral atoms controlled by lasers. Individual atoms are trapped at well-defined positions in 1, 2 or even 3D, as shown on the following plot ( [Nature 561, 79 (2018)](https://www.nature.com/articles/s41586-018-0450-2)).\n", "\n", - "\n", + "\n", "\n", "We created a custom class in cirq, ThreeDQubit, that corresponds to a qubit placed in 3D space. Let us start by creating a register comprising $36=6\\times6$ qubits in 2D, regularly arranged on a square lattice. It corresponds to the following configuration (image taken from [Nature 561, 79 (2018)](https://www.nature.com/articles/s41586-018-0450-2))\n", "\n", - "" + "" ] }, { @@ -236,7 +236,7 @@ "source": [ "When the distance between the two qubits involved in the gate is greater than the control radius, as shown for example in the following plot, cirq will raise an error.\n", "\n", - "
" + "
" ] }, { @@ -270,7 +270,7 @@ "\n", "More precisely, we will implement Grover's algorithm to search for the state $|10\\rangle$, which corresponds to the circuit:\n", "\n", - "
\n", + "
\n", "\n", "Bear in mind that this is a naïve implementation that can be substantially optimized, particularly in the oracle and the usage of an ancilla, but that is beyond the scope of this tutorial.\n", "\n", diff --git a/docs/pasqal/sampler.md b/docs/hardware/pasqal/sampler.md similarity index 100% rename from docs/pasqal/sampler.md rename to docs/hardware/pasqal/sampler.md diff --git a/docs/rigetti/access.md b/docs/hardware/rigetti/access.md similarity index 90% rename from docs/rigetti/access.md rename to docs/hardware/rigetti/access.md index 7f7285a9c1a..ca317594121 100644 --- a/docs/rigetti/access.md +++ b/docs/hardware/rigetti/access.md @@ -8,4 +8,4 @@ The Rigetti QCS API provides access to and descriptions of Rigetti quantum proce Note that you do not need Rigetti QCS credentials to execute on the Quil QVM, but you _will_ need them for execution on live Rigetti quantum processors. -With your environment setup, you will be able use the `cirq-rigetti` package as described in our [Getting Started Guide](../tutorials/rigetti/getting_started.ipynb). \ No newline at end of file +With your environment setup, you will be able use the `cirq-rigetti` package as described in our [Getting Started Guide](/cirq/hardware/rigetti/getting_started.ipynb). \ No newline at end of file diff --git a/docs/tutorials/rigetti/getting_started.ipynb b/docs/hardware/rigetti/getting_started.ipynb similarity index 98% rename from docs/tutorials/rigetti/getting_started.ipynb rename to docs/hardware/rigetti/getting_started.ipynb index 83d3a7a9d31..217a2da6837 100644 --- a/docs/tutorials/rigetti/getting_started.ipynb +++ b/docs/hardware/rigetti/getting_started.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/noise/_index.yaml b/docs/noise/_index.yaml index c3311805fa7..4c4b7c88131 100644 --- a/docs/noise/_index.yaml +++ b/docs/noise/_index.yaml @@ -13,13 +13,13 @@ landing_page: items: - heading: Calibration FAQ description: Frequently asked questions about characterization and compensation. - path: /cirq/tutorials/google/calibration_faq + path: /cirq/noise/calibration_faq - heading: Floquet Calibration description: A characterization method using Floquet theory. - path: /cirq/tutorials/google/floquet_calibration_example + path: /cirq/noise/floquet_calibration_example - heading: Cross Entropy Benchmarking (XEB) description: A characterization benchmarking method using cross entropy. - path: /cirq/qcvv/xeb_theory + path: /cirq/noise/qcvv/xeb_theory - heading: Visualizing noise description: Graphing and plotting methods for visualizing noise. options: @@ -27,4 +27,4 @@ landing_page: items: - heading: Heatmaps description: Functions to plot noise characteristics across a 2D grid device. - path: /cirq/tutorials/heatmaps + path: /cirq/noise/heatmaps diff --git a/docs/tutorials/google/calibration_api.ipynb b/docs/noise/calibration_api.ipynb similarity index 93% rename from docs/tutorials/google/calibration_api.ipynb rename to docs/noise/calibration_api.ipynb index ab7c77d2b9c..72cfbc7a9dc 100644 --- a/docs/tutorials/google/calibration_api.ipynb +++ b/docs/noise/calibration_api.ipynb @@ -50,16 +50,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -213,7 +213,7 @@ "id": "c9ZjppgcbVQz" }, "source": [ - "Note: Above we picked any qubits, but in an actual experiment you want to pick a good set of qubits to run on. To do so, use the latest maintanence report as in [this XEB calibration example](./xeb_calibration_example.ipynb) or use a Loschmidt echo as in [this Loschmidt echo tutorial](./echoes.ipynb)." + "Note: Above we picked any qubits, but in an actual experiment you want to pick a good set of qubits to run on. To do so, use the latest maintanence report as in [this XEB calibration example](/cirq/noise/qcvv/xeb_calibration_example.ipynb) or use a Loschmidt echo as in [this Loschmidt echo tutorial](/cirq/tutorials/google/echoes.ipynb)." ] }, { @@ -340,7 +340,7 @@ "id": "io2YyhxaN6xt" }, "source": [ - "XEB calibration works by executing a library of random circuits both on a noiseless simulator and on a noisy processor, then comparing results. In principle it can characterize any two-qubit gate, but compensation is currently only for $\\zeta$, $\\chi$, and $\\gamma$. For more details about how XEB calibration works, see the [Parallel XEB tutorial](https://quantumai.google/cirq/qcvv/parallel_xeb).\n", + "XEB calibration works by executing a library of random circuits both on a noiseless simulator and on a noisy processor, then comparing results. In principle it can characterize any two-qubit gate, but compensation is currently only for $\\zeta$, $\\chi$, and $\\gamma$. For more details about how XEB calibration works, see the [Parallel XEB tutorial](/cirq/noise/qcvv/parallel_xeb).\n", "\n", "Like Floquet calibration, the first step to using XEB calibration is defining options. Unlike Floquet calibration, XEB calibration requires significant classical processing to characterize angles. In addition to the angles to characterize, we also need to define the `cycle_depths` of the random circuits. The number of processes `n_processes` is a parallelization option for the classical processing." ] @@ -541,10 +541,10 @@ "source": [ "Try running Floquet and/or XEB calibration on your circuit(s). See the following tutorials for detailed examples and benchmarks.\n", "\n", - "- [Floquet calibration: Example and benchmark](./floquet_calibration_example.ipynb)\n", - "- [XEB calibration: Example and benchmark](./xeb_calibration_example.ipynb)\n", + "- [Floquet calibration: Example and benchmark](/cirq/noise/floquet_calibration_example.ipynb)\n", + "- [XEB calibration: Example and benchmark](/cirq/noise/qcvv/xeb_calibration_example.ipynb)\n", "\n", - "See also the [Calibration FAQ](../../google/calibration_faq.md) for additional information on calibration." + "See also the [Calibration FAQ](/cirq/noise/calibration_faq.md) for additional information on calibration." ] } ], diff --git a/docs/tutorials/google/calibration_api.tst b/docs/noise/calibration_api.tst similarity index 100% rename from docs/tutorials/google/calibration_api.tst rename to docs/noise/calibration_api.tst diff --git a/docs/google/calibration_faq.md b/docs/noise/calibration_faq.md similarity index 79% rename from docs/google/calibration_faq.md rename to docs/noise/calibration_faq.md index 548d0237539..9b4667ba39d 100644 --- a/docs/google/calibration_faq.md +++ b/docs/noise/calibration_faq.md @@ -5,81 +5,81 @@ ## What is calibration? Calibration is a technique to reduce systematic errors in quantum circuits. This technique aims to adjust for gate errors -in moments that contain only two-qubit gates. Circuit specific calibrations optimizes gate error for specific circuits. +in moments that contain only two-qubit gates. Circuit specific calibrations optimizes gate error for specific circuits. When executing a circuit with multiple simultaneous two-qubit gates, the actual effect may be different than the intended effect due to various sorts of errors, such as drift or cross-talk. Though one may request a `cirq.SQRT_ISWAP` gate, the quantum state -may be affected by a unitary effect that is close to, but not exactly, a `cirq.SQRT_ISWAP`. Characterization attempts to identify -the actual effect of the gates using repeated expressions of the two-qubit layer. Once parameters are identified that more -closely resemble the actual effect, some errors can be compensated for by using Z gates to correct phases before and after +may be affected by a unitary effect that is close to, but not exactly, a `cirq.SQRT_ISWAP`. Characterization attempts to identify +the actual effect of the gates using repeated expressions of the two-qubit layer. Once parameters are identified that more +closely resemble the actual effect, some errors can be compensated for by using Z gates to correct phases before and after each gate. This will improve the accuracy of the overall moment without adding additional duration to the circuit (the newly added Z gates will be merged with the already existing Z gates after sending circuits to the QCS.) -The [two supported techniques](../tutorials/google/calibration_api.ipynb) are [Floquet calibration](../tutorials/google/floquet_calibration_example.ipynb) -and [XEB calibration](../tutorials/google/xeb_calibration_example.ipynb), both of which are advanced alpha features. +The [two supported techniques](/cirq/noise/calibration_api.ipynb) are [Floquet calibration](/cirq/noise/floquet_calibration_example.ipynb) +and [XEB calibration](/cirq/noise/qcvv/xeb_calibration_example.ipynb), both of which are advanced alpha features. ## What is the Floquet calibration protocol? Floquet calibration protocol allows for determining the parameters of entangling gates rapidly and precisely, which unlocks -the ability to compensate for systematic gate errors caused by drifts and fluctuations. Like XEB, it is robust to state +the ability to compensate for systematic gate errors caused by drifts and fluctuations. Like XEB, it is robust to state preparation and measurement errors. Floquet calibration is based on the idea that an entangling gate can be determined by the eigenvalues of the composite gates consisting of the entangling gate and different single-qubit gates, where each choice of single-qubit gates provides a snapshot of the entangling gate. There are two stages in Floquet calibration, characterization -and compensation. Currently, only the single-qubit Z phases before and after the two-qubit gate are compensated. The -compensation pulses are combined with the gate pulses; therefore, they do not increase the circuit implementation time. In +and compensation. Currently, only the single-qubit Z phases before and after the two-qubit gate are compensated. The +compensation pulses are combined with the gate pulses; therefore, they do not increase the circuit implementation time. In structured circuits, two-qubit gates in the same moment should be calibrated simultaneously to combat crosstalks if possible. Floquet calibration is really fast, which allows one to calibrate multiple moment structures within budgeted time. ## Which gates are supported by Floquet and XEB calibrations? Floquet calibrations specified by `cirq_google.FloquetPhasedFSimCalibrationOptions` supports characterization of four out of -five unitary parameters θ, ζ, γ and φ of the `cirq.FSim(theta=pi / 4, phi=0)` gate (inverse of the `cirq.SQRT_ISWAP` gate) +five unitary parameters θ, ζ, γ and φ of the `cirq.FSim(theta=pi / 4, phi=0)` gate (inverse of the `cirq.SQRT_ISWAP` gate) presently. The Cirq compiler can use Z gates to compensate for the ζ, χ, γ parameters. The compiler can also compile `cirq.SQRT_ISWAP` gate into its inverse so that it can be used in calibrated circuits and take advantage of the characterization. -The XEB calibration specified by `cirq_google.LocalXEBPhasedFSimCalibrationOptions` supports `cirq.SQRT_ISWAP` and its inverse. -It characterizes all five unitary parameters and also provides the fidelity estimates for each of the calibrated gates. However, +The XEB calibration specified by `cirq_google.LocalXEBPhasedFSimCalibrationOptions` supports `cirq.SQRT_ISWAP` and its inverse. +It characterizes all five unitary parameters and also provides the fidelity estimates for each of the calibrated gates. However, the compiler can only adjust for three of the five parameters by inserting Z gates. -This version of XEB is using the client-side Cirq characterization backed by -`cirq.experiments.xeb_fitting.characterize_phased_fsim_parameters_with_xeb_by_pair` and when used directly it can support -arbitrary gates, including composite ones. However, the compiler which adjusts for ζ, χ, γ angles available in cirq_google +This version of XEB is using the client-side Cirq characterization backed by +`cirq.experiments.xeb_fitting.characterize_phased_fsim_parameters_with_xeb_by_pair` and when used directly it can support +arbitrary gates, including composite ones. However, the compiler which adjusts for ζ, χ, γ angles available in cirq_google package supports only `cirq.SQRT_ISWAP` with its inverse and `cirq_google.SYC`. Floquet calibration does not yet support microwave gates, this functionality is planned. ## How do I calibrate a circuit using Floquet or XEB calibrations? -Refer to the [Calibration API](../tutorials/google/calibration_api.ipynb) tutorial for an overview, and see the -[Floquet calibration example](../tutorials/google/floquet_calibration_example.ipynb) and [XEB calibration example](../tutorials/google/xeb_calibration_example.ipynb) +Refer to the [Calibration API](/cirq/noise/calibration_api.ipynb) tutorial for an overview, and see the +[Floquet calibration example](/cirq/noise/floquet_calibration_example.ipynb) and [XEB calibration example](/cirq/noise/qcvv/xeb_calibration_example.ipynb) for detailed steps on example circuits with benchmarks. -This is in principle a three-step process which consists of the following three steps: +This is in principle a three-step process which consists of the following three steps: 1. Analyzing the circuit: To analyze the circuit, use `cirq_google.prepare_characterization_for_moments` with - `cirq_google.FloquetPhasedFSimCalibrationOptions` (for Floquet) or `cirq_google.LocalXEBPhasedFSimCalibrationOptions` - (for XEB). This function will analyze the circuit and figure out which moments will need to be characterized. It will + `cirq_google.FloquetPhasedFSimCalibrationOptions` (for Floquet) or `cirq_google.LocalXEBPhasedFSimCalibrationOptions` + (for XEB). This function will analyze the circuit and figure out which moments will need to be characterized. It will identify moments with the same two-qubit structure so that they can be characterized together. -2. Characterizing the layer: The previous step will generate a list of characterization requests (one for each unique layer). - The next step is to call `cirq_google.run_calibrations`. This will invoke the API and send the requests to the device +2. Characterizing the layer: The previous step will generate a list of characterization requests (one for each unique layer). + The next step is to call `cirq_google.run_calibrations`. This will invoke the API and send the requests to the device to be characterized. -3. Compile the circuit: The final step is to use the results of the characterization to re-compile the circuit to compensate +3. Compile the circuit: The final step is to use the results of the characterization to re-compile the circuit to compensate for ζ, χ and γ angles. This can be done with the help of `cirq_google.make_zeta_chi_gamma_compensation_for_moments` function. ## When should Floquet or XEB Calibrations be used? Both calibrations are primarily focused on decreasing the effects of two sources of errors: calibration drifts and cross-talk -errors. Those errors are not uniform across the chip and vary in magnitude between qubits and device calibrations. The +errors. Those errors are not uniform across the chip and vary in magnitude between qubits and device calibrations. The circuit-specific calibrations should be used in situations when achieving the best performance out of Google’s hardware is more important than using extra time on the device for the characterizations. -The ζ, χ and γ parameters of the `cirq.PhasedFSimGate` unitary are subject to drifts that range in frequency from seconds to hours. -They can be automatically compensated by adjusting the single-qubit Z rotations. This functionality is provided for the supported +The ζ, χ and γ parameters of the `cirq.PhasedFSimGate` unitary are subject to drifts that range in frequency from seconds to hours. +They can be automatically compensated by adjusting the single-qubit Z rotations. This functionality is provided for the supported circuits through the `cirq_google.make_zeta_chi_gamma_compensation_for_moments` or `cirq_google.make_zeta_chi_gamma_compensation_for_operations` functions. -The types of cross-talk that are captured by circuit specific calibrations influence the θ, ζ, χ and γ unitary angles the most. Similarly to drift errors; ζ, χ and γ can be compensated by adjusting the single-qubit Z rotations. +The types of cross-talk that are captured by circuit specific calibrations influence the θ, ζ, χ and γ unitary angles the most. Similarly to drift errors; ζ, χ and γ can be compensated by adjusting the single-qubit Z rotations. The parameter φ is usually stable in time and is loosely dependent on the user circuit. However, its value might vary between interacting pairs and undergo rapid changes occasionally. @@ -94,32 +94,32 @@ For reference, the PhaseFSimGate unitary is represented by: ## What is the difference between the user-triggered calibrations (Floquet or XEB) and the maintenance calibration? -The maintenance or device calibration is performed every few days by the device support team and is focused on low-level -maintenance like adjusting qubit frequencies or profiling the pulse shape of each gate. This maintenance is performed -holistically for the entire chip and is mostly focused on a good performance of the chip in general. This maintenance -benchmarks performance on isolated gates or fully-layered simultaneous gates that may or may not resemble the circuits +The maintenance or device calibration is performed every few days by the device support team and is focused on low-level +maintenance like adjusting qubit frequencies or profiling the pulse shape of each gate. This maintenance is performed +holistically for the entire chip and is mostly focused on a good performance of the chip in general. This maintenance +benchmarks performance on isolated gates or fully-layered simultaneous gates that may or may not resemble the circuits specific in your execution. -The user-triggered calibrations issued through the [Calibration API](../tutorials/google/calibration_api.ipynb) are designed for circuit-specific +The user-triggered calibrations issued through the [Calibration API](/cirq/noise/calibration_api.ipynb) are designed for circuit-specific execution to capture both drift and cross-talk errors. They can be triggered just before the user circuit execution, in order to -reduce the effect of drift. They can also be triggered on very specific qubits that match the user’s executed circuits in order to -reduce cross-talk errors. The user-triggered calibrations do not change the qubit frequency or pulse shapes at this moment; they +reduce the effect of drift. They can also be triggered on very specific qubits that match the user’s executed circuits in order to +reduce cross-talk errors. The user-triggered calibrations do not change the qubit frequency or pulse shapes at this moment; they focus only on compensating the gate unitary parameters. ## What is the difference between Floquet and XEB calibrations? -Floquet and XEB have the same purpose of characterizing gates but differ in their specific methods. +Floquet and XEB have the same purpose of characterizing gates but differ in their specific methods. XEB characterization is based on scrambling gates with random single-qubit rotations, which include the microwave X and Y gates. -Based on many different realizations, the unitary parameters which maximize the fidelity of each gate can be learned. Floquet +Based on many different realizations, the unitary parameters which maximize the fidelity of each gate can be learned. Floquet calibration is more targeted and assumes certain noise characteristics to learn each parameter. The current Floquet calibration uses only Z gates during the repetition phase of the experiment. Because of its nature, XEB is easily adapted to various gates and currently it supports all the angles of √iSWAP gate. Floquet characterization doesn’t cover all the angles: the angle χ is not supported currently. It also follows that XEB requires more -quantum samples and classical computational resources to estimate the unitary parameters; to reach a comparable precision of +quantum samples and classical computational resources to estimate the unitary parameters; to reach a comparable precision of estimation, XEB is about an order of magnitude slower compared to the Floquet calibration. Therefore if you either have limited -time on the processor (e.g. Open-swim time) or the observed fluctuations is longer than the timescale of the calibration, one +time on the processor (e.g. Open-swim time) or the observed fluctuations is longer than the timescale of the calibration, one may want to use Floquet calibration. The other significant difference is concerned with microwave gates. [Physical Z Gate](https://quantumai.google/cirq/google/devices#one_qubit_gates) @@ -129,7 +129,7 @@ Note that, once the gates have been characterized, both methods share the same c ## I have many circuits to calibrate, how do I speed it up? -If the circuits have a similar structure (compatible moments), then they can probably share the same characterization. To +If the circuits have a similar structure (compatible moments), then they can probably share the same characterization. To prepare such a characterization request, it needs to be passed as initial argument to the `cirq_google.prepare_characterization_for_moments` method: @@ -156,51 +156,51 @@ Please note that the software is smart enough to select the minimum number of ch To control the granularity further, the `cirq_google.prepare_characterization_for_moments` function has a `merge_subsets` option. This option is by default set to true which indicates that whenever two moments appear, and one of the moments is -a subset of another moment then they will be merged together and characterized as a moment which is the larger of the two. -This choice leads to a smaller number of necessary layers, but some of the issues related to crosstalk are not captured. -For the highest accuracy, it might be desired to characterize each unique moment separately with the merge_subsets option +a subset of another moment then they will be merged together and characterized as a moment which is the larger of the two. +This choice leads to a smaller number of necessary layers, but some of the issues related to crosstalk are not captured. +For the highest accuracy, it might be desired to characterize each unique moment separately with the merge_subsets option set to false. -![Illustration of `merge_subsets` option.](./merge_subsets.png) +![Illustration of `merge_subsets` option.](/cirq/google/merge_subsets.png) Note that in this image the qubit lines run from top to bottom instead of left to right (the usual in Cirq). ## What is the difference between moment-oriented and operations-oriented calibrations? -There are two kinds of calibrations available in `cirq_google.calibrations` module: +There are two kinds of calibrations available in `cirq_google.calibrations` module: * moment oriented with `cirq_google.prepare_characterization_for_moments` and `cirq_google.make_zeta_chi_gamma_compensation_for_moments` - functions, and + functions, and * operations oriented with `cirq_google.prepare_floquet_characterization_for_operations` and `cirq_google.make_zeta_chi_gamma_compensation_for_operations`. -The moment-oriented characterizations analyse the circuit moment by moment in order to account for cross-talks. When some -gate on a particular set of qubits appears in two different moments, it will be characterized twice in two layers with different +The moment-oriented characterizations analyse the circuit moment by moment in order to account for cross-talks. When some +gate on a particular set of qubits appears in two different moments, it will be characterized twice in two layers with different gates acting in parallel. On current devices the cross-talk effects are very strong on certain qubit configurations. -There is an option to ignore the moment restrictions with the operations based calibration. In this mode, the moment structure -is ignored and the circuit is analyzed on a per-operation basis, a single pair appears in at most one layer being characterized. -With the current planar architecture, this bounds a maximum number of different characterizations for an arbitrary number of circuits -by four. This option might be useful to quickly check for the state of a device or benchmark particular qubit configurations before +There is an option to ignore the moment restrictions with the operations based calibration. In this mode, the moment structure +is ignored and the circuit is analyzed on a per-operation basis, a single pair appears in at most one layer being characterized. +With the current planar architecture, this bounds a maximum number of different characterizations for an arbitrary number of circuits +by four. This option might be useful to quickly check for the state of a device or benchmark particular qubit configurations before doing the actual experiment. -For example, if you have a circuit on a line of 5 qubits, there are 4 unique two-qubit gates and 7 unique moments with different +For example, if you have a circuit on a line of 5 qubits, there are 4 unique two-qubit gates and 7 unique moments with different combinations of two-qubit gates. If you use `cirq_google.prepare_floquet_characterization_for_operations`, this will result in 2 characterizations (since 2 unique gates can be put into a single moment) . If you use `cirq_google.prepare_characterization_for_moments` with `merge_subsets=False` this will result in 7 characterizations. ## What if the compensation based on single-qubit phases is not enough? -The provided compilation `cirq_google.make_zeta_chi_gamma_compensation_for_moments` uses Z gates to compensate for errors. -For the `cirq.SQRT_ISWAP` gate this does not affect duration of a circuit because the added Z gates are merged with the -already-existing Z gate pulses after submitting circuits to server. This compilation method that uses just Z gates can only +The provided compilation `cirq_google.make_zeta_chi_gamma_compensation_for_moments` uses Z gates to compensate for errors. +For the `cirq.SQRT_ISWAP` gate this does not affect duration of a circuit because the added Z gates are merged with the +already-existing Z gate pulses after submitting circuits to server. This compilation method that uses just Z gates can only compensate for 3 angles: ζ, χ and γ. -Compensation for the remaining two parameters θ and φ can’t be realized in a simple way. Some experiments can be modified +Compensation for the remaining two parameters θ and φ can’t be realized in a simple way. Some experiments can be modified to adjust to these errors by modifying circuit construction, compilation, or problem statement, but this must be handled by the user and cannot be done automatically. -For these advanced use cases, the `cirq_google.run_calibrations` method can be called directly with a list of -`cirq_google.PhasedFSimCalibrationRequest` objects. This will allow you to call the Calibration API directly to specify +For these advanced use cases, the `cirq_google.run_calibrations` method can be called directly with a list of +`cirq_google.PhasedFSimCalibrationRequest` objects. This will allow you to call the Calibration API directly to specify customized layers for characterizations. ```python @@ -220,69 +220,69 @@ See also ["How to compensate for the parasitic c-phase φ angle?"](##how_to_comp ## Floquet calibration fails with a message: Readout errors above the tolerance for qubit pairs (...), what can be done? -This is an automated check performed before the actual Floquet calibration on QCS used to detect if a particular gate did not +This is an automated check performed before the actual Floquet calibration on QCS used to detect if a particular gate did not drift too much outside of reasonable error levels. When the check fails, the following exception is reported: ```python PhasedFSimCalibrationError: Readout errors above the tolerance for qubit pairs ((8, 3), (8, 4)) ``` -Probably the most desired action would be to try to avoid this particular pair. For many qubits, this might be a temporary +Probably the most desired action would be to try to avoid this particular pair. For many qubits, this might be a temporary effect and repeating the experiment at a later time might help. -The automated check can also be relaxed by setting the `readout_error_tolerance` parameter to a value higher than `0.4` in +The automated check can also be relaxed by setting the `readout_error_tolerance` parameter to a value higher than `0.4` in `cirq_google.FloquetPhasedFSimCalibrationOptions`. (A value of `1.0` disables the readout checks entirely). -## How should I validate that Floquet or XEB calibration is working? +## How should I validate that Floquet or XEB calibration is working? -One mechanism for determining if your circuit performance is improving would be to run Floquet / XEB calibration on your -actual circuit and compare the results to your noiseless simulation. This however could be difficult and expensive as your +One mechanism for determining if your circuit performance is improving would be to run Floquet / XEB calibration on your +actual circuit and compare the results to your noiseless simulation. This however could be difficult and expensive as your circuit size increases. -Alternatively, one can run a Loschmidt echo with random circuits using Floquet calibration, and see that the overall return +Alternatively, one can run a Loschmidt echo with random circuits using Floquet calibration, and see that the overall return probability is higher than before. Even though the Loschmidt Echo random circuit may look very different from the actual circuit you are running, the gate compensations should result in a decent improvement in the return probabilities. -See [this tutorial for an example of using Loschmidt echo](../tutorials/google/echoes.ipynb). Here is an example of applying Floquet and XEB +See [this tutorial for an example of using Loschmidt echo](/cirq/tutorials/google/echoes.ipynb). Here is an example of applying Floquet and XEB corrections to a 16-site Loschmidt echo circuit (higher is better): -![Calibration benchmark with Loscmidt echoes](./loschmidt_echo_with_calibration_example_results.png) +![Calibration benchmark with Loscmidt echoes](/cirq/google/loschmidt_echo_with_calibration_example_results.png) Here is another example of applying calibrations to a linear chain circuit that contains only Z gates and `cirq.SQRT_ISWAP` gates (lower is better): -![Calibration benchmark with linear chain circuit](./linear_chain_with_calibration_example_results.png) +![Calibration benchmark with linear chain circuit](/cirq/google/linear_chain_with_calibration_example_results.png) ## How should I test Floquet / XEB Calibration on my circuit? -* First, you should have a circuit whose performance needs to be improved. Defining a metric of success is important to - clarify whether the procedure was successful. (E.g., for the case of the Fermi-Hubbard experiment, calculating the +* First, you should have a circuit whose performance needs to be improved. Defining a metric of success is important to + clarify whether the procedure was successful. (E.g., for the case of the Fermi-Hubbard experiment, calculating the spin-charge density of each site). - -* Make sure you get a reservation budget and then + +* Make sure you get a reservation budget and then [reserve a block of time using the cloud console](https://console.cloud.google.com/quantum/processors/) to test various - permutations of your circuit. Expect that each calibration would take about 1.6s per qubit and 28s per moment of additional + permutations of your circuit. Expect that each calibration would take about 1.6s per qubit and 28s per moment of additional time to your regular circuit runs. - + * Run the circuit against both a perfect simulator and a coherent noise simulator to get valid baselines for performance. -* Using [this tutorial for Floquet calibration](../tutorials/google/floquet_calibration_example.ipynb) as a guide, introduce Floquet characterization +* Using [this tutorial for Floquet calibration](/cirq/noise/floquet_calibration_example.ipynb) as a guide, introduce Floquet characterization and resulting compensating Z phase gates into your circuit, and compare the results with Floquet calibration turned on and turned off. In order to ensure an apt comparison, it is important to keep the following points in mind: -* Make sure you pick your qubits wisely. +* Make sure you pick your qubits wisely. - Use parallel readout heatmap to avoid any obviously broken qubits. - Use two-qubit error heatmaps to choose various patches of qubits with good two-qubit gate performance. - Use a mini-benchmark circuit to sanity check both qubit choice and basic circuit design. - - If in doubt, [use parallel XEB to check for issues like drift / TLS](../tutorials/google/identifying_hardware_changes.ipynb). + - If in doubt, [use parallel XEB to check for issues like drift / TLS](/cirq/tutorials/google/identifying_hardware_changes.ipynb). -* Start small with a low number of qubits (e.g. 2 qubits, with 5-10 layers of 2 qubit gates), and increase the number of qubits +* Start small with a low number of qubits (e.g. 2 qubits, with 5-10 layers of 2 qubit gates), and increase the number of qubits and gate depth. * Do not increase the gate depth past the T1 time of the qubits. * Use out of the box re-compilation first. If that doesn’t work, then try custom recompilation. -For a complete set of best practices, check the following [guide](./best_practices.ipynb). +For a complete set of best practices, check the following [guide](/cirq/google/best_practices.ipynb). ## How to compensate for the parasitic c-phase φ angle? @@ -291,26 +291,26 @@ happens during the gate execution, and all the two-qubit gates attain some unwan values for √iSWAP gate are about 0.13 which might be significant for certain applications, especially when circuits of large depth are executed that accumulate errors caused by this term. -Compensating for this parameter can be achieved in certain situations although in most cases the compensation adds more gates -which can cause the increase in the circuit runtime. Thus, the compensation itself might introduce even more noise during +Compensating for this parameter can be achieved in certain situations although in most cases the compensation adds more gates +which can cause the increase in the circuit runtime. Thus, the compensation itself might introduce even more noise during execution, so its feasibility should be chosen on a case-by-case basis. The following references might provide some help on dealing with this issue but none of them is a complete solution to the problem: -* The cirq-google package has a numerical [GateTabulation compiler](https://github.com/quantumlib/Cirq/blob/eb72fb547eec8377f24287aa5d03a2b66eaedff4/cirq-google/cirq_google/optimizers/two_qubit_gates/example.py) +* The cirq-google package has a numerical [GateTabulation compiler](https://github.com/quantumlib/Cirq/blob/eb72fb547eec8377f24287aa5d03a2b66eaedff4/cirq-google/cirq_google/optimizers/two_qubit_gates/example.py) that decomposes arbitrary gate into arbitrary two-qubit base gate. This code was not designed for the case where each base gate is different and might not be practical to use for actual applications. -* [arXiv:2106.15490](https://arxiv.org/abs/2106.15490) proposes a numerical optimization routine for approximate gate - compilation and discusses tradeoffs of using approximate gate compilation (higher decomposition error) to reduce circuit +* [arXiv:2106.15490](https://arxiv.org/abs/2106.15490) proposes a numerical optimization routine for approximate gate + compilation and discusses tradeoffs of using approximate gate compilation (higher decomposition error) to reduce circuit depth (lower hardware error) in an attempt to maximize overall circuit fidelity. -* [arXiv:2010.07965](https://arxiv.org/abs/2010.07965) in Supplementary Information A describes analytical decomposition +* [arXiv:2010.07965](https://arxiv.org/abs/2010.07965) in Supplementary Information A describes analytical decomposition of arbitrary FSimGate(0, 𝜙), under the assumption that |𝜙| is larger than twice the parasitic c-phase φ of the base gate. An implementation of this decomposition is included in ReCirq. -* There is also a helper method in Cirq `cirq.two_qubit_matrix_to_sqrt_iswap_operations` that is based on - [arXiv:2105.06074](https://arxiv.org/abs/2105.06074). However, it only allows to decompose into ideal `cirq.SQRT_ISWAP` +* There is also a helper method in Cirq `cirq.two_qubit_matrix_to_sqrt_iswap_operations` that is based on + [arXiv:2105.06074](https://arxiv.org/abs/2105.06074). However, it only allows to decompose into ideal `cirq.SQRT_ISWAP` gates and thus is not useful for dealing with parasitic c-phase. * This is an active topic of research, and we welcome more references. diff --git a/docs/tutorials/google/floquet_calibration_example.ipynb b/docs/noise/floquet_calibration_example.ipynb similarity index 97% rename from docs/tutorials/google/floquet_calibration_example.ipynb rename to docs/noise/floquet_calibration_example.ipynb index 44b4c241a55..6ec4aaa700d 100644 --- a/docs/tutorials/google/floquet_calibration_example.ipynb +++ b/docs/noise/floquet_calibration_example.ipynb @@ -50,16 +50,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -70,7 +70,7 @@ "id": "MFbogziRQKFQ" }, "source": [ - "This tutorial shows a detailed example and benchmark of Floquet calibration, a calibration technique introduced in the [Calibration: Overview and API](./calibration_api.ipynb) tutorial." + "This tutorial shows a detailed example and benchmark of Floquet calibration, a calibration technique introduced in the [Calibration: Overview and API](/cirq/noise/calibration_api.ipynb) tutorial." ] }, { diff --git a/docs/tutorials/heatmaps.ipynb b/docs/noise/heatmaps.ipynb similarity index 90% rename from docs/tutorials/heatmaps.ipynb rename to docs/noise/heatmaps.ipynb index b91097d41bc..89a53c865d5 100644 --- a/docs/tutorials/heatmaps.ipynb +++ b/docs/noise/heatmaps.ipynb @@ -39,16 +39,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -59,7 +59,7 @@ "id": "7d4b5cf32fd2" }, "source": [ - "Qubit heatmaps are primarily used for [visualizing calibration metrics](./google/visualizing_calibration_metrics.ipynb) but can be used for any custom data. This tutorial shows how you can create a `cirq.Heatmap` for single-qubit data and a `cirq.TwoQubitInteractionHeatmap` for two-qubit data." + "Qubit heatmaps are primarily used for [visualizing calibration metrics](/cirq/tutorials/google/visualizing_calibration_metrics.ipynb) but can be used for any custom data. This tutorial shows how you can create a `cirq.Heatmap` for single-qubit data and a `cirq.TwoQubitInteractionHeatmap` for two-qubit data." ] }, { @@ -175,7 +175,7 @@ "id": "87d966c05772" }, "source": [ - "These types of plots are used for [visualizing two-qubit calibration metrics](./google/visualizing_calibration_metrics.ipynb)." + "These types of plots are used for [visualizing two-qubit calibration metrics](/cirq/tutorials/google/visualizing_calibration_metrics.ipynb)." ] }, { diff --git a/docs/qcvv/isolated_xeb.ipynb b/docs/noise/qcvv/isolated_xeb.ipynb similarity index 93% rename from docs/qcvv/isolated_xeb.ipynb rename to docs/noise/qcvv/isolated_xeb.ipynb index b750b6f310e..665fd873ffc 100644 --- a/docs/qcvv/isolated_xeb.ipynb +++ b/docs/noise/qcvv/isolated_xeb.ipynb @@ -39,16 +39,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " \">View on QuantumAI\n", + " \">View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/qcvv/isolated_xeb.tst b/docs/noise/qcvv/isolated_xeb.tst similarity index 100% rename from docs/qcvv/isolated_xeb.tst rename to docs/noise/qcvv/isolated_xeb.tst diff --git a/docs/qcvv/parallel_xeb.ipynb b/docs/noise/qcvv/parallel_xeb.ipynb similarity index 95% rename from docs/qcvv/parallel_xeb.ipynb rename to docs/noise/qcvv/parallel_xeb.ipynb index 3708e4af0e9..d99634544f4 100644 --- a/docs/qcvv/parallel_xeb.ipynb +++ b/docs/noise/qcvv/parallel_xeb.ipynb @@ -39,16 +39,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " \">View on QuantumAI\n", + " \">View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/qcvv/parallel_xeb.tst b/docs/noise/qcvv/parallel_xeb.tst similarity index 100% rename from docs/qcvv/parallel_xeb.tst rename to docs/noise/qcvv/parallel_xeb.tst diff --git a/docs/tutorials/google/xeb_calibration_example.ipynb b/docs/noise/qcvv/xeb_calibration_example.ipynb similarity index 99% rename from docs/tutorials/google/xeb_calibration_example.ipynb rename to docs/noise/qcvv/xeb_calibration_example.ipynb index 4ee12eb238f..1bd899f5874 100644 --- a/docs/tutorials/google/xeb_calibration_example.ipynb +++ b/docs/noise/qcvv/xeb_calibration_example.ipynb @@ -50,16 +50,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -70,7 +70,7 @@ "id": "yKWtbKQB8Rej" }, "source": [ - "This tutorial shows a detailed example and benchmark of XEB calibration, a calibration technique introduced in the [Calibration: Overview and API](./calibration_api.ipynb) tutorial." + "This tutorial shows a detailed example and benchmark of XEB calibration, a calibration technique introduced in the [Calibration: Overview and API](/cirq/noise/calibration_api.ipynb) tutorial." ] }, { diff --git a/docs/qcvv/xeb_coherent_noise.ipynb b/docs/noise/qcvv/xeb_coherent_noise.ipynb similarity index 94% rename from docs/qcvv/xeb_coherent_noise.ipynb rename to docs/noise/qcvv/xeb_coherent_noise.ipynb index 0eb7bae8464..ded46ecf760 100644 --- a/docs/qcvv/xeb_coherent_noise.ipynb +++ b/docs/noise/qcvv/xeb_coherent_noise.ipynb @@ -39,16 +39,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " \">View on QuantumAI\n", + " \">View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -100,7 +100,7 @@ "source": [ "## Set up Random Circuits\n", "\n", - "We create a set of 10 random, two-qubit `circuits` which uses `SINGLE_QUBIT_GATES` to randomize the circuit and `SQRT_ISWAP` as the entangling gate. We will ultimately truncate each of these circuits according to `cycle_depths`. Please see [the XEB Theory notebook](./xeb_theory.ipynb) for more details." + "We create a set of 10 random, two-qubit `circuits` which uses `SINGLE_QUBIT_GATES` to randomize the circuit and `SQRT_ISWAP` as the entangling gate. We will ultimately truncate each of these circuits according to `cycle_depths`. Please see [the XEB Theory notebook](/cirq/noise/qcvv/xeb_theory.ipynb) for more details." ] }, { diff --git a/docs/qcvv/xeb_coherent_noise.tst b/docs/noise/qcvv/xeb_coherent_noise.tst similarity index 100% rename from docs/qcvv/xeb_coherent_noise.tst rename to docs/noise/qcvv/xeb_coherent_noise.tst diff --git a/docs/qcvv/xeb_theory.ipynb b/docs/noise/qcvv/xeb_theory.ipynb similarity index 96% rename from docs/qcvv/xeb_theory.ipynb rename to docs/noise/qcvv/xeb_theory.ipynb index f25894c043c..97b55d69e67 100644 --- a/docs/qcvv/xeb_theory.ipynb +++ b/docs/noise/qcvv/xeb_theory.ipynb @@ -31,16 +31,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/qcvv/xeb_theory.tst b/docs/noise/qcvv/xeb_theory.tst similarity index 100% rename from docs/qcvv/xeb_theory.tst rename to docs/noise/qcvv/xeb_theory.tst diff --git a/docs/simulate/_index.yaml b/docs/simulate/_index.yaml index e7389c9ee2a..27bd97b49af 100644 --- a/docs/simulate/_index.yaml +++ b/docs/simulate/_index.yaml @@ -11,13 +11,13 @@ landing_page: items: - heading: Exact Simulation description: Simulate a perfectly noiseless quantum computer. - path: /cirq/simulation + path: /cirq/simulate/simulation - heading: Noisy Simulation description: Simulate a more realistic quantum computer, subject to error and noise. - path: /cirq/noisy_simulation + path: /cirq/simulate/noisy_simulation - heading: Parameter Sweeps description: Efficiently evaluate many circuits which only differ in operation parameter values. - path: /cirq/params + path: /cirq/simulate/params - heading: State Histograms description: Visualize the results of simulation as a histogram over basis states. - path: /cirq/tutorials/state_histograms + path: /cirq/simulate/state_histograms diff --git a/docs/noisy_simulation.ipynb b/docs/simulate/noisy_simulation.ipynb similarity index 97% rename from docs/noisy_simulation.ipynb rename to docs/simulate/noisy_simulation.ipynb index 9a5c77aa301..45d804c7c56 100644 --- a/docs/noisy_simulation.ipynb +++ b/docs/simulate/noisy_simulation.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -145,7 +145,7 @@ "id": "f1f501177e53" }, "source": [ - "To see the Kraus operators of a channel, the `cirq.kraus` protocol can be used. (See the [protocols guide](./protocols.ipynb).)" + "To see the Kraus operators of a channel, the `cirq.kraus` protocol can be used. (See the [protocols guide](/cirq/build/protocols.ipynb).)" ] }, { @@ -456,7 +456,7 @@ "id": "360d5a316769" }, "source": [ - "Alternatively, users can define their own channel types. Defining custom channels is similar to defining [custom gates](./custom_gates.ipynb).\n", + "Alternatively, users can define their own channel types. Defining custom channels is similar to defining [custom gates](/cirq/build/custom_gates.ipynb).\n", "\n", "A minimal example for defining the channel\n", "\n", diff --git a/docs/params.ipynb b/docs/simulate/params.ipynb similarity index 97% rename from docs/params.ipynb rename to docs/simulate/params.ipynb index cb4c44732bc..d114ee5a279 100644 --- a/docs/params.ipynb +++ b/docs/simulate/params.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/simulation.ipynb b/docs/simulate/simulation.ipynb similarity index 96% rename from docs/simulation.ipynb rename to docs/simulate/simulation.ipynb index da46576dd34..94e313bfcab 100644 --- a/docs/simulation.ipynb +++ b/docs/simulate/simulation.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -496,7 +496,7 @@ "\n", "In addition to circuit gates with fixed values, Cirq also\n", "supports gates which can have `Symbol` values (see\n", - "[Gates](gates.ipynb)). These are values that can be resolved\n", + "[Gates](/cirq/build/gates.ipynb)). These are values that can be resolved\n", "at runtime. \n", "\n", "For simulators, these values are resolved by\n", @@ -570,7 +570,7 @@ "source": [ "The previous example demonstrates that assigning different values to gate parameters yields\n", "different results for each trial in the sweep, and that each trial is repeated\n", - "`repetitions` times. See [Parameter Sweeps](params.ipynb) for more information on sweeping and parameters." + "`repetitions` times. See [Parameter Sweeps](/cirq/simulate/params.ipynb) for more information on sweeping and parameters." ] }, { diff --git a/docs/tutorials/state_histograms.ipynb b/docs/simulate/state_histograms.ipynb similarity index 90% rename from docs/tutorials/state_histograms.ipynb rename to docs/simulate/state_histograms.ipynb index d5e53619829..e6df832406b 100644 --- a/docs/tutorials/state_histograms.ipynb +++ b/docs/simulate/state_histograms.ipynb @@ -29,7 +29,7 @@ }, "source": [ "# State Histograms\n", - "State Histograms are useful to visualize the output of running a quantum circuit. For details on how to create and run your own quantum circuits, please see [Cirq basics](./basics.ipynb)" + "State Histograms are useful to visualize the output of running a quantum circuit. For details on how to create and run your own quantum circuits, please see [Cirq basics](/cirq/start/basics.ipynb)" ] }, { @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/basics.ipynb b/docs/start/basics.ipynb similarity index 93% rename from docs/tutorials/basics.ipynb rename to docs/start/basics.ipynb index 98c0a6d59e8..6ed411d5f7d 100644 --- a/docs/tutorials/basics.ipynb +++ b/docs/start/basics.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -81,7 +81,7 @@ "id": "1dOjJlgrNUuz" }, "source": [ - "To begin, please follow the instructions for [installing Cirq](/cirq/install.md)." + "To begin, please follow the instructions for [installing Cirq](/cirq/start/install)." ] }, { @@ -156,7 +156,7 @@ "id": "4zE6AutyQhQ6" }, "source": [ - "There are also pre-packaged sets of qubits called [Devices](/cirq/devices). These are qubits along with a set of rules for how they can be used. A `cirq.Device` can be used to ensure that two-qubit gates are only applied to qubits that are adjacent in the hardware, and other constraints. The following example will use the `cirq_google.Sycamore` device that comes with cirq. It is a diamond-shaped grid with 54 qubits that mimics early hardware released by Google." + "There are also pre-packaged sets of qubits called [Devices](/cirq/hardware/devices). These are qubits along with a set of rules for how they can be used. A `cirq.Device` can be used to ensure that two-qubit gates are only applied to qubits that are adjacent in the hardware, and other constraints. The following example will use the `cirq_google.Sycamore` device that comes with cirq. It is a diamond-shaped grid with 54 qubits that mimics early hardware released by Google." ] }, { @@ -185,7 +185,7 @@ "\n", "For instance, `cirq.H` is the quantum [Hadamard](https://en.wikipedia.org/wiki/Quantum_logic_gate#Hadamard_(H)_gate) and is a `Gate` object. `cirq.H(cirq.LineQubit(1))` is an `Operation` object and is the Hadamard gate applied to a specific qubit (line qubit number 1).\n", "\n", - "Many textbook gates are included within cirq. `cirq.X`, `cirq.Y`, and `cirq.Z` refer to the single-qubit Pauli gates. `cirq.CZ`, `cirq.CNOT`, `cirq.SWAP` are a few of the common two-qubit gates. `cirq.measure` is a macro to apply a `MeasurementGate` to a set of qubits. You can find more, as well as instructions on how to create your own custom gates, on the [Gates documentation](/cirq/gates) page.\n", + "Many textbook gates are included within cirq. `cirq.X`, `cirq.Y`, and `cirq.Z` refer to the single-qubit Pauli gates. `cirq.CZ`, `cirq.CNOT`, `cirq.SWAP` are a few of the common two-qubit gates. `cirq.measure` is a macro to apply a `MeasurementGate` to a set of qubits. You can find more, as well as instructions on how to create your own custom gates, on the [Gates documentation](/cirq/build/gates) page.\n", "\n", "Here are some examples of operations that can be performed on gates and operations:" ] @@ -330,7 +330,7 @@ "id": "3FC9bdlXmShh" }, "source": [ - "Sometimes, you may not want cirq to automatically shift operations all the way to the left. To construct a circuit without doing this, you can create the circuit moment-by-moment or use a different `InsertStrategy`, explained more in the [Circuit documentation](../circuits.ipynb)." + "Sometimes, you may not want cirq to automatically shift operations all the way to the left. To construct a circuit without doing this, you can create the circuit moment-by-moment or use a different `InsertStrategy`, explained more in the [Circuit documentation](/cirq/build/circuits.ipynb)." ] }, { @@ -353,7 +353,7 @@ "source": [ "### Circuits and devices\n", "\n", - "One important consideration when using real quantum devices is that there are often constraints on circuits that are able to be run on the hardware. `Device` objects specify these constraints and can be used to validate your circuit to make sure that it contains no illegal operations. For more information on what constraints `Device` objects can specify and how to use them, see the [Devices](/cirq/devices) page.\n", + "One important consideration when using real quantum devices is that there are often constraints on circuits that are able to be run on the hardware. `Device` objects specify these constraints and can be used to validate your circuit to make sure that it contains no illegal operations. For more information on what constraints `Device` objects can specify and how to use them, see the [Devices](/cirq/hardware/devices) page.\n", "\n", "The following example demonstrates this with the Sycamore Device:" ] @@ -494,7 +494,7 @@ "id": "ef90dabdd52e" }, "source": [ - "A histogram over the states that were actually observed can often be more useful when analyzing results. To learn more about the available options for creating result histograms, see the [State Histograms](/cirq/tutorials/state_histograms) page. " + "A histogram over the states that were actually observed can often be more useful when analyzing results. To learn more about the available options for creating result histograms, see the [State Histograms](/cirq/simulate/state_histograms) page. " ] }, { @@ -559,7 +559,7 @@ "source": [ "## Unitary matrices and decompositions\n", "\n", - "Many quantum operations have unitary matrix representations. This matrix can be accessed by applying `cirq.unitary(operation)` to that `operation`. This can be applied to gates, operations, and circuits that support this protocol and will return the unitary matrix that represents the object. See [Protocols](/cirq/protocols) for more about this and other protocols." + "Many quantum operations have unitary matrix representations. This matrix can be accessed by applying `cirq.unitary(operation)` to that `operation`. This can be applied to gates, operations, and circuits that support this protocol and will return the unitary matrix that represents the object. See [Protocols](/cirq/build/protocols) for more about this and other protocols." ] }, { @@ -669,7 +669,7 @@ "id": "xRfQqzdx7lUI" }, "source": [ - "Other transformers can assist in transforming a circuit into operations that are native operations on specific hardware devices. You can find more about transformers and how to create your own in [Transformers](/cirq/transformers)." + "Other transformers can assist in transforming a circuit into operations that are native operations on specific hardware devices. You can find more about transformers and how to create your own in [Transformers](/cirq/transform/transformers)." ] }, { @@ -684,9 +684,9 @@ "\n", "There is much more to learn and try out for those who are interested:\n", "\n", - "* Learn about the variety of [Gates](../gates.ipynb) available in cirq and more about the different ways to construct [Circuits](../circuits.ipynb)\n", - "* Learn more about [Simulations](../simulate.ipynb) and how it works.\n", - "* Learn about [Noise](../noise.ipynb) and how to utilize multi-level systems using [Qudits](../qudits.ipynb)\n", + "* Learn about the variety of [Gates](/cirq/build/gates) available in cirq and more about the different ways to construct [Circuits](/cirq/build/circuits)\n", + "* Learn more about [Simulations](/cirq/simulate/simulate) and how it works.\n", + "* Learn about [Noise](/cirq/noise) and how to utilize multi-level systems using [Qudits](/cirq/build/qudits)\n", "* Dive into some [Experiments](/cirq/experiments) and some in-depth tutorials of how to use cirq.\n", "\n", "Also, join our [cirq-announce mailing list](https://groups.google.com/forum/#!forum/cirq-announce) to hear about changes and releases or go to the [cirq github](https://github.com/quantumlib/Cirq/) to file issues." diff --git a/docs/install.md b/docs/start/install.md similarity index 100% rename from docs/install.md rename to docs/start/install.md diff --git a/docs/tutorials/educators/intro.ipynb b/docs/start/intro.ipynb similarity index 99% rename from docs/tutorials/educators/intro.ipynb rename to docs/start/intro.ipynb index 7a770167d7a..7aa606a2c94 100644 --- a/docs/tutorials/educators/intro.ipynb +++ b/docs/start/intro.ipynb @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -80,7 +80,7 @@ "id": "rPgPbry6-mF3" }, "source": [ - "To use Cirq one first needs to install Cirq. Installation instructions are available at [https://quantumai.google/cirq/install](https://quantumai.google/cirq/install). For the purpose of this tutorial, we run `pip install cirq` as shown in the following code cell to install the latest release of Cirq. \n", + "To use Cirq one first needs to install Cirq. Installation instructions are available at [https://quantumai.google/cirq/start/install](https://quantumai.google/cirq/start/install). For the purpose of this tutorial, we run `pip install cirq` as shown in the following code cell to install the latest release of Cirq. \n", "\n", "> Different notebook execution systems exist, but for most part they have \"run\" button on a cell which you can click, or \"shift + enter\" is often the shortcut to run the cell. \n", "\n", diff --git a/docs/tutorials/educators/intro.tst b/docs/start/intro.tst similarity index 100% rename from docs/tutorials/educators/intro.tst rename to docs/start/intro.tst diff --git a/docs/start.ipynb b/docs/start/start.ipynb similarity index 77% rename from docs/start.ipynb rename to docs/start/start.ipynb index 4ce0147cdce..b8fecfaf1aa 100644 --- a/docs/start.ipynb +++ b/docs/start/start.ipynb @@ -48,16 +48,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] @@ -115,15 +115,15 @@ "You've just run your first Cirq program. If you would like to learn more about quantum computing, check out our [education page](/education). The Full API reference for Cirq can be found [here](/reference/python/cirq). If you are looking for vendor specific information that can be found on our vendor sub-pages:\n", "\n", "\n", - " [Alpine Quantum Technologies](tutorials/aqt/getting_started.ipynb)\n", + " [Alpine Quantum Technologies](/cirq/hardware/aqt/getting_started.ipynb)\n", " \n", - " [Pasqal](tutorials/pasqal/getting_started.ipynb)\n", + " [Pasqal](/cirq/hardware/pasqal/getting_started.ipynb)\n", " \n", - " [IonQ](tutorials/ionq/getting_started.ipynb)\n", + " [IonQ](/cirq/hardware/ionq/getting_started.ipynb)\n", " \n", - " [Azure](tutorials/azure-quantum/getting_started_honeywell.ipynb)\n", + " [Azure](/cirq/hardware/azure-quantum/getting_started_honeywell.ipynb)\n", " \n", - " [Rigetti](tutorials/rigetti/getting_started.ipynb)" + " [Rigetti](/cirq/hardware/rigetti/getting_started.ipynb)" ] } ], diff --git a/docs/transform/_index.yaml b/docs/transform/_index.yaml index 1d0388394c1..e289d7b6663 100644 --- a/docs/transform/_index.yaml +++ b/docs/transform/_index.yaml @@ -11,7 +11,7 @@ landing_page: items: - heading: Circuit Transformers description: The Transformer class and contract to represent some process that changes a supplied circuit. - path: /cirq/transformers + path: /cirq/transform/transformers - heading: Custom Transformers description: Write your own Transformer with decorators, primitives and decompositions. path: /cirq/transform/custom_transformers diff --git a/docs/transform/custom_transformers.ipynb b/docs/transform/custom_transformers.ipynb index 38775d56f79..a95c8a9a099 100644 --- a/docs/transform/custom_transformers.ipynb +++ b/docs/transform/custom_transformers.ipynb @@ -64,7 +64,7 @@ "id": "6d36e471ec63" }, "source": [ - "The [Transformers](/cirq/transformers) page introduced what a transformer is, what transformers are available in Cirq, and how to create a simple one as a composite of others. This page covers the details necessary for creating more nuanced custom transformers, including `cirq.TransformerContext`, primitives and decompositions." + "The [Transformers](/cirq/transform/transformers) page introduced what a transformer is, what transformers are available in Cirq, and how to create a simple one as a composite of others. This page covers the details necessary for creating more nuanced custom transformers, including `cirq.TransformerContext`, primitives and decompositions." ] }, { diff --git a/docs/transformers.ipynb b/docs/transform/transformers.ipynb similarity index 96% rename from docs/transformers.ipynb rename to docs/transform/transformers.ipynb index e1421eb0f07..eeee14959e6 100644 --- a/docs/transformers.ipynb +++ b/docs/transform/transformers.ipynb @@ -40,16 +40,16 @@ "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", - " View on QuantumAI\n", + " View on QuantumAI\n", " \n", - " Run in Google Colab\n", + " Run in Google Colab\n", " \n", - " View source on GitHub\n", + " View source on GitHub\n", " \n", - " Download notebook\n", + " Download notebook\n", "
" ] diff --git a/docs/tutorials/_index.yaml b/docs/tutorials/_index.yaml deleted file mode 100644 index d48bb79d084..00000000000 --- a/docs/tutorials/_index.yaml +++ /dev/null @@ -1,161 +0,0 @@ -book_path: /cirq/_book.yaml -project_path: /cirq/_project.yaml -title: Tutorials -landing_page: - nav: left - rows: - - heading: Tutorials and examples - description: Cirq comes with a collection of example implementations of beginner, intermediate, and advanced quantum algorithms that demonstrate the main features of the library. - - heading: Beginner - description: Explore Cirq through introductory quantum information examples. - items: - - heading: Basics - description: Learn the basics of Cirq. - path: /cirq/tutorials/basics - icon: - name: menu_book - - - heading: Intermediate - description: Use Cirq for intermediate-level subroutines and algorithms. - items: - - heading: Quantum variational algorithm - description: Use the variational quantum eigensolver to find the ground state of the Ising model. - path: /cirq/tutorials/variational_algorithm - icon: - name: menu_book - - heading: Approximate optimization - description: Use a quantum computer to find approximately optimal cuts in a graph. - path: /cirq/experiments/qaoa_maxcut - icon: - name: menu_book - - heading: Quantum walks - description: Demonstration of classical and quantum random walks on a graph. - path: /cirq/tutorials/quantum_walks - icon: - name: menu_book - - - - heading: Advanced - description: Utilize Cirq features to implement advanced quantum algorithms. - items: - - heading: Hidden linear function problem - description: Find a hidden vector with a constant depth quantum circuit. - path: /cirq/tutorials/hidden_linear_function - icon: - name: menu_book - - heading: Shor's algorithm - description: Factor numbers using a quantum computer. - path: /cirq/tutorials/shor - icon: - name: menu_book - - - heading: GitHub - description: See more examples on the Cirq GitHub. - - - heading: Beginner - items: - - heading: Hello qubit - description: Simple first program showing how to create a quantum circuit. - path: https://github.com/quantumlib/Cirq/blob/master/examples/hello_qubit.py - icon: - name: code - - - heading: Deutsch's algorithm - description: Textbook example of the simplest quantum advantage. - path: https://github.com/quantumlib/Cirq/blob/master/examples/deutsch.py - icon: - name: code - - heading: Bernstein-Vazirani algorithm - description: Textbook algorithm determining a global property of a function with surprisingly few calls to it. - path: https://github.com/quantumlib/Cirq/blob/master/examples/bernstein_vazirani.py - icon: - name: code - - - heading: Bell inequality - description: Demonstration of a Bell inequality which shows impossibility of local hidden variable theories. - path: https://github.com/quantumlib/Cirq/blob/master/examples/bell_inequality.py - icon: - name: code - - heading: BB84 - description: Textbook algorithm for Quantum Key Distribution. - path: https://github.com/quantumlib/Cirq/blob/master/examples/bb84.py - icon: - name: code - - heading: Noisy simulation - description: How to use a noisy simulator to execute quantum circuits. - path: https://github.com/quantumlib/Cirq/blob/master/examples/noisy_simulation_example.py - icon: - name: code - - heading: Quantum teleportation - description: A demonstration of using 2 classical bits to transport a quantum state from one - qubit to another. - path: https://github.com/quantumlib/Cirq/blob/master/examples/quantum_teleportation.py - icon: - name: code - - heading: Superdense coding - description: Transmit 2 classical bits using one quantum bit. - path: https://github.com/quantumlib/Cirq/blob/master/examples/superdense_coding.py - icon: - name: code - - heading: Heatmaps - description: Visualize single qubit and two-qubit interaction metrics - path: https://github.com/quantumlib/Cirq/blob/master/examples/heatmaps.py - icon: - name: code - - - heading: Intermediate - items: - - heading: Arithmetic - description: Algorithms for adding and multiplying numbers represented by quantum states. - path: https://github.com/quantumlib/Cirq/blob/master/examples/basic_arithmetic.py - icon: - name: code - - heading: Grover's algorithm - description: Use a quantum computer to find a needle in a haystack. - path: https://github.com/quantumlib/Cirq/blob/master/examples/grover.py - icon: - name: code - - - heading: Shor's code - description: Quantum error correction with Shor's nine-qubit code. - path: https://github.com/quantumlib/Cirq/blob/master/examples/shors_code.py - icon: - name: code - - heading: Quantum Fourier transform - description: Change from the computational basis to the frequency basis and vice versa. - path: https://github.com/quantumlib/Cirq/blob/master/examples/quantum_fourier_transform.py - icon: - name: code - - heading: Phase estimation - description: Find the eigenvalues of a unitary operator. - path: https://github.com/quantumlib/Cirq/blob/master/examples/phase_estimator.py - icon: - name: code - - heading: Swap networks - description: Algorithm for efficiently emulating full connectivity on a limited connectivity grid of qubits. - path: https://github.com/quantumlib/Cirq/blob/master/examples/swap_networks.py - icon: - name: code - - - heading: Advanced - items: - - heading: Direct fidelity estimation - description: Direct fidelity estimation to distinguish a desired state fromt he actual state using few Pauli measurements. - path: https://github.com/quantumlib/Cirq/blob/master/examples/direct_fidelity_estimation.py - icon: - name: code - - heading: XEB - description: Fidelity estimation using cross-entropy benchmarking (XEB). - path: https://github.com/quantumlib/Cirq/blob/master/examples/cross_entropy_benchmarking_example.py - icon: - name: code - - heading: HHL - description: Algorithm for solving linear systems using quantum phase estimation. - path: https://github.com/quantumlib/Cirq/blob/master/examples/hhl.py - icon: - name: code - - heading: Stabilizer code - description: An illustration of quantum error correction using stabilizer code, following the PhD thesis of Daniel Gottesman. - path: https://github.com/quantumlib/Cirq/blob/master/examples/stabilizer_code.py - icon: - name: code \ No newline at end of file diff --git a/docs/tutorials/google/colab.ipynb b/docs/tutorials/google/colab.ipynb index d4ef6b19ac0..6e790c078fb 100644 --- a/docs/tutorials/google/colab.ipynb +++ b/docs/tutorials/google/colab.ipynb @@ -155,8 +155,8 @@ "\n", "### More Documentation Links\n", "\n", - "* [Quantum Engine concepts](../../google/concepts.md)\n", - "* [Quantum Engine documentation](../../google/engine.md)\n", + "* [Quantum Engine concepts](/cirq/google/concepts.md)\n", + "* [Quantum Engine documentation](/cirq/google/engine.md)\n", "* [Cirq documentation](https://cirq.readthedocs.io)\n", "* [Colab documentation](https://colab.research.google.com/notebooks/welcome.ipynb)\n" ] diff --git a/docs/tutorials/google/identifying_hardware_changes.ipynb b/docs/tutorials/google/identifying_hardware_changes.ipynb index 2f7448228b5..46634175186 100644 --- a/docs/tutorials/google/identifying_hardware_changes.ipynb +++ b/docs/tutorials/google/identifying_hardware_changes.ipynb @@ -70,12 +70,12 @@ "id": "2KEoj85SkMQ0" }, "source": [ - "You've run your circuit with Google's [Quantum Computing Service](./start.ipynb) and you're getting results that unexpectedly differ from those you saw when you ran your experiment last week. What's the cause of this and what can you do about it? \n", + "You've run your circuit with Google's [Quantum Computing Service](/cirq/google/start.ipynb) and you're getting results that unexpectedly differ from those you saw when you ran your experiment last week. What's the cause of this and what can you do about it? \n", "\n", - "Your experience may be due to changes in the device that have occurred since the most recent maintenance [Calibration](../../cirq/google/calibration_faq#what_is_the_difference_between_the_user-triggered_calibrations_floquet_or_xeb_and_the_maintenance_calibration). Every few days, the QCS devices are calibrated for the highest performance across all of their available qubits and operations. However, in the hours or days since the most recent maintenance calibration, the performance of the device hardware may have changed significantly, affecting your circuit's results. \n", + "Your experience may be due to changes in the device that have occurred since the most recent maintenance [Calibration](/cirq/noise/calibration_faq#what_is_the_difference_between_the_user-triggered_calibrations_floquet_or_xeb_and_the_maintenance_calibration). Every few days, the QCS devices are calibrated for the highest performance across all of their available qubits and operations. However, in the hours or days since the most recent maintenance calibration, the performance of the device hardware may have changed significantly, affecting your circuit's results. \n", "\n", "The rest of this tutorial will describe these hardware changes, demonstrate how to collect error metrics for identifying if changes have occurred, and provide some examples of how you can compare your metric results to select the most performant qubits for your circuit. \n", - "For more further reading on qubit picking methodology, see the [Best Practices](../../google/best_practices.ipynb) guide and [Qubit Picking with Loschmidt Echoes](./echoes.ipynb) tutorial. The method presented in the Loschmidt Echoes tutorial is an alternative way to identify hardware changes." + "For more further reading on qubit picking methodology, see the [Best Practices](/cirq/google/best_practices.ipynb) guide and [Qubit Picking with Loschmidt Echoes](/cirq/tutorials/google/echoes.ipynb) tutorial. The method presented in the Loschmidt Echoes tutorial is an alternative way to identify hardware changes." ] }, { @@ -103,12 +103,12 @@ "source": [ "## Qubit Error Metrics\n", "\n", - "There are many [Calibration Metrics](../../google/calibration.md#individual-metrics) available to measure gate and readout error rates and see if they have changed. The [Visualizing Calibration Metrics](./visualizing_calibration_metrics.ipynb) tutorial demonstrates how to collect and visualize each of these available metrics. You can apply the comparison methods presented in this tutorial to any such metric, but the examples below focus on the two following metrics:\n", + "There are many [Calibration Metrics](/cirq/google/calibration.md#individual-metrics) available to measure gate and readout error rates and see if they have changed. The [Visualizing Calibration Metrics](/cirq/tutorials/google/visualizing_calibration_metrics.ipynb) tutorial demonstrates how to collect and visualize each of these available metrics. You can apply the comparison methods presented in this tutorial to any such metric, but the examples below focus on the two following metrics:\n", "\n", - "* [`two_qubit_parallel_sqrt_iswap_gate_xeb_pauli_error_per_cycle`](../../google/calibration.md#): This metric captures the estimated probability for the quantum state on two neighboring qubits to depolarize (as if a Pauli gate was applied to either or both qubits) after applying an $\\sqrt{i\\mathrm{SWAP}}$ gate. This metric includes some coherent error like the error introduced by control hardware. This metric is computed using [Cross Entropy Benchmarking (XEB)](../../qcvv/xeb_theory.ipynb) during maintenance calibration and in this tutorial.\n", - "* [`parallel_p11_error`](../../google/calibration.md#): This metric estimates the probability for a readout register to correctly measure a $|1\\rangle$ state on a qubit that was prepared to be in the $|1\\rangle$ state. The Simultaneous Readout experiment used to collect this metric evaluates all of the qubits in parallel/simultaneously.\n", + "* [`two_qubit_parallel_sqrt_iswap_gate_xeb_pauli_error_per_cycle`](/cirq/google/calibration.md#): This metric captures the estimated probability for the quantum state on two neighboring qubits to depolarize (as if a Pauli gate was applied to either or both qubits) after applying an $\\sqrt{i\\mathrm{SWAP}}$ gate. This metric includes some coherent error like the error introduced by control hardware. This metric is computed using [Cross Entropy Benchmarking (XEB)](/cirq/noise/qcvv/xeb_theory.ipynb) during maintenance calibration and in this tutorial.\n", + "* [`parallel_p11_error`](/cirq/google/calibration.md#): This metric estimates the probability for a readout register to correctly measure a $|1\\rangle$ state on a qubit that was prepared to be in the $|1\\rangle$ state. The Simultaneous Readout experiment used to collect this metric evaluates all of the qubits in parallel/simultaneously.\n", "\n", - "Note: The two-qubit metric uses Pauli error, which has two other multiplicatively-related variants: [Average error and Incoherent error](../../google/calibration.md#average-pauli-and-incoherent-error).\n" + "Note: The two-qubit metric uses Pauli error, which has two other multiplicatively-related variants: [Average error and Incoherent error](/cirq/google/calibration.md#average-pauli-and-incoherent-error).\n" ] }, { @@ -380,7 +380,7 @@ "source": [ "### Current Two-Qubit Metric Data with XEB\n", "\n", - "This section is a shortened version of the [Parallel XEB](../../qcvv/parallel_xeb.ipynb) tutorial, which runs characterization experiments to collect data for the `two_qubit_parallel_sqrt_iswap_gate_xeb_pauli_error_per_cycle` metric. First, generate a library of two qubit circuits using the $\\sqrt{i\\mathrm{SWAP}}$ gate . These circuits will be run in parallel in larger circuits according to `combinations_by_layer`. " + "This section is a shortened version of the [Parallel XEB](/cirq/noise/qcvv/parallel_xeb.ipynb) tutorial, which runs characterization experiments to collect data for the `two_qubit_parallel_sqrt_iswap_gate_xeb_pauli_error_per_cycle` metric. First, generate a library of two qubit circuits using the $\\sqrt{i\\mathrm{SWAP}}$ gate . These circuits will be run in parallel in larger circuits according to `combinations_by_layer`. " ] }, { @@ -479,7 +479,7 @@ "id": "9sY5bMW9f-Oo" }, "source": [ - "Note: The parallel XEB errors are scaled in pxeb_results. This is because the collected fidelities are the estimated depolarization fidelities, not the Pauli error metrics available from the calibration data. See the [XEB Theory](../../qcvv/xeb_theory.ipynb#fidelities) tutorial for an explanation why, and [Calibration Metrics](../../google/calibration.md) for more information on the difference between these values. " + "Note: The parallel XEB errors are scaled in pxeb_results. This is because the collected fidelities are the estimated depolarization fidelities, not the Pauli error metrics available from the calibration data. See the [XEB Theory](/cirq/noise/qcvv/xeb_theory.ipynb#fidelities) tutorial for an explanation why, and [Calibration Metrics](/cirq/google/calibration.md) for more information on the difference between these values. " ] }, { @@ -720,10 +720,10 @@ "\n", "You've selected better candidate qubits for your circuit, based on updated information about the device. What else can you do for further improvements? \n", "\n", - "* You need to map your actual circuit's logical qubits to your selected hardware qubits. This is in general a difficult problem, and the best solution can depend on the specific structure of the circuit to be run. Take a look at the [Qubit Picking with Loschmidt Echoes](./echoes.ipynb) tutorial, which estimates the error rates of gates for your specific circuit. Also, consider [Best Practices#Qubit picking](../../google/best_practices.ipynb#Qubit-picking) for additional advice on this.\n", - "* The [Optimization, Alignment, and Spin Echoes](./spin_echoes.ipynb) tutorial provides resources on how you can improve the reliability of your circuit by: optimizing away redundant or low-impact gates, aligning gates into moments with others of the same type, and preventing decay on idle qubits with by adding spin echoes. \n", - "* Other than for qubit picking, you should also use calibration for error compensation. The [XEB and Coherent Error](../../qcvv/xeb_coherent_noise.ipynb), [XEB Calibration Example](./xeb_calibration_example.ipynb), [Parallel XEB](../../qcvv/parallel_xeb.ipynb) and [Isolated XEB](../../qcvv/isolated_xeb.ipynb) tutorials demonstrate how to run a classical optimizer on collected two-qubit gate characterization data, identity the true unitary matrix implemented by each gate, and add [Virtual Pauli Z gates](../../google/devices.md#virtual-z-gates) to compensate for the identified error, improving the reliability of your circuit.\n", - "* You are also free to use the characterization data to improve the performance of large batches of experiment circuits. In this case you'd want to prepare your characterization ahead of running all your circuits, and use the data to compensate each circuit, right before running them. See [Calibration FAQ](../../google/calibration_faq.md#i-have-many-circuits-to-calibrate-how-do-i-speed-it-up) for more information. " + "* You need to map your actual circuit's logical qubits to your selected hardware qubits. This is in general a difficult problem, and the best solution can depend on the specific structure of the circuit to be run. Take a look at the [Qubit Picking with Loschmidt Echoes](/cirq/tutorials/google/echoes.ipynb) tutorial, which estimates the error rates of gates for your specific circuit. Also, consider [Best Practices#Qubit picking](/cirq/google/best_practices.ipynb#Qubit-picking) for additional advice on this.\n", + "* The [Optimization, Alignment, and Spin Echoes](/cirq/tutorials/google/spin_echoes.ipynb) tutorial provides resources on how you can improve the reliability of your circuit by: optimizing away redundant or low-impact gates, aligning gates into moments with others of the same type, and preventing decay on idle qubits with by adding spin echoes. \n", + "* Other than for qubit picking, you should also use calibration for error compensation. The [XEB and Coherent Error](/cirq/noise/qcvv/xeb_coherent_noise.ipynb), [XEB Calibration Example](/cirq/noise/qcvv/xeb_calibration_example.ipynb), [Parallel XEB](/cirq/noise/qcvv/parallel_xeb.ipynb) and [Isolated XEB](/cirq/noise/qcvv/isolated_xeb.ipynb) tutorials demonstrate how to run a classical optimizer on collected two-qubit gate characterization data, identity the true unitary matrix implemented by each gate, and add [Virtual Pauli Z gates](/cirq/hardware/devices#virtual-z-gates) to compensate for the identified error, improving the reliability of your circuit.\n", + "* You are also free to use the characterization data to improve the performance of large batches of experiment circuits. In this case you'd want to prepare your characterization ahead of running all your circuits, and use the data to compensate each circuit, right before running them. See [Calibration FAQ](/cirq/noise/calibration_faq.md#i-have-many-circuits-to-calibrate-how-do-i-speed-it-up) for more information. " ] } ], diff --git a/docs/tutorials/google/start.ipynb b/docs/tutorials/google/start.ipynb index 27c67de1ad6..636fb2fb6b6 100644 --- a/docs/tutorials/google/start.ipynb +++ b/docs/tutorials/google/start.ipynb @@ -192,7 +192,7 @@ }, "source": [ "## Create a circuit\n", - "Now that you've enabled Quantum Computing Service and configured the notebook, let's create a basic program with Cirq. After reviewing the code, **run this block** to run a circuit, and print a circuit diagram and results. To learn more, refer to the [Cirq overview](https://quantumai.google/cirq) and [Cirq basics](../basics.ipynb) pages." + "Now that you've enabled Quantum Computing Service and configured the notebook, let's create a basic program with Cirq. After reviewing the code, **run this block** to run a circuit, and print a circuit diagram and results. To learn more, refer to the [Cirq overview](https://quantumai.google/cirq) and [Cirq basics](/cirq/start/basics.ipynb) pages." ] }, { @@ -270,7 +270,7 @@ }, "source": [ "## Run on quantum hardware\n", - "Approved users can access quantum hardware in two modes. First, all approved users have access to a processor in \"open-swim\" which is a first-in-first-out queue with fairness algorithm that balances jobs across users in the queue. Secondly, processors can be reserved in hourly blocks if the user is approved. You can learn more about the reservation system on the [concepts page](../../google/concepts.ipynb). We'll use the processor `pacific` in this demo." + "Approved users can access quantum hardware in two modes. First, all approved users have access to a processor in \"open-swim\" which is a first-in-first-out queue with fairness algorithm that balances jobs across users in the queue. Secondly, processors can be reserved in hourly blocks if the user is approved. You can learn more about the reservation system on the [concepts page](/cirq/google/concepts.ipynb). We'll use the processor `pacific` in this demo." ] }, { @@ -371,7 +371,7 @@ "source": [ "Note that the qubit that we used for the simulation above, `(0, 0)`, does not exist on the hardware. Since the grid of available qubits may change over time, we'll programatically select a valid qubit by inspecting `device.qubits`. We then use the `transform_qubits()` method to remap the circuit onto that qubit.\n", "\n", - "In order to run on hardware, we must also ensure that the circuit only contains gates that the hardware supports. The basic gates used here are always available, so this circuit can be run without any further changes, but in general you may need to apply additional transformations before running arbitrary circuits. See the [best practices](../../google/best_practices.ipynb) guide for more information about running circuits on hardware." + "In order to run on hardware, we must also ensure that the circuit only contains gates that the hardware supports. The basic gates used here are always available, so this circuit can be run without any further changes, but in general you may need to apply additional transformations before running arbitrary circuits. See the [best practices](/cirq/google/best_practices.ipynb) guide for more information about running circuits on hardware." ] }, { @@ -462,7 +462,7 @@ "\n", "### Setup Cirq\n", "\n", - "Follow the [Cirq Install](../../install.md) page to install Cirq locally. We highly recommend that you setup a virtual environment for this installation to isolate your development stack from your overall system installations. Make sure to setup the virtual environment for Python 3 and not Python 2.\n", + "Follow the [Cirq Install](/cirq/start/install.md) page to install Cirq locally. We highly recommend that you setup a virtual environment for this installation to isolate your development stack from your overall system installations. Make sure to setup the virtual environment for Python 3 and not Python 2.\n", "\n", "### Setup Google Cloud authentication\n", "\n", @@ -573,7 +573,7 @@ "source": [ "## Next steps\n", "* Use [this template colab](colab.ipynb) as a base for your own explorations.\n", - "* Explore [best practices](../../google/best_practices.ipynb) for getting circuits to run on hardware.\n" + "* Explore [best practices](/cirq/google/best_practices.ipynb) for getting circuits to run on hardware.\n" ] } ], diff --git a/docs/tutorials/google/visualizing_calibration_metrics.ipynb b/docs/tutorials/google/visualizing_calibration_metrics.ipynb index f89250b1425..12d064f5638 100644 --- a/docs/tutorials/google/visualizing_calibration_metrics.ipynb +++ b/docs/tutorials/google/visualizing_calibration_metrics.ipynb @@ -37,7 +37,7 @@ }, "source": [ "# Calibrations\n", - "The [guide on calibration](../../google/calibration) gives an introduction to calibration metrics and how to retrieve them from the Google Quantum Computing Service (QCS). In this tutorial, we show how to visualize these calibration metrics via single qubit heatmaps, two qubit interaction heatmaps and integrated histograms.\n", + "The [guide on calibration](/cirq/google/calibration) gives an introduction to calibration metrics and how to retrieve them from the Google Quantum Computing Service (QCS). In this tutorial, we show how to visualize these calibration metrics via single qubit heatmaps, two qubit interaction heatmaps and integrated histograms.\n", "\n", "**Disclaimer:** The calibration metrics of the quantum processor shown in the tutorial do not correspond to actual production metrics." ] @@ -211,7 +211,7 @@ "source": [ "# Metrics\n", "\n", - "For a complete description of all the available calibration metrics, please see [Calibration metrics](../../google/calibration)" + "For a complete description of all the available calibration metrics, please see [Calibration metrics](/cirq/google/calibration)" ] }, {