Internal:Quantum Machine Learning: Difference between revisions
| (30 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= Quantum convolutional neural networks for high energy physics data analysis = | = Progress = | ||
== March 21, 2023 == | |||
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC's which then feed data to a classical NN to attain results. Others use a method more in line with Cirq where the input parameters are fed into a classical NN which then produces the parameters required for the VQC. This seems almost redundant UNLESS the input data is so large that classification via classical CNN is so computationally expensive that a regular NN plus VQC is somehow "cheaper". I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project: | |||
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before. | |||
2. The product of 1. must have some utility | |||
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems: | |||
* The 36x112 feature particle data is too large to use any pauli mapping so we are reliant on a 12 qubit amplitude encoding circuit. This circuit trains extremely slow even with the use of GPU's. Optimizations need to be discovered in order to make progress with this area. With that being said, for small sample sizes we achieve good results (+90%). | |||
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below. | |||
There exists a few solutions to the 36x112 feature problem number: | |||
* We can interpolate the data to smaller amplitude encoded circuits such as 8 qubits. Doing so achieves respectable results (+80% accuracy) for smaller datasets (under 1000 samples). For larger datasets training time is drastically increased and progress towards a minimum is slowed and we are back to the first problem again. | |||
* We find ways of optimizing the circuits for training. Qiskit allegedly has several "fast" sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly. | |||
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility: | |||
* We can optimize training the Qiskit circuits. There are other ways to produce the required results. | |||
** Seen here[https://qiskit.org/documentation/tutorials/simulators/7_matrix_product_state_method.html] a 50 qubit EPR state is sampled in 0.1 seconds. There are fast sampling methods built in. If these can be sent to the optimizer as a Quantum_Instance (in the same way we use the GPU) then I can simulate a wide variety of large circuits very quickly. This will allow for a more "pure" QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!). | |||
* The dissertation written by Jonas Landman from University of Paris proposes intersting QNN architectures such as the NISQ algorithm for Orthogonal Neural Networks. This uses a connected series of quantum VQC's which replicate a classical neural network. Using this architecture could very well provide real results on the 6 feature data (or interpolated 36x112 feature). | |||
* Much like a combination of Jonas Landman and the Brookhaven paper, I could construct my own series of Quantum circuits which act as a distributed Neural network. A layer of circuits produce an output which are then fed into the next layer of circuits. In this case, the circuits act as both the Nodes and carry the weights in a classical sense. This gives far more parameters to work with using "less" qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it's own qubit even for the 36x112 feature data. +4,000 qubits won't be an issue if they're broken up into sufficiently small circuits with distributed calculations. | |||
== March 27, 2023 == | |||
From last week, two major problems are solved: | |||
1. The 6 feature data will not produce reasonable results (possibly due to the loss of locality?). However, the 4032 feature data can be resized using: | |||
cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA) | |||
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA | |||
This allows for resizing of the image to fit some n number of pixels without loosing any of the data points to full degredation (all 0 pixel values). This resizing will allow for the training of networks using pauli feature mapping (because cv2.INTER_AREA preserves some of the locality?). This not only greatly decreases training times and quickens convergence, but also increases the accuracy of result. | |||
2. The GPU implementation only requires a few lines of code to be optimized: | |||
try: | |||
simulator_gpu = Aer.get_backend('aer_simulator') | |||
simulator_gpu.set_options(device='GPU', precision='single') | |||
except AerError as e: | |||
print('GPU Err:\n',e) | |||
Take note that for certain feature mapping and ansatz implementations the GPU may be slower than a CPU if an insufficient number of qubits is used. | |||
Using the following we are able to produce a very rudimentary VQC with two parts; a feature mapping and ansatz. Using everything we learned we can achieve an accuracy of +98% for previously unseen testing data in 30 iterations, training time under 2 minutes, 0.01% of the data used for training. This is done with n number of qubits/features to be 6 or 8. | |||
So far, there is no need for a complex distributed network, hybridization, or complex QCNN classification models. The following goal is to either discover or create a more "complete" ansatz which can cover as much of the hilbert space as possible. Doing so should bump us up to +99% with a mere few minutes of training time | |||
== March 31, 2023 == | |||
Heavily influenced by REfs. [1, 2, 3] as well as Jonas Landman, we can create a distributed Quantum Neural Network for particle classification. The image below, from Ref. [1], can be thought of a two layer QNN. | |||
[[File:Scalable_qnn.png|600px]] | |||
=== Encoding === | |||
The first layer is encoded directly using the data sample. That encoding will be done with either the Qiskit Pauli feature mappings or the ones used in Ref. [3] (arctan mapping). In the subsequent layers, the inputs will be the Pauli Z expectation from the previous layers individual circuit. Example, Feature extractor 1 from the image above will yield some value [-1, 1]. That value will be input into the first qubit of the "Predictor" in the second layer. Likewise, the value yielded from feature extractor 4 will be input into the last qubit of the predictor. So we know that our predictor will be 4 qubits wide. The expectation value calculations come directly from Ref. [2] and are easily implemented in qiskit. | |||
=== VQC's === | |||
Every VQC in each layer, U(θ), will be an independent ansatz with parameters p[0], p[1]... p[n]. Note, a back propagation algorithm could be relatively simple to implement since each layer of the network can be represented by a parameterized weight matrix. For layer 1 in the image we have: | |||
p_1[0] p_1[1]... p_1[n] | |||
p_2[0] p_2[1]... p_2[n] | |||
p_3[0] p_3[1]... p_3[n] | |||
p_4[0] p_4[1]... p_4[n] | |||
And for the predictor layer we will have only one row of parameters since there is only one circuit: | |||
p_pre[0] p_pre[1]... p_pre[n] | |||
Note the reduction in dimensionality between the two layers. Also note that this is NOT a fully connected QCNN. Moving to that model should not be too difficult depending on the results gained from this experiment. This could be implemented by the techniques described in Landman's dissertation. | |||
=== Classical Device === | |||
Upon measurement of the predictor we have our classification again as a value of [-1, 1]. From here, we implement a loss function and back propagation algorithm on our parameter matrices. | |||
== April 9, 2023 == | |||
[[File:FCQNN_diagram.png|1500px]] | |||
A Fully Connected Quantum Neural Network can be seen above. The closes approximation to this that I can find in the current literature is found here [https://link.springer.com/article/10.1007/s42484-021-00046-w] (see Ref. 8). They use amplitude encoded circuits for the MNIST dataset where the ansatz used look like circularly entangled pauli two design gates. The main mechanics of a forward pass are shown in the diagram. The encoding portions of the circuits, F(X), act as the analogous neurons while the VQC's, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks. | |||
Things to consider/progress to be made: | |||
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet. | |||
2. Outside of a few "toy" example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare. | |||
3. Nobody has utilized this architecture in a distributive manner. | |||
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements. | |||
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true. | |||
If this works out then my goals stated here[https://crtc.cs.odu.edu/Internal:Quantum_Machine_Learning#March_21.2C_2023] will be achieved. | |||
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before. | |||
2. The network has real utility in the future. | |||
= Code : = | |||
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&view=0] | |||
= Literature : Quantum Classifiers = | |||
== [1] Scalable Quantum Neural Networks for Classification == | |||
Jindi Wu, Zeyi Tao, Qun Li | |||
https://arxiv.org/abs/2208.07719 | |||
Relies on a hybrid classical-quantum architecture. Each subdomain has the following: | |||
1. Encoding Unit | |||
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations | |||
* Amplitude encoding not used due to error rate and difficulty in computing gradients | |||
2. VQC | |||
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit | |||
3. Measurement | |||
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1] | |||
4. The measurement of the sub domain is then encoded into a qubit in the next layer. | |||
Seemingly, this process combines both convolutional and pooling layers in the same way that Iris Cong et al. performs calculations. Advantageous over the qiskit implementation in that the "pooling layers" are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel. | |||
== [2] Quantum convolutional neural networks == | |||
Iris Cong et al., Nature Physics | |||
https://doi.org/10.1038/s41567-019-0648-8 | |||
N qubit input requires O(log(N)) variational parameters. "This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier..." hopefully leading to faster training times? | |||
== [3] Quantum convolutional neural networks for high energy physics data analysis == | |||
Chen et al., Brookhaven National Labs | |||
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231 | https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231 | ||
The (SIMULATED) QCNN follows the following protocol: | The (SIMULATED) QCNN follows the following protocol: | ||
1. Amplitude | 1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer. | ||
2. A VQC acts as a convolutional layer. Convolutional outputs are calculated via the expectation value of the Pauli-Z operator acting on the first qubit. | 2. A VQC acts as a convolutional layer. Convolutional outputs are calculated via the expectation value of the Pauli-Z operator acting on the first qubit. | ||
| Line 16: | Line 166: | ||
We can implement this "by hand" in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device='GPU'). This is considerable because it may be a faster process than available public access QML methods. | We can implement this "by hand" in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device='GPU'). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods. | ||
== [4] Quantum machine learning for particle physics using a variational quantum classifier == | |||
Andrew Blancea and Michael Spannowsky | |||
https://link.springer.com/article/10.1007/JHEP02(2021)212 | |||
This method follows the same methodology as many others. | |||
1. Angle Encoding the data | |||
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits | |||
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically | |||
Rudimentary introduction to QNN classification. | |||
== [5] Challenges and opportunities in quantum machine learning for high-energy physics == | |||
Sau Lan Wu and Shinjae Yoo2 | |||
https://www.nature.com/articles/s42254-022-00425-7 | |||
"Overall, the greatest challenge in using quantum computer hardware for machine learning at present... is the size of the event samples and the effective use of large num- bers of qubits... analyses will need to manage large event sample size and large data dimensionality... | |||
... advanced quantum computers with large numbers of qubits, reduced noise and improved running time may outperform classical machine learn- ing in both classification power and in speed. QML may well be a new computational paradigm for big data analyses in HEP. For this reason, the HEP community should stay aware of what is happening in quantum technologies — improvements in the hardware, software ecosystem and algorithms — to bring a quantum advan- tage to the HEP data challenge. Conversely, the develop- ment of solutions for unique HEP data challenges could also lead to contributions to the development of quantum technologies." | |||
== [6] Quantum machine learning in high energy physics == | |||
Guan et al. | |||
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf | |||
Uses adiabatic quantum annealing as an optimizer. This methodology also uses angle encoding for particle track data, a general VQC, with different optimizers such as ADAM and COBYLA. | |||
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules == | |||
Xia, R.; Kais, S. Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules. Entropy 2020, 22, 828. https://arxiv.org/pdf/1912.06184.pdf | |||
Although the problem set is not what we are looking for (to find a hamiltonian for potential energy curves) the architecture of this type of QNN can be used to create a fully connected QNN. We cans say that for the image in Ref. [1], each qubit from each circuit in the first layer is measured (the expectation value calculated) independently, we now have a value to pass to the next layer of circuits. I.E. if we have a two qubit circuit, that circuit will yield two expectation values meaning we can pass two different values to two different circuit in the next layer. The first circuit layer has some x number of qubits per circuit, we will have x number of circuits in the next layer. | |||
== [8] QDNN: deep neural networks with quantum layers == | |||
Zhao, C., Gao, XS. QDNN: deep neural networks with quantum layers. Quantum Mach. Intell. 3, 15 (2021). https://doi.org/10.1007/s42484-021-00046-w | |||
What distinguishes this model from others is that it utilizes non-linear activation functions within the quantum network. Just as well, it uses a very simple and effective gradient descent method to adjust the parameters of the network. | |||
== [9] Precise Image Generation on Current Noisy Quantum Devices == | |||
At first glance from the abstract it seems to reproduce angle encoding VQC results for HEP data. We already have practical use cases from prior experience with this so no need to further sell me on the idea. HOWEVER, it seems to be a comprehensive study on the topic of angle encoding specifically for HEP data on real NISQ hardware. The extra information can be invaluable to our future work. | |||
Stored in the OneDrive here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2F604198%2Epdf&parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers]. | |||
== [10] Application of quantum computing techniques in particle tracking at LHC == | |||
Slides found here[https://indico.jlab.org/event/459/contributions/11836/attachments/9331/13532/20230509_CHEP_v2.pdf]. | |||
The main difference between this model and those which were previously studied seems to be the use of a quantum annealer as opposed to a quantum computer. To my understanding, annealers work by initializing a quantum superposition with equal weights. From there, it evolves via the time-dependent Schrodinger equation slowly allowing itself to exist in the ground state of some transverse field ising model. Effectively, this is the ground state hamiltonian for the system. That hamiltonian represents the global minimum of some objective function. I need to read much further into this at some point to ensure this is all correct. | |||
To summarize, this conference presentation utilizes a form of quantum computation which is specific to a particular system of quantum superpositions. The methodology of quantum computing we have been working with is more akin to a "general" quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities. | |||
== [11] First Measurements With A Quantum Vision Transformer: A Naive Approach == | |||
Cannot find a publication for this one. It seems that this [https://indico.jlab.org/event/459/contributions/11832/] will be the first introduction to this research. | |||
Awaiting the presentation... | |||
== [12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination == | |||
Full publication found here[http://kth.diva-portal.org/smash/get/diva2:1718318/FULLTEXT02.pdf]. | |||
This seems to be a more robust classification model in that it explicitly describes quantum advantage over classical in terms of ML. The full pub is over 90 pages so it will take some time to parse through. But if what they say in the abstract is true then their expressions of HEP data in hilbert space will be extremely important. QML advantage over classical ML seems to be relatively rare... | |||
== [13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines == | |||
Full publication is found here[https://www.researchgate.net/publication/363765523_Hybrid_actor-critic_algorithm_for_quantum_reinforcement_learning_at_CERN_beam_lines]. This ML model utilizes annealing and something called a Quantum Boltzman Machine [https://arxiv.org/pdf/1601.02036.pdf]. I have little to no experience with both of these so I will update this once I complete my readings and formulate a better image of these methods. | |||
== [14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction == | |||
Slides found here[https://indico.jlab.org/event/459/contributions/11837/attachments/9417/13658/chep23.pdf]. | |||
As a hybrid model this is something I am trying to avoid for my own project. However, for the convenience of working around unavoidable noise on NISQ hardware the optimizations used for the VQC portion of the network will be of great interest. Awaiting the actual presentation/publication... | |||
== [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics == | |||
No publication or slides as of yet[https://indico.jlab.org/event/459/contributions/11831/]. | |||
Opening sentence of the abstract summarizes my plight the past semester to perfection: | |||
"In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step." | |||
There are self admitted scaling issues for their encoding methodology. However, I am always finding new ways to avoid this with respectable results on some occasions (see March 27, 2023 update above). | |||
Latest revision as of 16:18, 2 August 2023
Progress
March 21, 2023
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC's which then feed data to a classical NN to attain results. Others use a method more in line with Cirq where the input parameters are fed into a classical NN which then produces the parameters required for the VQC. This seems almost redundant UNLESS the input data is so large that classification via classical CNN is so computationally expensive that a regular NN plus VQC is somehow "cheaper". I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.
2. The product of 1. must have some utility
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:
- The 36x112 feature particle data is too large to use any pauli mapping so we are reliant on a 12 qubit amplitude encoding circuit. This circuit trains extremely slow even with the use of GPU's. Optimizations need to be discovered in order to make progress with this area. With that being said, for small sample sizes we achieve good results (+90%).
- The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.
There exists a few solutions to the 36x112 feature problem number:
- We can interpolate the data to smaller amplitude encoded circuits such as 8 qubits. Doing so achieves respectable results (+80% accuracy) for smaller datasets (under 1000 samples). For larger datasets training time is drastically increased and progress towards a minimum is slowed and we are back to the first problem again.
- We find ways of optimizing the circuits for training. Qiskit allegedly has several "fast" sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:
- We can optimize training the Qiskit circuits. There are other ways to produce the required results.
- Seen here[1] a 50 qubit EPR state is sampled in 0.1 seconds. There are fast sampling methods built in. If these can be sent to the optimizer as a Quantum_Instance (in the same way we use the GPU) then I can simulate a wide variety of large circuits very quickly. This will allow for a more "pure" QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).
- The dissertation written by Jonas Landman from University of Paris proposes intersting QNN architectures such as the NISQ algorithm for Orthogonal Neural Networks. This uses a connected series of quantum VQC's which replicate a classical neural network. Using this architecture could very well provide real results on the 6 feature data (or interpolated 36x112 feature).
- Much like a combination of Jonas Landman and the Brookhaven paper, I could construct my own series of Quantum circuits which act as a distributed Neural network. A layer of circuits produce an output which are then fed into the next layer of circuits. In this case, the circuits act as both the Nodes and carry the weights in a classical sense. This gives far more parameters to work with using "less" qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it's own qubit even for the 36x112 feature data. +4,000 qubits won't be an issue if they're broken up into sufficiently small circuits with distributed calculations.
March 27, 2023
From last week, two major problems are solved:
1. The 6 feature data will not produce reasonable results (possibly due to the loss of locality?). However, the 4032 feature data can be resized using:
cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)
See [2] for INTER_AREA
This allows for resizing of the image to fit some n number of pixels without loosing any of the data points to full degredation (all 0 pixel values). This resizing will allow for the training of networks using pauli feature mapping (because cv2.INTER_AREA preserves some of the locality?). This not only greatly decreases training times and quickens convergence, but also increases the accuracy of result.
2. The GPU implementation only requires a few lines of code to be optimized:
try:
simulator_gpu = Aer.get_backend('aer_simulator')
simulator_gpu.set_options(device='GPU', precision='single')
except AerError as e:
print('GPU Err:\n',e)
Take note that for certain feature mapping and ansatz implementations the GPU may be slower than a CPU if an insufficient number of qubits is used.
Using the following we are able to produce a very rudimentary VQC with two parts; a feature mapping and ansatz. Using everything we learned we can achieve an accuracy of +98% for previously unseen testing data in 30 iterations, training time under 2 minutes, 0.01% of the data used for training. This is done with n number of qubits/features to be 6 or 8.
So far, there is no need for a complex distributed network, hybridization, or complex QCNN classification models. The following goal is to either discover or create a more "complete" ansatz which can cover as much of the hilbert space as possible. Doing so should bump us up to +99% with a mere few minutes of training time
March 31, 2023
Heavily influenced by REfs. [1, 2, 3] as well as Jonas Landman, we can create a distributed Quantum Neural Network for particle classification. The image below, from Ref. [1], can be thought of a two layer QNN.
Encoding
The first layer is encoded directly using the data sample. That encoding will be done with either the Qiskit Pauli feature mappings or the ones used in Ref. [3] (arctan mapping). In the subsequent layers, the inputs will be the Pauli Z expectation from the previous layers individual circuit. Example, Feature extractor 1 from the image above will yield some value [-1, 1]. That value will be input into the first qubit of the "Predictor" in the second layer. Likewise, the value yielded from feature extractor 4 will be input into the last qubit of the predictor. So we know that our predictor will be 4 qubits wide. The expectation value calculations come directly from Ref. [2] and are easily implemented in qiskit.
VQC's
Every VQC in each layer, U(θ), will be an independent ansatz with parameters p[0], p[1]... p[n]. Note, a back propagation algorithm could be relatively simple to implement since each layer of the network can be represented by a parameterized weight matrix. For layer 1 in the image we have:
p_1[0] p_1[1]... p_1[n]
p_2[0] p_2[1]... p_2[n]
p_3[0] p_3[1]... p_3[n]
p_4[0] p_4[1]... p_4[n]
And for the predictor layer we will have only one row of parameters since there is only one circuit:
p_pre[0] p_pre[1]... p_pre[n]
Note the reduction in dimensionality between the two layers. Also note that this is NOT a fully connected QCNN. Moving to that model should not be too difficult depending on the results gained from this experiment. This could be implemented by the techniques described in Landman's dissertation.
Classical Device
Upon measurement of the predictor we have our classification again as a value of [-1, 1]. From here, we implement a loss function and back propagation algorithm on our parameter matrices.
April 9, 2023
A Fully Connected Quantum Neural Network can be seen above. The closes approximation to this that I can find in the current literature is found here [3] (see Ref. 8). They use amplitude encoded circuits for the MNIST dataset where the ansatz used look like circularly entangled pauli two design gates. The main mechanics of a forward pass are shown in the diagram. The encoding portions of the circuits, F(X), act as the analogous neurons while the VQC's, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.
Things to consider/progress to be made:
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet. 2. Outside of a few "toy" example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare. 3. Nobody has utilized this architecture in a distributive manner. 4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements. 5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.
If this works out then my goals stated here[4] will be achieved.
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before. 2. The network has real utility in the future.
Code :
Download the notebooks here[5]
Literature : Quantum Classifiers
[1] Scalable Quantum Neural Networks for Classification
Jindi Wu, Zeyi Tao, Qun Li https://arxiv.org/abs/2208.07719
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:
1. Encoding Unit
- Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations
- Amplitude encoding not used due to error rate and difficulty in computing gradients
2. VQC
- They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit
3. Measurement
- Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]
4. The measurement of the sub domain is then encoded into a qubit in the next layer.
Seemingly, this process combines both convolutional and pooling layers in the same way that Iris Cong et al. performs calculations. Advantageous over the qiskit implementation in that the "pooling layers" are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.
[2] Quantum convolutional neural networks
Iris Cong et al., Nature Physics https://doi.org/10.1038/s41567-019-0648-8
N qubit input requires O(log(N)) variational parameters. "This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier..." hopefully leading to faster training times?
[3] Quantum convolutional neural networks for high energy physics data analysis
Chen et al., Brookhaven National Labs https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231
The (SIMULATED) QCNN follows the following protocol:
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.
2. A VQC acts as a convolutional layer. Convolutional outputs are calculated via the expectation value of the Pauli-Z operator acting on the first qubit.
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).
4. Categorical Cross Entropy Loss Function is applied to the final output.
5. Back Prop to adjust the parameters in the VQC's (convolutional layers).
We can implement this "by hand" in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device='GPU'). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.
[4] Quantum machine learning for particle physics using a variational quantum classifier
Andrew Blancea and Michael Spannowsky https://link.springer.com/article/10.1007/JHEP02(2021)212
This method follows the same methodology as many others.
1. Angle Encoding the data 2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits 3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically
Rudimentary introduction to QNN classification.
[5] Challenges and opportunities in quantum machine learning for high-energy physics
Sau Lan Wu and Shinjae Yoo2 https://www.nature.com/articles/s42254-022-00425-7
"Overall, the greatest challenge in using quantum computer hardware for machine learning at present... is the size of the event samples and the effective use of large num- bers of qubits... analyses will need to manage large event sample size and large data dimensionality...
... advanced quantum computers with large numbers of qubits, reduced noise and improved running time may outperform classical machine learn- ing in both classification power and in speed. QML may well be a new computational paradigm for big data analyses in HEP. For this reason, the HEP community should stay aware of what is happening in quantum technologies — improvements in the hardware, software ecosystem and algorithms — to bring a quantum advan- tage to the HEP data challenge. Conversely, the develop- ment of solutions for unique HEP data challenges could also lead to contributions to the development of quantum technologies."
[6] Quantum machine learning in high energy physics
Guan et al. https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf
Uses adiabatic quantum annealing as an optimizer. This methodology also uses angle encoding for particle track data, a general VQC, with different optimizers such as ADAM and COBYLA.
[7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules
Xia, R.; Kais, S. Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules. Entropy 2020, 22, 828. https://arxiv.org/pdf/1912.06184.pdf
Although the problem set is not what we are looking for (to find a hamiltonian for potential energy curves) the architecture of this type of QNN can be used to create a fully connected QNN. We cans say that for the image in Ref. [1], each qubit from each circuit in the first layer is measured (the expectation value calculated) independently, we now have a value to pass to the next layer of circuits. I.E. if we have a two qubit circuit, that circuit will yield two expectation values meaning we can pass two different values to two different circuit in the next layer. The first circuit layer has some x number of qubits per circuit, we will have x number of circuits in the next layer.
[8] QDNN: deep neural networks with quantum layers
Zhao, C., Gao, XS. QDNN: deep neural networks with quantum layers. Quantum Mach. Intell. 3, 15 (2021). https://doi.org/10.1007/s42484-021-00046-w
What distinguishes this model from others is that it utilizes non-linear activation functions within the quantum network. Just as well, it uses a very simple and effective gradient descent method to adjust the parameters of the network.
[9] Precise Image Generation on Current Noisy Quantum Devices
At first glance from the abstract it seems to reproduce angle encoding VQC results for HEP data. We already have practical use cases from prior experience with this so no need to further sell me on the idea. HOWEVER, it seems to be a comprehensive study on the topic of angle encoding specifically for HEP data on real NISQ hardware. The extra information can be invaluable to our future work.
Stored in the OneDrive here[6].
[10] Application of quantum computing techniques in particle tracking at LHC
Slides found here[7].
The main difference between this model and those which were previously studied seems to be the use of a quantum annealer as opposed to a quantum computer. To my understanding, annealers work by initializing a quantum superposition with equal weights. From there, it evolves via the time-dependent Schrodinger equation slowly allowing itself to exist in the ground state of some transverse field ising model. Effectively, this is the ground state hamiltonian for the system. That hamiltonian represents the global minimum of some objective function. I need to read much further into this at some point to ensure this is all correct.
To summarize, this conference presentation utilizes a form of quantum computation which is specific to a particular system of quantum superpositions. The methodology of quantum computing we have been working with is more akin to a "general" quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities.
[11] First Measurements With A Quantum Vision Transformer: A Naive Approach
Cannot find a publication for this one. It seems that this [8] will be the first introduction to this research.
Awaiting the presentation...
[12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination
Full publication found here[9].
This seems to be a more robust classification model in that it explicitly describes quantum advantage over classical in terms of ML. The full pub is over 90 pages so it will take some time to parse through. But if what they say in the abstract is true then their expressions of HEP data in hilbert space will be extremely important. QML advantage over classical ML seems to be relatively rare...
[13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines
Full publication is found here[10]. This ML model utilizes annealing and something called a Quantum Boltzman Machine [11]. I have little to no experience with both of these so I will update this once I complete my readings and formulate a better image of these methods.
[14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction
Slides found here[12].
As a hybrid model this is something I am trying to avoid for my own project. However, for the convenience of working around unavoidable noise on NISQ hardware the optimizations used for the VQC portion of the network will be of great interest. Awaiting the actual presentation/publication...
[15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics
No publication or slides as of yet[13].
Opening sentence of the abstract summarizes my plight the past semester to perfection:
"In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step."
There are self admitted scaling issues for their encoding methodology. However, I am always finding new ways to avoid this with respectable results on some occasions (see March 27, 2023 update above).