- Notifications
You must be signed in to change notification settings - Fork 214
Demo: Generative quantum advantage [WIP] #1567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
Your preview is ready 🎉!You can view your changes here |
*Theorem 1 (Informal: Classically hard, quantumly easy generative models). Under standard | ||
complexity-theoretic conjectures, there exist distributions p(y|x) mapping classical n-bit strings | ||
to m-bit strings that a quantum computer can efficiently learn to generate using classical data | ||
samples, but are hard to generate with classical computers.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! what do you think about changing the format for these special boxes to something like the .. admonition::
class note? (see the green boxes in Maria's demo ) Let me know and if so, I can implement the change.
but also to be able to learn it efficiently from data, and they investigate a specific scenario in | ||
which this is possible. | ||
| ||
In this demo we will unpack one of the main results of the paper to understand its core mechanics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of their paper, that paper, Huang's paper ...any of those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, just wondering if you might wanna cite the paper several times during the demo. Maybe not for this case, but there is another instance "(see Appendix H2 of the paper)" where it might be helpful.
to m-bit strings that a quantum computer can efficiently learn to generate using classical data | ||
samples, but are hard to generate with classical computers.* | ||
| ||
To show the above, we need to do a couple of things |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To show the above, we need to do a couple of things | |
To show the above, we need to do a couple of things: |
To show the above, we need to do a couple of things | ||
| ||
- Identify a classically ‘hard’ conditional distribution p(y|x) that corresponds to a family of | ||
quantum circuits. For this we can leverage some existing results about the hardness of sampling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quantum circuits. For this we can leverage some existing results about the hardness of sampling. | |
quantum circuits. For this, we can leverage some existing results about the hardness of sampling. |
# Instantaneously deep quantum neural networks, or IDQNNs, are a particular type of shallow | ||
# parameterized quantum circuit. The qubits of the circuit live on a lattice, which we’ll take to be a | ||
# 2D lattice, and index the qubits by their lattice positions :math:`(i,j)`. To sample from the | ||
# circuit one does the following, which we also depict below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# circuit one does the following, which we also depict below | |
# circuit one does the following, which we also depict below. |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# 1. Prepare each qubit on the lattice in the :math:`\ket{+}` state. | ||
# 2. Entangle the qubits by performing controlled-Z gates between some pairs of nearest neighbour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 2. Entangle the qubits by performing controlled-Z gates between some pairs of nearest neighbour | |
# 2. Entangle the qubits by performing controlled-Z gates between some pairs of nearest-neighbour |
# 2. Entangle the qubits by performing controlled-Z gates between some pairs of nearest neighbour | ||
# qubits on the lattice. If the qubits are horizontal neighbours on the lattice, a CZ is always | ||
# applied. | ||
# 3. Perform a single qubit Z rotation :math:`U_{z}(\theta_{ij})=\exp(-\frac{i}{2}\theta_{ij}Z)` with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the phrase "single qubit Z rotation" should have a hyphen somewhere haha just don't know where:
single-qubit Z rotation
# | ||
# Note that this is not a circuit diagram, but a graphical representation of the circuit description | ||
# above: qubits are denoted by black dots, CZ gates are lines between dots, the angles specify the | ||
# single qubit rotations, and the blue :math:`y_{ij}` are the X-measurement outcomes. We’ll also use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# single qubit rotations, and the blue :math:`y_{ij}` are the X-measurement outcomes. We’ll also use | |
# single-qubit rotations, and the blue :math:`y_{ij}` are the X-measurement outcomes. We’ll also use |
# qubit counts on quantum hardware are still limited, so that by implementing the deep 1D circuit on a | ||
# few qubits, you can simulate the distribution of a 2D shallow circuit on many more qubits. The | ||
# authors used this trick to simulate a shallow IDQNN circuit on 816 qubits using a deep circuit with | ||
# 68 qubits. To do this they actually work with a deep circuit on a 2D lattice, and map it to a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 68 qubits. To do this they actually work with a deep circuit on a 2D lattice, and map it to a | |
# 68 qubits. To do this, they actually work with a deep circuit on a 2D lattice, and map it to a |
# ----------------------------- | ||
# | ||
# It turns out that—if we remove the classically controlled Z gates for now—the circuit structure of | ||
# the deep circuit above is universal. That is, any :math:`n` qubit circuit with two qubit gates can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# the deep circuit above is universal. That is, any :math:`n` qubit circuit with two qubit gates can | |
# the deep circuit above is universal. That is, any :math:`n`-qubit circuit with two qubit gates can |
# | ||
# It turns out that—if we remove the classically controlled Z gates for now—the circuit structure of | ||
# the deep circuit above is universal. That is, any :math:`n` qubit circuit with two qubit gates can | ||
# be efficiently approximated by sequential layers of Hadamards, Z rotations and controlled Z gates on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# be efficiently approximated by sequential layers of Hadamards, Z rotations and controlled Z gates on | |
# be efficiently approximated by sequential layers of Hadamards, Z rotations and controlled-Z gates on |
# an :math:`n` qubit computational basis input. We can therefore use this fact to define a circuit | ||
# that is hard to sample from classically; simply take your favourite pre-existing hardness results | ||
# for sampling (for example, [#sample]_) and compile the circuit to the H, RZ, CZ gateset. We can then embed this | ||
# into the precise structure we had above by inserting the classically controlled Z gates at every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# into the precise structure we had above by inserting the classically controlled Z gates at every | |
# into the precise structure we had above by inserting the classically controlled-Z gates at every |
# that is hard to sample from classically; simply take your favourite pre-existing hardness results | ||
# for sampling (for example, [#sample]_) and compile the circuit to the H, RZ, CZ gateset. We can then embed this | ||
# into the precise structure we had above by inserting the classically controlled Z gates at every | ||
# layer. If we happen to sample the all zero bitstring for :math:`y_{ij}` values that control these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# layer. If we happen to sample the all zero bitstring for :math:`y_{ij}` values that control these | |
# layer. If we happen to sample the all-zero bitstring for :math:`y_{ij}` values that control these |
# Adding inputs states | ||
# -------------------- | ||
# | ||
# At this point we have a shallow circuit called an IDQNN, a way to map it to a deep circuit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# At this point we have a shallow circuit called an IDQNN, a way to map it to a deep circuit | |
# At this point, we have a shallow circuit called an IDQNN, a way to map it to a deep circuit |
# | ||
# 1. Prepare each qubit in either the :math:`\vert + \rangle` or :math:`\vert - \rangle` state, depending on | ||
# :math:`x`. | ||
# 2. Perform steps 2-4 as before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 2. Perform steps 2-4 as before | |
# 2. Perform steps 2-4 as before. |
# In order to be able to prove the result, the choice and distribution of possible input states must | ||
# satisfy a particular property called ‘local decoupling’ (see Appendix C2 of the paper). One | ||
# particularly simple choice that will work for our 2D IDQNN is the following choice of three inputs, | ||
# :math:`x=0,1,2` (in the paper a different choice is used, but the result will be the same) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# :math:`x=0,1,2` (in the paper a different choice is used, but the result will be the same) | |
# :math:`x=0,1,2` (in the paper a different choice is used, but the result will be the same). |
# 2. Perform steps 2-4 as before | ||
# | ||
# In order to be able to prove the result, the choice and distribution of possible input states must | ||
# satisfy a particular property called ‘local decoupling’ (see Appendix C2 of the paper). One |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and yeah, maybe it is easier for the reader to cite the paper other times so then can click in the hyperlink and don't have to go looking for it.
# If :math:`x=0` all input qubits are prepared in the :math:`\vert + \rangle` state If :math:`x=1` all | ||
# qubits on the ‘even diagonals’ of the lattice are prepared in :math:`\vert + \rangle`, the remaining | ||
# are prepared in :math:`\vert 0 \rangle` If :math:`x=2` all qubits on the ‘odd diagonals’ of the lattice | ||
# are prepared in :math:`\vert + \rangle`, the remaining are prepared in :math:`\vert 0 \rangle` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# If :math:`x=0` all input qubits are prepared in the :math:`\vert + \rangle` state If :math:`x=1` all | |
# qubits on the ‘even diagonals’ of the lattice are prepared in :math:`\vert + \rangle`, the remaining | |
# are prepared in :math:`\vert 0 \rangle` If :math:`x=2` all qubits on the ‘odd diagonals’ of the lattice | |
# are prepared in :math:`\vert + \rangle`, the remaining are prepared in :math:`\vert 0 \rangle` | |
# If :math:`x=0`, all input qubits are prepared in the :math:`\vert + \rangle` state. If :math:`x=1`, all | |
# qubits on the ‘even diagonals’ of the lattice are prepared in :math:`\vert + \rangle`, the remaining | |
# are prepared in :math:`\vert 0 \rangle`. If :math:`x=2`, all qubits on the ‘odd diagonals’ of the lattice | |
# are prepared in :math:`\vert + \rangle`, the remaining are prepared in :math:`\vert 0 \rangle`. |
# be written | ||
# | ||
# .. math:: CZ = \vert 0 \rangle\langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle\langle 1 \vert \otimes Z = \mathbb{I} \otimes \vert 0 \rangle\langle 0 \vert + Z \otimes \vert 1 \rangle\langle 1 \vert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# be written | |
# | |
# .. math:: CZ = \vert 0 \rangle\langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle\langle 1 \vert \otimes Z = \mathbb{I} \otimes \vert 0 \rangle\langle 0 \vert + Z \otimes \vert 1 \rangle\langle 1 \vert | |
# be written as | |
# | |
# .. math:: CZ = \vert 0 \rangle\langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle\langle 1 \vert \otimes Z = \mathbb{I} \otimes \vert 0 \rangle\langle 0 \vert + Z \otimes \vert 1 \rangle\langle 1 \vert. |
# | ||
# The authors argue that the conditional distribution :math:`p(\boldsymbol{y}|x)` should also be | ||
# considered hard to sample from classically, since for the input :math:`x=0` we can use the argument | ||
# of the previous section. For the inputs :math:`x=1` and :math:`x=2` however the resulting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# of the previous section. For the inputs :math:`x=1` and :math:`x=2` however the resulting | |
# of the previous section. For the inputs :math:`x=1` and :math:`x=2`, however, the resulting |
# quantum circuits that produce the data, except for the rotation angles :math:`\theta_{ij}` | ||
# (i.e. this is included in the \`prior knowledge’ of the problem). To learn, we therefore just need | ||
# to infer the parameters :math:`\theta_{ij}` from the data, which will allow us to generate new data by | ||
# simply implementing the resulting circuits. This is very different from real world problems the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# simply implementing the resulting circuits. This is very different from real world problems the | |
# simply implementing the resulting circuits. This is very different from real world problems, the |
# | ||
# So how do we infer the parameters :math:`\theta_{ij}` from data? Consider for example the data for | ||
# input :math:`x=1`, and the outcome :math:`y_{12}`. From the above circuit we see that in this case the | ||
# outcome is produced by this single qubit circuit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# outcome is produced by this single qubit circuit | |
# outcome is produced by this single qubit circuit: |
# :math:`\theta_{12} = \frac{1}{2} \arccos(1 - 2\langle y_{12} \rangle)`. | ||
# | ||
# All we have to do to infer :math:`\theta_{12}` is to look at the data for :math:`x=1`, estimate the | ||
# expectation :math:`\langle y_{12} \rangle` from the corresponding :math:`y_12` values, and use the above formula; no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# expectation :math:`\langle y_{12} \rangle` from the corresponding :math:`y_12` values, and use the above formula; no | |
# expectation :math:`\langle y_{12} \rangle` from the corresponding :math:`y_{12}` values, and use the above formula; no |
# :math:`p(\boldsymbol{y})`. Suppose we want to learn the parameters :math:`\theta` from data. To do | ||
# this we construct a conditional distribution :math:`p(\boldsymbol{y}|x)` which does the following: | ||
# | ||
# - For :math:`x=0` the model samples the generative model distribution :math:`p(\boldsymbol{y})` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# - For :math:`x=0` the model samples the generative model distribution :math:`p(\boldsymbol{y})` | |
# - For :math:`x=0`, the model samples the generative model distribution :math:`p(\boldsymbol{y})` |
# neural networks. We note that the specific example in the paper is more involved than this, and uses | ||
# a higher dimensional lattice and a different set of inputs, but the strategy is the same: for each | ||
# parameter, there is a reasonable fraction of the inputs that leaves the relevant qubit unentangled | ||
# from the rest, and single qubit statistics reveals the desired value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# from the rest, and single qubit statistics reveals the desired value. | |
# from the rest, and single-qubit statistics reveals the desired value. |
# 2. Run the above circuit, controlling the Z gates on these bits. 3. Measure the | ||
# output of the circuit to obtain the final three bits :math:`y_{41}`, :math:`y_{42}`, :math:`y_{43}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 2. Run the above circuit, controlling the Z gates on these bits. 3. Measure the | |
# output of the circuit to obtain the final three bits :math:`y_{41}`, :math:`y_{42}`, :math:`y_{43}` | |
# 2. Run the above circuit, controlling the Z gates on these bits. | |
# 3. Measure the output of the circuit to obtain the final three bits :math:`y_{41}`, :math:`y_{42}`, :math:`y_{43}`. |
| ||
In this demo we will unpack one of the main results of the paper to understand its core mechanics. | ||
We will see that the problem is constructed so that learning the hard distribution boils down to | ||
performing single qubit tomography, and we will debate the scope of this technique in relation to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
performing single qubit tomography, and we will debate the scope of this technique in relation to | |
performing single qubit tomography, and we will discuss the scope of this technique in relation to |
Demo: Generative quantum advantage for classical and quantum problems:
Summary:
This is a new demo for this paper: https://arxiv.org/abs/2509.09033
It is a quantum machine learning paper. The demo is rather critical, since the main aim of the demo is to draw attention to the fact that their approach is in a sense 'cheating' given the common understanding of the term 'learning' in ML, and that the assumptions they use are not at all common in real-world ML.
The text is hopefully fairly low on sass however. I have tried to be as matter of fact as possible whilst still calling them out where necessary. The most opinionated section is the last, where I try to convince the reader that what they do is not ultimately useful for QML.
Relevant references:
https://arxiv.org/abs/2509.09033
Possible Drawbacks:
Related GitHub Issues:
GOALS — Why are we working on this now?
This paper was released recently by Google/Caltech and has and will get a lot of attention as an important result in the field. Publishing a critical demo like this is part of our 'thought leader' mission.
AUDIENCE — Who is this for?
PhD+ researchers in quantum computing.
quantum machine learning
generative AI
complexity
Which of the following types of documentation is most similar to your file?
(more details here)