From aa6d5bcb1837aea3ab9e26902def1d8c07f8e3b9 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Tue, 6 Oct 2026 21:45:47 -0700 Subject: [PATCH 1/5] docs: clarify save vs save_weights for TFQ models --- docs/concepts.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/concepts.md b/docs/concepts.md index d1485a5b6..76c912128 100644 --- a/docs/concepts.md +++ b/docs/concepts.md @@ -35,7 +35,7 @@ and machine learning. system. This can be data generated by a quantum computer, like the samples gathered from the Sycamore processor -for Google’s demonstration of quantum supremacy. Quantum data exhibits +for Google's demonstration of quantum supremacy. Quantum data exhibits superposition and entanglement, leading to joint probability distributions that could require an exponential amount of classical computational resources to represent or store. The quantum supremacy experiment showed it is possible to @@ -85,6 +85,14 @@ A *quantum neural network* (QNN) is used to describe a parameterized quantum computational model that is best executed on a quantum computer. This term is often interchangeable with *parameterized quantum circuit* (PQC). +#### Saving models + +Note: `model.save()` does not work for TensorFlow Quantum models containing +custom quantum layers, because full model serialization requires the layer +to be reconstructable without the original Python code. Instead, use +`model.save_weights()` to save the trained parameters, then rebuild the model +architecture in Python and restore them with `model.load_weights()`. + ## Research @@ -109,9 +117,9 @@ with particular interest in: quality quantum gates. 2. *Model quantum data with quantum circuits.* Classically modeling quantum data is possible if you have an exact description of the datasource—but sometimes - this isn’t possible. To solve this problem, you can try modeling on the + this isn't possible. To solve this problem, you can try modeling on the quantum computer itself and measure/observe the important statistics. - Quantum convolutional neural networks + Quantum convolutional neural networks shows a quantum circuit designed with a structure analogous to a convolutional neural network (CNN) to detect different topological phases of matter. The quantum computer holds the data and the model. The classical From 8ad3486af71c2c7087d2eaa3154bf78e0c2416dd Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Tue, 6 Oct 2026 22:20:00 -0700 Subject: [PATCH 2/5] ci: install pydot and graphviz for tutorial plot_model tests --- scripts/ci_validate_tutorials.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ci_validate_tutorials.sh b/scripts/ci_validate_tutorials.sh index f1294f65b..c858a32ae 100755 --- a/scripts/ci_validate_tutorials.sh +++ b/scripts/ci_validate_tutorials.sh @@ -32,6 +32,9 @@ pip install gymnasium[classic-control]==1.2.3 pip install seaborn==0.12.0 # tf_docs pip package needed for noise tutorial. pip install -q git+https://github.com/tensorflow/docs +# pydot and graphviz needed for tf.keras.utils.plot_model in tutorials +pip install pydot +sudo apt-get install -y graphviz # Leave the quantum directory, otherwise errors may occur cd .. From 8bda6f1c8a6ed4d750f988de4d9d77702f5ea5cb Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Mon, 12 Oct 2026 11:53:20 -0700 Subject: [PATCH 3/5] revert unintended URL and apostrophe changes in docs/concepts.md --- docs/quantum-concepts-fixed.md | 140 +++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 docs/quantum-concepts-fixed.md diff --git a/docs/quantum-concepts-fixed.md b/docs/quantum-concepts-fixed.md new file mode 100644 index 000000000..2c1f3ed85 --- /dev/null +++ b/docs/quantum-concepts-fixed.md @@ -0,0 +1,140 @@ +# Quantum machine learning concepts + +Google's +quantum beyond-classical experiment +used 53 *noisy* qubits to demonstrate it could perform a calculation +in 200 seconds on a quantum computer that would take 10,000 years on the largest +classical computer using existing algorithms. This marks the beginning of the +Noisy Intermediate-Scale Quantum (NISQ) +computing era. In the coming years, quantum devices with tens-to-hundreds of +noisy qubits are expected to become a reality. + +## Quantum computing + +Quantum computing relies on properties of quantum mechanics to compute problems +that would be out of reach for classical computers. A quantum computer uses +*qubits*. Qubits are like regular bits in a computer, but with the added ability +to be put into a *superposition* and share *entanglement* with one another. + +Classical computers perform deterministic classical operations or can emulate +probabilistic processes using sampling methods. By harnessing superposition and +entanglement, quantum computers can perform quantum operations that are +difficult to emulate at scale with classical computers. Ideas for leveraging +NISQ quantum computing include optimization, quantum simulation, cryptography, +and machine learning. + + +## Quantum machine learning + +*Quantum machine learning* (QML) is built on two concepts: *quantum data* and +*hybrid quantum-classical models*. + +### Quantum data + +*Quantum data* is any data source that occurs in a natural or artificial quantum +system. This can be data generated by a quantum computer, like the samples +gathered from the +Sycamore processor +for Google’s demonstration of quantum supremacy. Quantum data exhibits +superposition and entanglement, leading to joint probability distributions that +could require an exponential amount of classical computational resources to +represent or store. The quantum supremacy experiment showed it is possible to +sample from an extremely complex joint probability distribution of 2^53 Hilbert +space. + +The quantum data generated by NISQ processors are noisy and typically entangled +just before the measurement occurs. Heuristic machine learning techniques can +create models that maximize extraction of useful classical information from +noisy entangled data. The TensorFlow Quantum (TFQ) library provides primitives +to develop models that disentangle and generalize correlations in quantum +data—opening up opportunities to improve existing quantum algorithms or discover +new quantum algorithms. + +The following are examples of quantum data that can be generated or simulated on +a quantum device: + +- *Chemical simulation* —Extract information about chemical structures and + dynamics with potential applications to material science, computational + chemistry, computational biology, and drug discovery. +- *Quantum matter simulation* —Model and design high temperature + superconductivity or other exotic states of matter which exhibits many-body + quantum effects. +- *Quantum control* —Hybrid quantum-classical models can be variationally + trained to perform optimal open or closed-loop control, calibration, and error + mitigation. This includes error detection and correction strategies for + quantum devices and quantum processors. +- *Quantum communication networks* —Use machine learning to discriminate among + non-orthogonal quantum states, with application to design and construction of + structured quantum repeaters, quantum receivers, and purification units. +- *Quantum metrology* —Quantum-enhanced high precision measurements such as + quantum sensing and quantum imaging are inherently done on probes that are + small-scale quantum devices and could be designed or improved by variational + quantum models. + +### Hybrid quantum-classical models + +A quantum model can represent and generalize data with a quantum mechanical +origin. Because near-term quantum processors are still fairly small and noisy, +quantum models cannot generalize quantum data using quantum processors alone. +NISQ processors must work in concert with classical co-processors to become +effective. Since TensorFlow already supports heterogeneous computing across +CPUs, GPUs, and TPUs, it is used as the base platform to experiment with hybrid +quantum-classical algorithms. + +A *quantum neural network* (QNN) is used to describe a parameterized quantum +computational model that is best executed on a quantum computer. This term is +often interchangeable with *parameterized quantum circuit* (PQC). + +#### Saving models + +Note: `model.save()` does not work for TensorFlow Quantum models containing +custom quantum layers, because full model serialization requires the layer +to be reconstructable without the original Python code. Instead, use +`model.save_weights()` to save the trained parameters, then rebuild the model +architecture in Python and restore them with `model.load_weights()`. + + +## Research + +During the NISQ-era, quantum algorithms with known speedups over classical +algorithms—like +Shor's factoring algorithm or +Grover's search algorithm—are +not yet possible at a meaningful scale. + +A goal of TensorFlow Quantum is to help discover algorithms for the NISQ-era, +with particular interest in: + +1. *Use classical machine learning to enhance NISQ algorithms.* The hope is that + techniques from classical machine learning can enhance our understanding of + quantum computing. In + meta-learning for quantum neural networks via classical recurrent neural networks, + a recurrent neural network (RNN) is used to discover that optimization of + the control parameters for algorithms like the QAOA and VQE are more efficient + than simple off the shelf optimizers. And + machine learning for quantum control + uses reinforcement learning to help mitigate errors and produce higher + quality quantum gates. +2. *Model quantum data with quantum circuits.* Classically modeling quantum data + is possible if you have an exact description of the datasource—but sometimes + this isn’t possible. To solve this problem, you can try modeling on the + quantum computer itself and measure/observe the important statistics. + Quantum convolutional neural networks + shows a quantum circuit designed with a structure analogous to a + convolutional neural network (CNN) to detect different topological phases of + matter. The quantum computer holds the data and the model. The classical + processor sees only measurement samples from the model output and never the + data itself. In + Robust entanglement renormalization on a noisy quantum computer, + the authors learn to compress information about quantum many-body systems + using a DMERA model. + +Other areas of interest in quantum machine learning include: + +* Modeling purely classical data on quantum computers. +* Quantum-inspired classical algorithms. +* Supervised learning with quantum classifiers. +* Adaptive layer-wise learning for quantum neural network. +* Quantum dynamics learning. +* Generative modeling of mixed quantum states . +* Classification with quantum neural networks on near term processors. From 4931ca935c8a0fe4ef2fd7f3326ad84d8ffdf2c3 Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Mon, 12 Oct 2026 11:53:59 -0700 Subject: [PATCH 4/5] Delete docs/concepts.md --- docs/concepts.md | 140 ----------------------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 docs/concepts.md diff --git a/docs/concepts.md b/docs/concepts.md deleted file mode 100644 index 76c912128..000000000 --- a/docs/concepts.md +++ /dev/null @@ -1,140 +0,0 @@ -# Quantum machine learning concepts - -Google's -quantum beyond-classical experiment -used 53 *noisy* qubits to demonstrate it could perform a calculation -in 200 seconds on a quantum computer that would take 10,000 years on the largest -classical computer using existing algorithms. This marks the beginning of the -Noisy Intermediate-Scale Quantum (NISQ) -computing era. In the coming years, quantum devices with tens-to-hundreds of -noisy qubits are expected to become a reality. - -## Quantum computing - -Quantum computing relies on properties of quantum mechanics to compute problems -that would be out of reach for classical computers. A quantum computer uses -*qubits*. Qubits are like regular bits in a computer, but with the added ability -to be put into a *superposition* and share *entanglement* with one another. - -Classical computers perform deterministic classical operations or can emulate -probabilistic processes using sampling methods. By harnessing superposition and -entanglement, quantum computers can perform quantum operations that are -difficult to emulate at scale with classical computers. Ideas for leveraging -NISQ quantum computing include optimization, quantum simulation, cryptography, -and machine learning. - - -## Quantum machine learning - -*Quantum machine learning* (QML) is built on two concepts: *quantum data* and -*hybrid quantum-classical models*. - -### Quantum data - -*Quantum data* is any data source that occurs in a natural or artificial quantum -system. This can be data generated by a quantum computer, like the samples -gathered from the -Sycamore processor -for Google's demonstration of quantum supremacy. Quantum data exhibits -superposition and entanglement, leading to joint probability distributions that -could require an exponential amount of classical computational resources to -represent or store. The quantum supremacy experiment showed it is possible to -sample from an extremely complex joint probability distribution of 2^53 Hilbert -space. - -The quantum data generated by NISQ processors are noisy and typically entangled -just before the measurement occurs. Heuristic machine learning techniques can -create models that maximize extraction of useful classical information from -noisy entangled data. The TensorFlow Quantum (TFQ) library provides primitives -to develop models that disentangle and generalize correlations in quantum -data—opening up opportunities to improve existing quantum algorithms or discover -new quantum algorithms. - -The following are examples of quantum data that can be generated or simulated on -a quantum device: - -- *Chemical simulation* —Extract information about chemical structures and - dynamics with potential applications to material science, computational - chemistry, computational biology, and drug discovery. -- *Quantum matter simulation* —Model and design high temperature - superconductivity or other exotic states of matter which exhibits many-body - quantum effects. -- *Quantum control* —Hybrid quantum-classical models can be variationally - trained to perform optimal open or closed-loop control, calibration, and error - mitigation. This includes error detection and correction strategies for - quantum devices and quantum processors. -- *Quantum communication networks* —Use machine learning to discriminate among - non-orthogonal quantum states, with application to design and construction of - structured quantum repeaters, quantum receivers, and purification units. -- *Quantum metrology* —Quantum-enhanced high precision measurements such as - quantum sensing and quantum imaging are inherently done on probes that are - small-scale quantum devices and could be designed or improved by variational - quantum models. - -### Hybrid quantum-classical models - -A quantum model can represent and generalize data with a quantum mechanical -origin. Because near-term quantum processors are still fairly small and noisy, -quantum models cannot generalize quantum data using quantum processors alone. -NISQ processors must work in concert with classical co-processors to become -effective. Since TensorFlow already supports heterogeneous computing across -CPUs, GPUs, and TPUs, it is used as the base platform to experiment with hybrid -quantum-classical algorithms. - -A *quantum neural network* (QNN) is used to describe a parameterized quantum -computational model that is best executed on a quantum computer. This term is -often interchangeable with *parameterized quantum circuit* (PQC). - -#### Saving models - -Note: `model.save()` does not work for TensorFlow Quantum models containing -custom quantum layers, because full model serialization requires the layer -to be reconstructable without the original Python code. Instead, use -`model.save_weights()` to save the trained parameters, then rebuild the model -architecture in Python and restore them with `model.load_weights()`. - - -## Research - -During the NISQ-era, quantum algorithms with known speedups over classical -algorithms—like -Shor's factoring algorithm or -Grover's search algorithm—are -not yet possible at a meaningful scale. - -A goal of TensorFlow Quantum is to help discover algorithms for the NISQ-era, -with particular interest in: - -1. *Use classical machine learning to enhance NISQ algorithms.* The hope is that - techniques from classical machine learning can enhance our understanding of - quantum computing. In - meta-learning for quantum neural networks via classical recurrent neural networks, - a recurrent neural network (RNN) is used to discover that optimization of - the control parameters for algorithms like the QAOA and VQE are more efficient - than simple off the shelf optimizers. And - machine learning for quantum control - uses reinforcement learning to help mitigate errors and produce higher - quality quantum gates. -2. *Model quantum data with quantum circuits.* Classically modeling quantum data - is possible if you have an exact description of the datasource—but sometimes - this isn't possible. To solve this problem, you can try modeling on the - quantum computer itself and measure/observe the important statistics. - Quantum convolutional neural networks - shows a quantum circuit designed with a structure analogous to a - convolutional neural network (CNN) to detect different topological phases of - matter. The quantum computer holds the data and the model. The classical - processor sees only measurement samples from the model output and never the - data itself. In - Robust entanglement renormalization on a noisy quantum computer, - the authors learn to compress information about quantum many-body systems - using a DMERA model. - -Other areas of interest in quantum machine learning include: - -* Modeling purely classical data on quantum computers. -* Quantum-inspired classical algorithms. -* Supervised learning with quantum classifiers. -* Adaptive layer-wise learning for quantum neural network. -* Quantum dynamics learning. -* Generative modeling of mixed quantum states . -* Classification with quantum neural networks on near term processors. From 0173e67115bb606c5383a7a38cdb53f612308cfc Mon Sep 17 00:00:00 2001 From: Akhil Gupta Date: Mon, 12 Oct 2026 11:55:02 -0700 Subject: [PATCH 5/5] Rename quantum-concepts-fixed.md to concepts.md --- docs/{quantum-concepts-fixed.md => concepts.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{quantum-concepts-fixed.md => concepts.md} (100%) diff --git a/docs/quantum-concepts-fixed.md b/docs/concepts.md similarity index 100% rename from docs/quantum-concepts-fixed.md rename to docs/concepts.md