<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://crtc.cs.odu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ebillias</id>
	<title>crtc.cs.odu.edu - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://crtc.cs.odu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ebillias"/>
	<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/Special:Contributions/Ebillias"/>
	<updated>2026-10-25T15:35:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.6</generator>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Hybrid_Computing&amp;diff=9313</id>
		<title>Internal:Hybrid Computing</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Hybrid_Computing&amp;diff=9313"/>
		<updated>2024-09-10T21:01:12Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Distributed Noisy Intermediate-Scale Quantum Computers (D-NISQ) =&lt;br /&gt;
&lt;br /&gt;
The D-NISQ model presented by [1] describes a hierarchical architecture of hybrid classical/quantum processors to break up large computations into smaller sub problems. Resource management of limited qubits and noisy quantum computation make domain decomposition a necessary method to practically use many quantum algorithms. The D-NISQ model has four layers. Consider the application to Quantum Hadamard Edge Detection[2] qHED:&lt;br /&gt;
&lt;br /&gt;
=== Decomposition Layer ===&lt;br /&gt;
&lt;br /&gt;
The first layer is performed classically. Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Figure 1 Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Classical to Quantum Layer ===&lt;br /&gt;
&lt;br /&gt;
The second layer performs a mapping of classical input data to quantum. In this case, we wish to encode the pixel values into the amplitudes of basis states where those basis states act as the pixels position in 1D space[3]. The circuit is constructed classically (mathematically determining a series of gates which will produce the highest probable desired output) with the actual execution performed on the newly constructed quantum circuit itself.&lt;br /&gt;
&lt;br /&gt;
=== Quantum Computation Layer ===&lt;br /&gt;
&lt;br /&gt;
The states created in the second layer now act as the input to the quantum algorithm itself. If carried out in parallel, each quantum device will execute their respective inputs across the qHED circuit. If performed iteratively, the quantum devices will have to be reset after each execution.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quantum Information Fusion ===&lt;br /&gt;
&lt;br /&gt;
The D-NISQ model considers the measurement portion of the circuit as the first part of the quantum information layer. Multiple measurements of output states are collected to develop a probability distribution for each sub problem. That probability distribution is mapped as a solution to the respective sub problem. In the case of qHED, the probability amplitudes (pixel values) of basis states (pixels mapped to 1D space) represent the image edge values. In this case, a reverse mapping of 1D to 2D is required. From there, the sub problems are recombined into the final result.&lt;br /&gt;
&lt;br /&gt;
= Quantum Utility Scale Repository =&lt;br /&gt;
https://github.com/ebill007/Quantum-Utility-Scale&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Software&amp;diff=9312</id>
		<title>Software</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Software&amp;diff=9312"/>
		<updated>2024-09-10T21:00:55Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Utility Scale */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CRTC I2M Software Suite= &lt;br /&gt;
[[CRTC_I2M]]&lt;br /&gt;
&lt;br /&gt;
= Single layer of Telescopic Approach =&lt;br /&gt;
&lt;br /&gt;
[[PDR.TetGen | Parallel Data Refinement using TetGen ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://crtc.cs.odu.edu/PsC.AFLR&lt;br /&gt;
&lt;br /&gt;
= Software Communications Protocol =&lt;br /&gt;
[[Software Communications Protocol]]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Hybrid_Computing&amp;diff=9311</id>
		<title>Internal:Hybrid Computing</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Hybrid_Computing&amp;diff=9311"/>
		<updated>2024-09-10T21:00:44Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Distributed Noisy Intermediate-Scale Quantum Computers (D-NISQ) =&lt;br /&gt;
&lt;br /&gt;
The D-NISQ model presented by [1] describes a hierarchical architecture of hybrid classical/quantum processors to break up large computations into smaller sub problems. Resource management of limited qubits and noisy quantum computation make domain decomposition a necessary method to practically use many quantum algorithms. The D-NISQ model has four layers. Consider the application to Quantum Hadamard Edge Detection[2] qHED:&lt;br /&gt;
&lt;br /&gt;
=== Decomposition Layer ===&lt;br /&gt;
&lt;br /&gt;
The first layer is performed classically. Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Figure 1 Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Classical to Quantum Layer ===&lt;br /&gt;
&lt;br /&gt;
The second layer performs a mapping of classical input data to quantum. In this case, we wish to encode the pixel values into the amplitudes of basis states where those basis states act as the pixels position in 1D space[3]. The circuit is constructed classically (mathematically determining a series of gates which will produce the highest probable desired output) with the actual execution performed on the newly constructed quantum circuit itself.&lt;br /&gt;
&lt;br /&gt;
=== Quantum Computation Layer ===&lt;br /&gt;
&lt;br /&gt;
The states created in the second layer now act as the input to the quantum algorithm itself. If carried out in parallel, each quantum device will execute their respective inputs across the qHED circuit. If performed iteratively, the quantum devices will have to be reset after each execution.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quantum Information Fusion ===&lt;br /&gt;
&lt;br /&gt;
The D-NISQ model considers the measurement portion of the circuit as the first part of the quantum information layer. Multiple measurements of output states are collected to develop a probability distribution for each sub problem. That probability distribution is mapped as a solution to the respective sub problem. In the case of qHED, the probability amplitudes (pixel values) of basis states (pixels mapped to 1D space) represent the image edge values. In this case, a reverse mapping of 1D to 2D is required. From there, the sub problems are recombined into the final result.&lt;br /&gt;
&lt;br /&gt;
= Quantum Utility Scale Repository =&lt;br /&gt;
https://github.com/ebill007/Quantum-Utility-Scale&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Software&amp;diff=9309</id>
		<title>Software</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Software&amp;diff=9309"/>
		<updated>2024-09-03T22:54:55Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=CRTC I2M Software Suite= &lt;br /&gt;
[[CRTC_I2M]]&lt;br /&gt;
&lt;br /&gt;
= Single layer of Telescopic Approach =&lt;br /&gt;
&lt;br /&gt;
[[PDR.TetGen | Parallel Data Refinement using TetGen ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://crtc.cs.odu.edu/PsC.AFLR&lt;br /&gt;
&lt;br /&gt;
= Software Communications Protocol =&lt;br /&gt;
[[Software Communications Protocol]]&lt;br /&gt;
&lt;br /&gt;
= Quantum Utility Scale =&lt;br /&gt;
https://github.com/ebill007/Quantum-Utility-Scale&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Natural_Language_Processing&amp;diff=9198</id>
		<title>Internal:Quantum Natural Language Processing</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Natural_Language_Processing&amp;diff=9198"/>
		<updated>2023-09-28T21:59:08Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: Created page with &amp;quot;= Background =  Much of modern NLP seems to stem from the parsing then subsequent vectorization of natural language inputs. As is the common case with quantum computing, if we...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Background =&lt;br /&gt;
&lt;br /&gt;
Much of modern NLP seems to stem from the parsing then subsequent vectorization of natural language inputs. As is the common case with quantum computing, if we can frame our input data as a vector then we can process that data using unitary operations. With vectorized data, linear operations can be performed on that data. This leaves an obvious opening for the application of QML techniques.&lt;br /&gt;
&lt;br /&gt;
This semester&#039;s project has the following goals:&lt;br /&gt;
&lt;br /&gt;
*Apply a QNLP framework to the DNISQ model. This first step should not be too rigorous as the distribution of decomposed domains is something with which we already have experience.&lt;br /&gt;
*Find a way to contribute to a model on the quantum side of a framework (an optimized ansatz, encoding methodology, application to noisy circuits, etc.)&lt;br /&gt;
&lt;br /&gt;
Apart from the distribution, I will more or less shy away from any contribution on the classical side of the framework (such as tokenization or parsing).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Literature =&lt;br /&gt;
== [1] lambeq: An Efficient High-Level Python Library for Quantum NLP ==&lt;br /&gt;
Dimitri Kartsaklis, Ian Fan, Richie Yeung, Anna Pearson, Robin Lorenz, Alexis Toumi, Giovanni de Felice, Konstantinos Meichanetzidis, Stephen Clark, Bob Coecke&lt;br /&gt;
https://arxiv.org/pdf/2110.04236.pdf&lt;br /&gt;
&lt;br /&gt;
lambeq is a high-level, open source python library used for experimental QNLP which can be found here[https://github.com/CQCL/lambeq/tree/main#lambeq].&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Student_Reports&amp;diff=9197</id>
		<title>Internal:Student Reports</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Student_Reports&amp;diff=9197"/>
		<updated>2023-09-28T21:43:12Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Emmanuel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Current Students ==&lt;br /&gt;
&lt;br /&gt;
=== Polykarpos ===&lt;br /&gt;
[[PREMA Shared Memory]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:IMR_2018_Runtime_Systems | IMR 2018 Runtime Systems]]&lt;br /&gt;
&lt;br /&gt;
[[Intel Xeon Phi and High Bandwidth Memory]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Machine_Learning | CNF Machine Learning Project]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:ML_Data_Denoise | Track denoising with ML]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1rF3rElnBCsKR_Z_66nTCmMqSZa3b51mEzswiLz_3d3Q/edit?usp=sharing  CNF HPC Workshop Slides]&lt;br /&gt;
&lt;br /&gt;
[[PREMA SW4| SW4 Benchmark with PREMA]]&lt;br /&gt;
&lt;br /&gt;
[[PDR.PODM Distributed Memory| PDR.PODM.PREMA]]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/read/vgwrypshrkqp PREMA-Argobots Paper]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/g/personal/pthom001_odu_edu/EYiL4h5xKThJgjyvbsFbZe4BH_4pr3rR-9x-gvErpDaq3A?e=hdy7ii Heterogeneousarchitecturesforcomputationalintensiveapplications:Acost-effectivenessanalysis]&lt;br /&gt;
&lt;br /&gt;
[[Internal:TAPAS]]&lt;br /&gt;
&lt;br /&gt;
=== Kevin ===&lt;br /&gt;
[[Internal:PDR_AFLR |PDR.AFLR Stability and Scalability]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Progress_Report |PDR.AFLR Progress Report]]&lt;br /&gt;
&lt;br /&gt;
[[AFLR_Point_Spacing/Distribution_Function_Parameters | AFLR Point Spacing/Distribution Function Parameters]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Performance_Testing |PDR.AFLR Performance Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Performance_AIAA |AIAA PDR.AFLR Performance Data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Report_Status |Report Status]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PsC_AFLR_Performance |PsC.AFLR Performance Data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Next_Generation_Boundary_Layer |Next Generation Boundary Layer]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_GPU_Smoothing | CDT3D GPU Smoothing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Distributed_CDT3D_Notes | Distributed CDT3D Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Weekly_Notes | Weekly Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:I2M_Notes | Image-to-Mesh Conversion Project Notes]]&lt;br /&gt;
&lt;br /&gt;
=== Emmanuel ===&lt;br /&gt;
[[Internal:Quantum Information Science (QIS General) |Quantum Information Science (QIS General)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum_Edge_Detection |Quantum Edge Detection]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Hybrid Computing |Hybrid Computing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum Machine Learning |Quantum Machine Learning]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum Natural Language Processing |Quantum Natural Language Processing]]&lt;br /&gt;
&lt;br /&gt;
=== Chris ===&lt;br /&gt;
&lt;br /&gt;
[[Internal:QHD | Quantum Hausdorff Distance (QHD)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:QED | Quantum Edge Detection (QED)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:DQHED |Distributed Hadamard Quantum Edge Detection (DQHED)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:QNEM |Quantum Nested Expectation Maximization (QNEM)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:QCED |Quantum Canny Edge Detection (QCED)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum_PDEs |Quantum PDEs]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:weekly_report_rector |Weekly Report]]&lt;br /&gt;
&lt;br /&gt;
=== Devon ===&lt;br /&gt;
[[Internal:Quantum_Clustering |Quantum Clustering]]&lt;br /&gt;
&lt;br /&gt;
== Former Students ==&lt;br /&gt;
&lt;br /&gt;
=== Angelos ===&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPCD | GPCD]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:APBNRRExecutionStatus | APBNRR Execution Status]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PAPBNRRComparison | Pristine vs New PAPBNRR]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:APBNRRMachineLearning | APBNRR Machine Learning]]&lt;br /&gt;
&lt;br /&gt;
[[Internal: SlicerExtensions | Slicer Extensions]]&lt;br /&gt;
&lt;br /&gt;
=== Christos ===&lt;br /&gt;
&#039;&#039;&#039;[https://olddominion-my.sharepoint.com/:f:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/papers  All papers]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://olddominion-my.sharepoint.com/:f:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/presentations All presentations]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/dissertation/christos_dissertation.pdf Dissertation .pdf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/6438559258mdmsnbpffztx speculative meshing operations using tasks paper - overleaf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/3459466599cnnfkhzmkczs Adaptive CDT3D paper - overleaf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/8242192311zntgrtsphkvv Parallel Grid Adaptation Paper (UGAWG) - overleaf  ]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Adaptive_Meshing_For_APBNRR]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1Fjt5PoDPXa715nOAjn0F4IJpdhscIGnlaQvweqFnB0U Adaptivity PPoSS slides]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1RDtQufImuo5J1pKioIYDuTWCeX1UtjKyx7kQ2i24Tmo/edit?usp=sharing  CNF HPC slides]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://git-community.cs.odu.edu/nikos/SciTech_2019/blob/draft/main.pdf Scitech Journal paper latest draft]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/cand_exam.pdf Candidacy exam (document)]&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:p:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/PhD_Candidacy_presentation.pptx (presentation .pptx)]&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/PhD_Candidacy%20_presentation.pdf (presentation pdf)]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Adaptive_CDT3D_Results | Metric Adaptive CDT3D results]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Argobots_and_CDT3D | Argobots and CDT3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:4D_Predicates_Benchmark | 4D predicates benchmark]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Mesh Sizing for CNF data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:ACDT3D        | Metric Adaptive CDT3D Notes ]]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/frombox/CRTC_Students/ChristosT/candidacy_exam/paper.pdf Parallel Mesh Generation review paper]&lt;br /&gt;
&lt;br /&gt;
[https://lbpw.larc.nasa.gov/ AIAA Sonic Boom Prediction Workshop (next in 2020)]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_SU2 | SU2 and grid requirements ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Boundary_Layer_References | Boundary Layer References ]]&lt;br /&gt;
&lt;br /&gt;
[[External:Mesh_Generation_Articles_In_Journals | Some Mesh Generation Journal papers]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1txyCu6ibheH19hi3nZ10LgHm-WzglUrT5y0AaO__VYk/edit?usp=sharing  PhD Tentative Shedule]&lt;br /&gt;
&lt;br /&gt;
[https://odu.box.com/s/sfkd5l3d9r5865qbsovx0eo6gwlaiask Poster IMR]&lt;br /&gt;
&lt;br /&gt;
[https://odu.box.com/s/1sok1edideblq4nctbufg79vud0oiu8f NIA presentation (September 2018) ] &lt;br /&gt;
&lt;br /&gt;
[[Internal:IMR_2018_Short_Course | IMR 2018 Short Course notes]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:ACDT3D_Scitech2018 | SciTech 2018]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Machine_Learning_CDT3D |  Machine Learning and CDT3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:AIAA_2018_CDT3D | CDT3D AIAA Aviation Paper ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM4D_predicates | PODM4D fine grain concurrency benchmark ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:AIAA_Geometry_and_Mesh_Generation_Workshop | Geometry and Mesh Generation Workshop ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_RoadMap |CDT3D RoadMap]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Computational_Resources | High capacity Computational Resources ]]&lt;br /&gt;
&lt;br /&gt;
[[NDAM:Main | PODM 4D and Anisotropy ]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1jzTiohDA51VHXc65tfIFkmjrKM_8yQn7YYj2txEyhyU MPI PDR.PODM 16,000 cores data and other]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Spiros ===&lt;br /&gt;
&#039;&#039;&#039;Image-To-Mesh Conversion Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:Tessellate_2D | Tessellate 2D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM_3D | PODM 3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM_4D | PODM 4D]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BioInformatics Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPCD | GPCD]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Contrained Mesh Refinement Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_GPU_Smoothing | CDT3D GPU Smoothing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CNF Related Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[CNF:CNF_Data_Generation | CNF Data Generation]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Monte_Carlo_Event_Generator_using_a_Tessellation | Monte Carlo Event Generator using a Tessellation]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Smart_LookUp_Table_Utilities | Smart LookUp Table Utilities]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:PartonsToNRRD | PartonsToNRRD]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Weighted_Mesh_To_Image | Weighted Mesh To Image]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:TetGen_CNF | TetGen CNF]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utilities Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:Synthetical_Image_Data_Generator | Synthetical Image Data Generator]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:MeshIO | MeshIO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDM_ND | PDM ND]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPU_Usage | GPU Usage]]&lt;br /&gt;
&lt;br /&gt;
=== Medical Imaging SubGroup (Eleni, Thomas , Angelos) ===&lt;br /&gt;
[[Internal:ReportCloud | Cloud Report]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Preprocess_Medical_Images |  Preprocessing of Medical Images]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Execution_And_Evaluation_Medical_Images |  Execution and Evaluation of Medical Imaging data]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Joi ===&lt;br /&gt;
[[Tasks | Tasks ]]&lt;br /&gt;
&lt;br /&gt;
[[I2M_Conversion_Tool | Image-to-Mesh (I2M) Conversion Tool]]&lt;br /&gt;
&lt;br /&gt;
[[3D_Slicer_CBC3D_Extension | 3D Slicer CBC3D Extension ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[CNF:CNF_Adaptivity | CNF Adaptivity]]&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
===Conference Slides ===&lt;br /&gt;
[https://odu.box.com/s/vev5nqudpd5yq143xfq99y7b8uyf0j4e AI in Nuclear Physics 2020]&lt;br /&gt;
&lt;br /&gt;
=== Proposal Resources ===&lt;br /&gt;
[[Internal:NSF_PPOSS_Funded_Proposals]]&lt;br /&gt;
&lt;br /&gt;
===Notes ===&lt;br /&gt;
[[Internal:CNF_Workshop]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CNF_HPC_Workshop_2019]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Kokkos_Tutorial_2020_02_19]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Intel_OneAPI_Tutorial_2020_02_20]]&lt;br /&gt;
&lt;br /&gt;
=== Papers ===&lt;br /&gt;
[http://www.cs.odu.edu/crtc/internal/papers/O&#039;Connell_et_al._-_2018_-_Application_of_the_Dependency_Inversion_Principle_.pdf T-infinity: The Dependency Inversion Principle for Rapid and Sustainable Multidisciplinary Software Development]&lt;br /&gt;
&lt;br /&gt;
[https://hal.inria.fr/hal-01927559  Meshless Voronoi on the GPU,  Nicolas Ray,Dmitry Sokolov,Sylvain Lefebvre,Bruno Lévy]&lt;br /&gt;
&lt;br /&gt;
[http://pages.saclay.inria.fr/frederic.alauzet/TetrahedronVI/Slides_Tetrahedron_VI/Thursday/Mike_Park_ugawg-tet-talk.pdf Democratizing Mesh Adaptation forComputational Fluid Dynamics Michael Park]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Hashing_Meshes]]&lt;br /&gt;
&lt;br /&gt;
=== Videos ===&lt;br /&gt;
[https://www.youtube.com/watch?v=pn7IqhOEGpY Using Graphs for Unstructured Data (Keshav Pingali)]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=RZ09uZs1ynA Big Data Brain Maps at Argonne National Laboratory (Bobby Kasthuri), ATPESC 2017]&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
http://livingreview.in.tum.de/welcome/&lt;br /&gt;
&lt;br /&gt;
=== CRTC lab Virtual meetings ===&lt;br /&gt;
* 2020.01.18 - Christos&lt;br /&gt;
:* Unified Approach for Speculative Operations, [https://docs.google.com/presentation/d/1haL6NVwZzRVG0W71KoWmqLKgxkf6to2sUsdTH5Xn4kw (presentation)], [https://olddominion-my.sharepoint.com/:f:/r/personal/ctsol001_odu_edu/Documents/Parallel_Operations?csf=1&amp;amp;web=1&amp;amp;e=hQ8rPg (shared directory)]&lt;br /&gt;
&lt;br /&gt;
* 2021.02.03 - Kevin &amp;amp; Spiros&lt;br /&gt;
:* Introduction to GPU Parallelism, [https://drive.google.com/file/d/1vW3VJXi04JB2N7XpVoNnXXSNv4i1Pnet/view?usp=sharing (presentation)]&lt;br /&gt;
&lt;br /&gt;
* 2021.02.10 - Kevin &amp;amp; Spiros&lt;br /&gt;
:* GPU Architecture, [https://drive.google.com/file/d/1LfDwsbdscSpTk3eBT74lfIlSyD-W_Zwh/view?usp=sharing (presentation)]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=9194</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=9194"/>
		<updated>2023-08-02T20:18:23Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* March 27, 2023 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [9] Precise Image Generation on Current Noisy Quantum Devices ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Stored in the OneDrive here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2F604198%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers].&lt;br /&gt;
&lt;br /&gt;
== [10] Application of quantum computing techniques in particle tracking at LHC ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11836/attachments/9331/13532/20230509_CHEP_v2.pdf].&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;general&amp;quot; quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities.&lt;br /&gt;
&lt;br /&gt;
== [11] First Measurements With A Quantum Vision Transformer: A Naive Approach ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Awaiting the presentation...&lt;br /&gt;
&lt;br /&gt;
== [12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination ==&lt;br /&gt;
&lt;br /&gt;
Full publication found here[http://kth.diva-portal.org/smash/get/diva2:1718318/FULLTEXT02.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== [14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11837/attachments/9417/13658/chep23.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics  ==&lt;br /&gt;
&lt;br /&gt;
No publication or slides as of yet[https://indico.jlab.org/event/459/contributions/11831/].&lt;br /&gt;
&lt;br /&gt;
Opening sentence of the abstract summarizes my plight the past semester to perfection:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
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).&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9179</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9179"/>
		<updated>2023-07-07T19:56:42Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Qiskit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== CPU ====&lt;br /&gt;
&lt;br /&gt;
We can multithread the execution of circuits on Wahab to expedite measurement. An easy way is by using the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
ideal_backend = AerSimulator(method=&#039;density_matrix&#039;)&lt;br /&gt;
ideal_backend.set_options(precision=&amp;quot;single&amp;quot;, max_parallel_threads=0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting max_parallel_threads to 0 enables the simulator to utilize all allocated cores. So, our .sh file may look something like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash -l&lt;br /&gt;
&lt;br /&gt;
#SBATCH --job-name=DENSITY_MATRIX_CPU&lt;br /&gt;
#SBATCH --output=CPU.out&lt;br /&gt;
#SBATCH --ntasks=512&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF&lt;br /&gt;
this job is called $SLURM_JOB_NAME and its ID is $SLURM_JOB_ID&lt;br /&gt;
job $SLURM_JOB_ID has being allocated $SLURM_NTASKS cores across $SLURM_NNODES hosts&lt;br /&gt;
job $SLURM_JOB_ID will be running on the following machines:&lt;br /&gt;
&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
echo $SLURM_NODELIST&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which yields the output file CPU.out:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
this job is called DENSITY_MATRIX_CPU and its ID is 1846321&lt;br /&gt;
job 1846321 has being allocated 512 cores across 27 hosts&lt;br /&gt;
job 1846321 will be running on the following machines:&lt;br /&gt;
&lt;br /&gt;
d1-w6420a-[03,05-06,10,12,14-15,19,21-23],d4-w6420b-[01,03,05-06,08,10-11],e2-w6420b-[02-03,07,13-14,16,18-20]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With, of course, maximized thread execution. Note, that it is possible to hinder performance on circuits if the number of qubits/depth is insufficient. It is also possible to execute multiple circuits simultaneously using the max_parallel_experiments option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Original plots must be defined first&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
# [x_start, y_start, x_len, y_len]&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Papers ==&lt;br /&gt;
=== Pulse Control ===&lt;br /&gt;
A Categorical Order Theory of Pulse Scheduling in Gate-Based Quantum Computing[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2FA%20categorical%20order%20theory%20of%20pulse%20scheduling%20in%20gate%2Dbased%20quantum%20computing%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9088</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9088"/>
		<updated>2023-05-23T11:10:46Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Pulse Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Original plots must be defined first&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
# [x_start, y_start, x_len, y_len]&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Papers ==&lt;br /&gt;
=== Pulse Control ===&lt;br /&gt;
A Categorical Order Theory of Pulse Scheduling in Gate-Based Quantum Computing[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2FA%20categorical%20order%20theory%20of%20pulse%20scheduling%20in%20gate%2Dbased%20quantum%20computing%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9087</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=9087"/>
		<updated>2023-05-23T11:10:25Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Original plots must be defined first&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
# [x_start, y_start, x_len, y_len]&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Papers ==&lt;br /&gt;
=== Pulse Control ===&lt;br /&gt;
A Categorical Orde Theory of Pulse Scheduling in Gate-Based Quantum Computing [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2FA%20categorical%20order%20theory%20of%20pulse%20scheduling%20in%20gate%2Dbased%20quantum%20computing%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=9072</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=9072"/>
		<updated>2023-05-17T21:59:39Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Fidelity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
For most of this research project we have been using a fidelity metric from Ref. [https://arxiv.org/pdf/2209.02795.pdf]. This metric is a simple function dependent on the number of single qubit gates, CNOT gates, and their respective average error rates for some particular circuit on a pre specified backend. This is, in my opinion, analogous to a performance metric from the standpoint of an engineer (say miles per gallon on a car). The calculation itself yields a somewhat confusing unit of measurement (MPG is a cross sectional unit of area!). The metric of MPG still gives you insight into efficiency and performance. However, the results of MPG will depend entirely on the driver and the conditions that the vehicle is subject to. I believe that IBM did do a good job with this as it gives (seemingly) a predictable insight into the efficiency and performance of a circuit on some given hardware. If we want the real observed fidelity through sampling the circuit we are required to &amp;quot;drive&amp;quot; and test our circuit.&lt;br /&gt;
&lt;br /&gt;
Fidelity in itself is not a strict metric. Rather, it is an abstract computation which can be used to predict the probability that one quantum state can pass as another [https://en.wikipedia.org/wiki/Fidelity_of_quantum_states]. Allegedly, Jozsa points out in the publication found here [https://www.tandfonline.com/doi/epdf/10.1080/09500349414552171?needAccess=true] that an overlap of pure quantum states on the geometry of hilbert space can easily be defined as:&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;ψ|χ&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
Which will be 1 where |χ&amp;gt; = |ψ&amp;gt; and 0 if they are perfectly orthogonal. This can be visualized as a simple overlap of two quantum states and the result is exactly how much they overlap. Since the QHED circuit produces pure quantum states we consider this as a fidelity option to calculate. Noisy circuits will yield (at the time of each individual measurement) a pure quantum state. However, the sum of those pure states will produce a density matrix which is most probably not pure. With that being said, Jozsa had produced a fidelity metric for one pure state (ideal) and one mixed state (noisy). Given two density operators where one is pure and the other mixed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;F(ρ,σ) = (tr &amp;amp;#8730; (&amp;amp;#8730;ρ σ &amp;amp;#8730;ρ))&amp;amp;#178;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other definitions for fidelity in the case of mixed states developed by Jozsa[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2F604015%20%281%29%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers], Nielsen[https://arxiv.org/pdf/quant-ph/0205035.pdf], and several others [http://www.physik.uni-leipzig.de/~uhlmann/PDF/Uh76a.pdf]. A more robust technique is called Quantum Tomography [https://en.wikipedia.org/wiki/Quantum_tomography]. This, I believe, falls out of the scope of QHED. QHED relies only on the output state of the circuit in the computational (Z) basis, therefore I believe that Josza&#039;s trace definition should suffice.&lt;br /&gt;
&lt;br /&gt;
In short, the Qiskit definition of fidelity in their paper is not wrong, but rather incomplete in my opinion. There is no strict definition for fidelity. Rather, fidelity is used to give insight to the closeness between states in quantum information theory. The IBM paper predicts the &amp;quot;overlap&amp;quot; while Josza&#039;s metric requires sampling to determine fidelity through experimentation. I think that redefining this metric for ourselves within the scope of Jozsa&#039;s definition allows for a more robust representation of what we have actually accomplished with these optimizations since we are comparing the ideal output directly to the actual result.&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:DecrementOp.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=9067</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=9067"/>
		<updated>2023-05-15T20:37:48Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Decrement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
For most of this research project we have been using a fidelity metric from Ref. [https://arxiv.org/pdf/2209.02795.pdf]. This metric is a simple function dependent on the number of single qubit gates, CNOT gates, and their respective average error rates for some particular circuit on a pre specified backend. This is, in my opinion, analogous to a performance metric from the standpoint of an engineer (say miles per gallon on a car). The calculation itself yields a somewhat confusing unit of measurement (MPG is a cross sectional unit of area!). The metric of MPG still gives you insight into efficiency and performance. However, the results of MPG will depend entirely on the driver and the conditions that the vehicle is subject to. I believe that IBM did do a good job with this as it gives (seemingly) a predictable insight into the efficiency and performance of a circuit on some given hardware. If we want the real observed fidelity through sampling the circuit we are required to &amp;quot;drive&amp;quot; and test our circuit.&lt;br /&gt;
&lt;br /&gt;
Fidelity in itself is not a strict metric. Rather, it is an abstract computation which can be used to predict the probability that one quantum state can pass as another [https://en.wikipedia.org/wiki/Fidelity_of_quantum_states]. Allegedly, Jozsa points out in the publication found here [https://www.tandfonline.com/doi/epdf/10.1080/09500349414552171?needAccess=true] that an overlap of pure quantum states on the geometry of hilbert space can easily be defined as:&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;ψ|χ&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
Which will be 1 where |χ&amp;gt; = |ψ&amp;gt; and 0 if they are perfectly orthogonal. This can be visualized as a simple overlap of two quantum states and the result is exactly how much they overlap. Since the QHED circuit produces pure quantum states we consider this as a fidelity option to calculate. Noisy circuits will yield (at the time of each individual measurement) a pure quantum state. However, the sum of those pure states will produce a density matrix which is most probably not pure. With that being said, Jozsa had produced a fidelity metric for one pure state (ideal) and one mixed state (noisy). Given two density operators where one is pure and the other mixed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;F(ρ,σ) = (tr &amp;amp;#8730; (&amp;amp;#8730;ρ σ &amp;amp;#8730;ρ))&amp;amp;#178;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other definitions for fidelity in the case of mixed states developed by Jozsa, Nielsen[https://arxiv.org/pdf/quant-ph/0205035.pdf], and several others [http://www.physik.uni-leipzig.de/~uhlmann/PDF/Uh76a.pdf]. A more robust technique is called Quantum Tomography [https://en.wikipedia.org/wiki/Quantum_tomography]. This, I believe, falls out of the scope of QHED. QHED relies only on the output state of the circuit in the computational (Z) basis, therefore I believe that Josza&#039;s trace definition should suffice.&lt;br /&gt;
&lt;br /&gt;
In short, the Qiskit definition of fidelity in their paper is not wrong, but rather incomplete in my opinion. There is no strict definition for fidelity. Rather, fidelity is used to give insight to the closeness between states in quantum information theory. The IBM paper predicts the &amp;quot;overlap&amp;quot; while Josza&#039;s metric requires sampling to determine fidelity through experimentation. I think that redefining this metric for ourselves within the scope of Jozsa&#039;s definition allows for a more robust representation of what we have actually accomplished with these optimizations since we are comparing the ideal output directly to the actual result.&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:DecrementOp.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:DecrementOp.png&amp;diff=9066</id>
		<title>File:DecrementOp.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:DecrementOp.png&amp;diff=9066"/>
		<updated>2023-05-15T20:37:22Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:Decrement_op.png&amp;diff=9065</id>
		<title>File:Decrement op.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:Decrement_op.png&amp;diff=9065"/>
		<updated>2023-05-15T20:35:16Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: Ebillias uploaded a new version of File:Decrement op.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:Decrement_op.png&amp;diff=9064</id>
		<title>File:Decrement op.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:Decrement_op.png&amp;diff=9064"/>
		<updated>2023-05-15T20:33:51Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: Ebillias uploaded a new version of File:Decrement op.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8992</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8992"/>
		<updated>2023-05-09T17:09:07Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* [9] Precise Image Generation on Current Noisy Quantum Devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [9] Precise Image Generation on Current Noisy Quantum Devices ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Stored in the OneDrive here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers%2F604198%2Epdf&amp;amp;parent=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fqml%5Fpapers].&lt;br /&gt;
&lt;br /&gt;
== [10] Application of quantum computing techniques in particle tracking at LHC ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11836/attachments/9331/13532/20230509_CHEP_v2.pdf].&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;general&amp;quot; quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities.&lt;br /&gt;
&lt;br /&gt;
== [11] First Measurements With A Quantum Vision Transformer: A Naive Approach ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Awaiting the presentation...&lt;br /&gt;
&lt;br /&gt;
== [12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination ==&lt;br /&gt;
&lt;br /&gt;
Full publication found here[http://kth.diva-portal.org/smash/get/diva2:1718318/FULLTEXT02.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== [14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11837/attachments/9417/13658/chep23.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics  ==&lt;br /&gt;
&lt;br /&gt;
No publication or slides as of yet[https://indico.jlab.org/event/459/contributions/11831/].&lt;br /&gt;
&lt;br /&gt;
Opening sentence of the abstract summarizes my plight the past semester to perfection:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
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).&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8988</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8988"/>
		<updated>2023-05-08T20:04:29Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [9] Precise Image Generation on Current Noisy Quantum Devices ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Found here[https://ieeexplore.ieee.org/document/9996924], requested through ODU InterLibrary Loan.&lt;br /&gt;
&lt;br /&gt;
== [10] Application of quantum computing techniques in particle tracking at LHC ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11836/attachments/9331/13532/20230509_CHEP_v2.pdf].&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;general&amp;quot; quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities.&lt;br /&gt;
&lt;br /&gt;
== [11] First Measurements With A Quantum Vision Transformer: A Naive Approach ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Awaiting the presentation...&lt;br /&gt;
&lt;br /&gt;
== [12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination ==&lt;br /&gt;
&lt;br /&gt;
Full publication found here[http://kth.diva-portal.org/smash/get/diva2:1718318/FULLTEXT02.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== [14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11837/attachments/9417/13658/chep23.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics  ==&lt;br /&gt;
&lt;br /&gt;
No publication or slides as of yet[https://indico.jlab.org/event/459/contributions/11831/].&lt;br /&gt;
&lt;br /&gt;
Opening sentence of the abstract summarizes my plight the past semester to perfection:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
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).&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8987</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8987"/>
		<updated>2023-05-08T20:03:36Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Literature : Quantum Classifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [9] Precise Image Generation on Current Noisy Quantum Devices ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Found here[https://ieeexplore.ieee.org/document/9996924], requested through ODU InterLibrary Loan.&lt;br /&gt;
&lt;br /&gt;
== [10] Application of quantum computing techniques in particle tracking at LHC ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11836/attachments/9331/13532/20230509_CHEP_v2.pdf].&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;general&amp;quot; quantum computer. This presentation does not directly apply to our past VQC work but opens doors to many more possibilities.&lt;br /&gt;
&lt;br /&gt;
== [11] First Measurements With A Quantum Vision Transformer: A Naive Approach ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Awaiting the presentation...&lt;br /&gt;
&lt;br /&gt;
== [12] The Role of Data in Projected Quantum Kernels: the Higgs Boson Discrimination ==&lt;br /&gt;
&lt;br /&gt;
Full publication found here[http://kth.diva-portal.org/smash/get/diva2:1718318/FULLTEXT02.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [13] Hybrid actor-critic algorithm for quantum reinforcement learning at CERN beam lines ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== [14] Improving Noisy Hybrid Quantum Graph Neural Networks for Particle Decay Tree Reconstruction ==&lt;br /&gt;
&lt;br /&gt;
Slides found here[https://indico.jlab.org/event/459/contributions/11837/attachments/9417/13658/chep23.pdf].&lt;br /&gt;
&lt;br /&gt;
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...&lt;br /&gt;
&lt;br /&gt;
== [15] Symmetry Invariant Quantum Machine Learning models for classification problems in Particle Physics  ==&lt;br /&gt;
&lt;br /&gt;
No publication or slides as of yet[https://indico.jlab.org/event/459/contributions/11831/].&lt;br /&gt;
&lt;br /&gt;
Opening sentence of the abstract summarizes my plight the past semester to perfection:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In the search for advantage in Quantum Machine Learning, appropriate encoding of the underlying classical data into a quantum state is a critical step.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
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!&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8986</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8986"/>
		<updated>2023-05-03T19:00:55Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Inset Plot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Original plots must be defined first&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
# [x_start, y_start, x_len, y_len]&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8985</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8985"/>
		<updated>2023-05-03T19:00:11Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Inset Plot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
# [x_start, y_start, x_len, y_len]&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8984</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8984"/>
		<updated>2023-05-02T20:46:40Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Matplotlib ===&lt;br /&gt;
==== Inset Plot ====&lt;br /&gt;
&lt;br /&gt;
creating an inset plot requires defining inset axes within a pre defined larger plot. For example, if we create a regular lineplot:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Import the following the modules for inset plots and define them underneath the original plt.plot() methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
plt.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Define length and height of inset box&lt;br /&gt;
axins = ax.inset_axes([2.8,700, 2, 1000], transform=ax.transData)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;n+1 optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;grey&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.plot(&lt;br /&gt;
    qubits,&lt;br /&gt;
    qc_cx_op_3,&lt;br /&gt;
    &amp;quot;-o&amp;quot;,&lt;br /&gt;
    label=&amp;quot;2n optimized&amp;quot;,&lt;br /&gt;
    linewidth=2,&lt;br /&gt;
    color=&amp;quot;mediumpurple&amp;quot;,&lt;br /&gt;
    markeredgecolor=&amp;quot;k&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
axins.set_xlim(1.7, 4.5) # Limit the region for zoom&lt;br /&gt;
axins.set_ylim(1, 200)&lt;br /&gt;
axins.set_xticks([2,3,4])&lt;br /&gt;
axins.grid()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
## draw a bbox of the region of the inset axes in the parent axes and&lt;br /&gt;
## connecting lines between the bbox and the inset axes area&lt;br /&gt;
mark_inset(ax, axins, loc1=3, loc2=4, fc=&amp;quot;none&amp;quot;, ec=&amp;quot;0.5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plt.ylabel(&amp;quot;CX Count&amp;quot;)&lt;br /&gt;
plt.xlabel(&amp;quot;n Qubits&amp;quot;)&lt;br /&gt;
plt.xticks(qubits)&lt;br /&gt;
plt.legend(framealpha=1)&lt;br /&gt;
plt.grid()&lt;br /&gt;
plt.title(&amp;quot;QHED Number of CX Operations&amp;quot;)&lt;br /&gt;
plt.savefig(&amp;quot;test2.png&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[File:Inset2.png]]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:Inset2.png&amp;diff=8983</id>
		<title>File:Inset2.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:Inset2.png&amp;diff=8983"/>
		<updated>2023-05-02T20:46:24Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:Inset1.png&amp;diff=8982</id>
		<title>File:Inset1.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:Inset1.png&amp;diff=8982"/>
		<updated>2023-05-02T20:40:44Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8981</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8981"/>
		<updated>2023-05-02T19:03:52Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Qiskit */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;br /&gt;
&lt;br /&gt;
==== GPU ====&lt;br /&gt;
&lt;br /&gt;
Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
    simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
    simulator_gpu.set_options(device=&#039;GPU&#039;)&lt;br /&gt;
except AerError as e:&lt;br /&gt;
    print(&#039;Err:\n&#039;,e)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#SBATCH -p gpu&lt;br /&gt;
#SBATCH --gres gpu:1&lt;br /&gt;
&lt;br /&gt;
enable_lmod&lt;br /&gt;
module load container_env python3&lt;br /&gt;
&lt;br /&gt;
crun -p ~/envs/python3.10 python3 -u ./main.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8980</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8980"/>
		<updated>2023-05-02T18:54:30Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
=== Qiskit ===&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8979</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8979"/>
		<updated>2023-04-28T18:57:27Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* QIS General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom built QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8978</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8978"/>
		<updated>2023-04-27T22:25:33Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Fidelity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
For most of this research project we have been using a fidelity metric from Ref. [https://arxiv.org/pdf/2209.02795.pdf]. This metric is a simple function dependent on the number of single qubit gates, CNOT gates, and their respective average error rates for some particular circuit on a pre specified backend. This is, in my opinion, analogous to a performance metric from the standpoint of an engineer (say miles per gallon on a car). The calculation itself yields a somewhat confusing unit of measurement (MPG is a cross sectional unit of area!). The metric of MPG still gives you insight into efficiency and performance. However, the results of MPG will depend entirely on the driver and the conditions that the vehicle is subject to. I believe that IBM did do a good job with this as it gives (seemingly) a predictable insight into the efficiency and performance of a circuit on some given hardware. If we want the real observed fidelity through sampling the circuit we are required to &amp;quot;drive&amp;quot; and test our circuit.&lt;br /&gt;
&lt;br /&gt;
Fidelity in itself is not a strict metric. Rather, it is an abstract computation which can be used to predict the probability that one quantum state can pass as another [https://en.wikipedia.org/wiki/Fidelity_of_quantum_states]. Allegedly, Jozsa points out in the publication found here [https://www.tandfonline.com/doi/epdf/10.1080/09500349414552171?needAccess=true] that an overlap of pure quantum states on the geometry of hilbert space can easily be defined as:&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;ψ|χ&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
Which will be 1 where |χ&amp;gt; = |ψ&amp;gt; and 0 if they are perfectly orthogonal. This can be visualized as a simple overlap of two quantum states and the result is exactly how much they overlap. Since the QHED circuit produces pure quantum states we consider this as a fidelity option to calculate. Noisy circuits will yield (at the time of each individual measurement) a pure quantum state. However, the sum of those pure states will produce a density matrix which is most probably not pure. With that being said, Jozsa had produced a fidelity metric for one pure state (ideal) and one mixed state (noisy). Given two density operators where one is pure and the other mixed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;F(ρ,σ) = (tr &amp;amp;#8730; (&amp;amp;#8730;ρ σ &amp;amp;#8730;ρ))&amp;amp;#178;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other definitions for fidelity in the case of mixed states developed by Jozsa, Nielsen[https://arxiv.org/pdf/quant-ph/0205035.pdf], and several others [http://www.physik.uni-leipzig.de/~uhlmann/PDF/Uh76a.pdf]. A more robust technique is called Quantum Tomography [https://en.wikipedia.org/wiki/Quantum_tomography]. This, I believe, falls out of the scope of QHED. QHED relies only on the output state of the circuit in the computational (Z) basis, therefore I believe that Josza&#039;s trace definition should suffice.&lt;br /&gt;
&lt;br /&gt;
In short, the Qiskit definition of fidelity in their paper is not wrong, but rather incomplete in my opinion. There is no strict definition for fidelity. Rather, fidelity is used to give insight to the closeness between states in quantum information theory. The IBM paper predicts the &amp;quot;overlap&amp;quot; while Josza&#039;s metric requires sampling to determine fidelity through experimentation. I think that redefining this metric for ourselves within the scope of Jozsa&#039;s definition allows for a more robust representation of what we have actually accomplished with these optimizations since we are comparing the ideal output directly to the actual result.&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8977</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8977"/>
		<updated>2023-04-27T22:19:57Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Fidelity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
For most of this research project we have been using a fidelity metric from Ref. [https://arxiv.org/pdf/2209.02795.pdf]. This metric is a simple function dependent on the number of single qubit gates, CNOT gates, and their respective average error rates for some particular circuit on a pre specified backend. This is, in my opinion, analogous to a performance metric from the standpoint of an engineer (say miles per gallon on a car). The calculation itself yields a somewhat confusing unit of measurement (MPG is a cross sectional unit of area!). At the same time, the results of MPG will depend entirely on the driver and the conditions that the vehicle is subject to. However, the result gives you insight into efficiency and performance. I believe that IBM did do a good job with this as it gives (seemingly) a predictable insight into the efficiency and performance of a circuit on some given hardware. If we want the real observed fidelity through sampling the circuit we are required to put in some extra work.&lt;br /&gt;
&lt;br /&gt;
Fidelity in itself is not a strict metric. Rather, it is an abstract computation which can be used to predict the probability that one quantum state can pass as another [https://en.wikipedia.org/wiki/Fidelity_of_quantum_states]. Allegedly, Jozsa points out in the publication found here [https://www.tandfonline.com/doi/epdf/10.1080/09500349414552171?needAccess=true] that an overlap of pure quantum states on the geometry of hilbert space can easily be defined as:&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;ψ|χ&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
Which will be 1 where |χ&amp;gt; = |ψ&amp;gt; and 0 if they are perfectly orthogonal. This can be visualized as a simple overlap of two quantum states and the result is exactly how much they overlap. Since the QHED circuit produces pure quantum states we consider this as a fidelity option to calculate. Noisy circuits will yield (at the time of each individual measurement) a pure quantum state. However, the sum of those pure states will produce a density matrix which is most probably not pure. With that being said, Jozsa had produced a fidelity metric for one pure state (ideal) and one mixed state (noisy). Given two density operators where one is pure and the other mixed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;F(ρ,σ) = (tr &amp;amp;#8730; (&amp;amp;#8730;ρ σ &amp;amp;#8730;ρ))&amp;amp;#178;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other definitions for fidelity in the case of mixed states developed by Jozsa, Nielsen[https://arxiv.org/pdf/quant-ph/0205035.pdf], and several others [http://www.physik.uni-leipzig.de/~uhlmann/PDF/Uh76a.pdf]. A more robust technique is called Quantum Tomography [https://en.wikipedia.org/wiki/Quantum_tomography]. This, I believe, falls out of the scope of QHED. QHED relies only on the output state of the circuit in the computational (Z) basis, therefore I believe that Josza&#039;s trace definition should suffice.&lt;br /&gt;
&lt;br /&gt;
In short, the Qiskit definition of fidelity in their paper is not wrong, but rather incomplete in my opinion. There is no strict definition for fidelity. Rather, fidelity is used to give insight to the closeness between states in quantum information theory. The IBM paper predicts the &amp;quot;overlap&amp;quot; while Josza&#039;s metric requires sampling to determine fidelity through experimentation. I think that redefining this metric for ourselves within the scope of Jozsa&#039;s definition allows for a more robust representation of what we have actually accomplished with these optimizations since we are comparing the ideal output directly to the actual result.&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8957</id>
		<title>Internal:Quantum Information Science (QIS General)</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Information_Science_(QIS_General)&amp;diff=8957"/>
		<updated>2023-04-21T13:43:44Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: Created page with &amp;quot;= QIS General =  I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.  == Notebooks == === QIS General === Custo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= QIS General =&lt;br /&gt;
&lt;br /&gt;
I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.&lt;br /&gt;
&lt;br /&gt;
== Notebooks ==&lt;br /&gt;
=== QIS General ===&lt;br /&gt;
Custom build QIS notebooks (some modeled after Nielsen&#039;s lectures) can be found here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FBasics%5FQC%2Fnotebooks%2Fgeneral&amp;amp;view=0].&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Student_Reports&amp;diff=8956</id>
		<title>Internal:Student Reports</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Student_Reports&amp;diff=8956"/>
		<updated>2023-04-21T13:39:28Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Emmanuel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Current Students ==&lt;br /&gt;
&lt;br /&gt;
=== Polykarpos ===&lt;br /&gt;
[[PREMA Shared Memory]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:IMR_2018_Runtime_Systems | IMR 2018 Runtime Systems]]&lt;br /&gt;
&lt;br /&gt;
[[Intel Xeon Phi and High Bandwidth Memory]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Machine_Learning | CNF Machine Learning Project]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:ML_Data_Denoise | Track denoising with ML]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1rF3rElnBCsKR_Z_66nTCmMqSZa3b51mEzswiLz_3d3Q/edit?usp=sharing  CNF HPC Workshop Slides]&lt;br /&gt;
&lt;br /&gt;
[[PREMA SW4| SW4 Benchmark with PREMA]]&lt;br /&gt;
&lt;br /&gt;
[[PDR.PODM Distributed Memory| PDR.PODM.PREMA]]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/read/vgwrypshrkqp PREMA-Argobots Paper]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/g/personal/pthom001_odu_edu/EYiL4h5xKThJgjyvbsFbZe4BH_4pr3rR-9x-gvErpDaq3A?e=hdy7ii Heterogeneousarchitecturesforcomputationalintensiveapplications:Acost-effectivenessanalysis]&lt;br /&gt;
&lt;br /&gt;
[[Internal:TAPAS]]&lt;br /&gt;
&lt;br /&gt;
=== Kevin ===&lt;br /&gt;
[[Internal:PDR_AFLR |PDR.AFLR Stability and Scalability]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Progress_Report |PDR.AFLR Progress Report]]&lt;br /&gt;
&lt;br /&gt;
[[AFLR_Point_Spacing/Distribution_Function_Parameters | AFLR Point Spacing/Distribution Function Parameters]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Performance_Testing |PDR.AFLR Performance Testing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDR_AFLR_Performance_AIAA |AIAA PDR.AFLR Performance Data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Report_Status |Report Status]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PsC_AFLR_Performance |PsC.AFLR Performance Data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Next_Generation_Boundary_Layer |Next Generation Boundary Layer]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_GPU_Smoothing | CDT3D GPU Smoothing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Distributed_CDT3D_Notes | Distributed CDT3D Notes]]&lt;br /&gt;
&lt;br /&gt;
=== Emmanuel ===&lt;br /&gt;
[[Internal:Quantum Information Science (QIS General) |Quantum Information Science (QIS General)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum_Edge_Detection |Quantum Edge Detection]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Hybrid Computing |Hybrid Computing]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum Machine Learning |Quantum Machine Learning]]&lt;br /&gt;
&lt;br /&gt;
=== Chris ===&lt;br /&gt;
[[Internal:DQHED |Distributed Hadamard Quantum Edge Detection (DQHED)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:QCED |Quantum Canny Edge Detection (QCED)]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Quantum_PDEs |Quantum PDEs]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:weekly_report_rector |Weekly Report]]&lt;br /&gt;
&lt;br /&gt;
=== Devon ===&lt;br /&gt;
[[Internal:Quantum_Clustering |Quantum Clustering]]&lt;br /&gt;
&lt;br /&gt;
== Former Students ==&lt;br /&gt;
&lt;br /&gt;
=== Angelos ===&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPCD | GPCD]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:APBNRRExecutionStatus | APBNRR Execution Status]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PAPBNRRComparison | Pristine vs New PAPBNRR]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:APBNRRMachineLearning | APBNRR Machine Learning]]&lt;br /&gt;
&lt;br /&gt;
[[Internal: SlicerExtensions | Slicer Extensions]]&lt;br /&gt;
&lt;br /&gt;
=== Christos ===&lt;br /&gt;
&#039;&#039;&#039;[https://olddominion-my.sharepoint.com/:f:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/papers  All papers]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[https://olddominion-my.sharepoint.com/:f:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/presentations All presentations]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/dissertation/christos_dissertation.pdf Dissertation .pdf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/6438559258mdmsnbpffztx speculative meshing operations using tasks paper - overleaf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/3459466599cnnfkhzmkczs Adaptive CDT3D paper - overleaf]&lt;br /&gt;
&lt;br /&gt;
[https://www.overleaf.com/8242192311zntgrtsphkvv Parallel Grid Adaptation Paper (UGAWG) - overleaf  ]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Adaptive_Meshing_For_APBNRR]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1Fjt5PoDPXa715nOAjn0F4IJpdhscIGnlaQvweqFnB0U Adaptivity PPoSS slides]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/presentation/d/1RDtQufImuo5J1pKioIYDuTWCeX1UtjKyx7kQ2i24Tmo/edit?usp=sharing  CNF HPC slides]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://git-community.cs.odu.edu/nikos/SciTech_2019/blob/draft/main.pdf Scitech Journal paper latest draft]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/cand_exam.pdf Candidacy exam (document)]&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:p:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/PhD_Candidacy_presentation.pptx (presentation .pptx)]&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/From_Box/CRTC_Students/ChristosT/candidacy_exam/PhD_Candidacy%20_presentation.pdf (presentation pdf)]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Adaptive_CDT3D_Results | Metric Adaptive CDT3D results]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Argobots_and_CDT3D | Argobots and CDT3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:4D_Predicates_Benchmark | 4D predicates benchmark]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Mesh Sizing for CNF data]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:ACDT3D        | Metric Adaptive CDT3D Notes ]]&lt;br /&gt;
&lt;br /&gt;
[https://olddominion-my.sharepoint.com/:b:/r/personal/nchrisoc_odu_edu/Documents/frombox/CRTC_Students/ChristosT/candidacy_exam/paper.pdf Parallel Mesh Generation review paper]&lt;br /&gt;
&lt;br /&gt;
[https://lbpw.larc.nasa.gov/ AIAA Sonic Boom Prediction Workshop (next in 2020)]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_SU2 | SU2 and grid requirements ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Boundary_Layer_References | Boundary Layer References ]]&lt;br /&gt;
&lt;br /&gt;
[[External:Mesh_Generation_Articles_In_Journals | Some Mesh Generation Journal papers]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1txyCu6ibheH19hi3nZ10LgHm-WzglUrT5y0AaO__VYk/edit?usp=sharing  PhD Tentative Shedule]&lt;br /&gt;
&lt;br /&gt;
[https://odu.box.com/s/sfkd5l3d9r5865qbsovx0eo6gwlaiask Poster IMR]&lt;br /&gt;
&lt;br /&gt;
[https://odu.box.com/s/1sok1edideblq4nctbufg79vud0oiu8f NIA presentation (September 2018) ] &lt;br /&gt;
&lt;br /&gt;
[[Internal:IMR_2018_Short_Course | IMR 2018 Short Course notes]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:ACDT3D_Scitech2018 | SciTech 2018]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Machine_Learning_CDT3D |  Machine Learning and CDT3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:AIAA_2018_CDT3D | CDT3D AIAA Aviation Paper ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM4D_predicates | PODM4D fine grain concurrency benchmark ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:AIAA_Geometry_and_Mesh_Generation_Workshop | Geometry and Mesh Generation Workshop ]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_RoadMap |CDT3D RoadMap]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Computational_Resources | High capacity Computational Resources ]]&lt;br /&gt;
&lt;br /&gt;
[[NDAM:Main | PODM 4D and Anisotropy ]]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/document/d/1jzTiohDA51VHXc65tfIFkmjrKM_8yQn7YYj2txEyhyU MPI PDR.PODM 16,000 cores data and other]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Spiros ===&lt;br /&gt;
&#039;&#039;&#039;Image-To-Mesh Conversion Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:Tessellate_2D | Tessellate 2D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM_3D | PODM 3D]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:PODM_4D | PODM 4D]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BioInformatics Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPCD | GPCD]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Contrained Mesh Refinement Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:CDT3D_GPU_Smoothing | CDT3D GPU Smoothing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CNF Related Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[CNF:CNF_Data_Generation | CNF Data Generation]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Monte_Carlo_Event_Generator_using_a_Tessellation | Monte Carlo Event Generator using a Tessellation]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Smart_LookUp_Table_Utilities | Smart LookUp Table Utilities]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:PartonsToNRRD | PartonsToNRRD]]&lt;br /&gt;
&lt;br /&gt;
[[CNF:Weighted_Mesh_To_Image | Weighted Mesh To Image]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:TetGen_CNF | TetGen CNF]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utilities Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:Synthetical_Image_Data_Generator | Synthetical Image Data Generator]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:MeshIO | MeshIO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other Projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Internal:PDM_ND | PDM ND]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:GPU_Usage | GPU Usage]]&lt;br /&gt;
&lt;br /&gt;
=== Medical Imaging SubGroup (Eleni, Thomas , Angelos) ===&lt;br /&gt;
[[Internal:ReportCloud | Cloud Report]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Preprocess_Medical_Images |  Preprocessing of Medical Images]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Execution_And_Evaluation_Medical_Images |  Execution and Evaluation of Medical Imaging data]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Joi ===&lt;br /&gt;
[[Tasks | Tasks ]]&lt;br /&gt;
&lt;br /&gt;
[[I2M_Conversion_Tool | Image-to-Mesh (I2M) Conversion Tool]]&lt;br /&gt;
&lt;br /&gt;
[[3D_Slicer_CBC3D_Extension | 3D Slicer CBC3D Extension ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reports&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[CNF:CNF_Adaptivity | CNF Adaptivity]]&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
===Conference Slides ===&lt;br /&gt;
[https://odu.box.com/s/vev5nqudpd5yq143xfq99y7b8uyf0j4e AI in Nuclear Physics 2020]&lt;br /&gt;
&lt;br /&gt;
=== Proposal Resources ===&lt;br /&gt;
[[Internal:NSF_PPOSS_Funded_Proposals]]&lt;br /&gt;
&lt;br /&gt;
===Notes ===&lt;br /&gt;
[[Internal:CNF_Workshop]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:CNF_HPC_Workshop_2019]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Kokkos_Tutorial_2020_02_19]]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Intel_OneAPI_Tutorial_2020_02_20]]&lt;br /&gt;
&lt;br /&gt;
=== Papers ===&lt;br /&gt;
[http://www.cs.odu.edu/crtc/internal/papers/O&#039;Connell_et_al._-_2018_-_Application_of_the_Dependency_Inversion_Principle_.pdf T-infinity: The Dependency Inversion Principle for Rapid and Sustainable Multidisciplinary Software Development]&lt;br /&gt;
&lt;br /&gt;
[https://hal.inria.fr/hal-01927559  Meshless Voronoi on the GPU,  Nicolas Ray,Dmitry Sokolov,Sylvain Lefebvre,Bruno Lévy]&lt;br /&gt;
&lt;br /&gt;
[http://pages.saclay.inria.fr/frederic.alauzet/TetrahedronVI/Slides_Tetrahedron_VI/Thursday/Mike_Park_ugawg-tet-talk.pdf Democratizing Mesh Adaptation forComputational Fluid Dynamics Michael Park]&lt;br /&gt;
&lt;br /&gt;
[[Internal:Hashing_Meshes]]&lt;br /&gt;
&lt;br /&gt;
=== Videos ===&lt;br /&gt;
[https://www.youtube.com/watch?v=pn7IqhOEGpY Using Graphs for Unstructured Data (Keshav Pingali)]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=RZ09uZs1ynA Big Data Brain Maps at Argonne National Laboratory (Bobby Kasthuri), ATPESC 2017]&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
http://livingreview.in.tum.de/welcome/&lt;br /&gt;
&lt;br /&gt;
=== CRTC lab Virtual meetings ===&lt;br /&gt;
* 2020.01.18 - Christos&lt;br /&gt;
:* Unified Approach for Speculative Operations, [https://docs.google.com/presentation/d/1haL6NVwZzRVG0W71KoWmqLKgxkf6to2sUsdTH5Xn4kw (presentation)], [https://olddominion-my.sharepoint.com/:f:/r/personal/ctsol001_odu_edu/Documents/Parallel_Operations?csf=1&amp;amp;web=1&amp;amp;e=hQ8rPg (shared directory)]&lt;br /&gt;
&lt;br /&gt;
* 2021.02.03 - Kevin &amp;amp; Spiros&lt;br /&gt;
:* Introduction to GPU Parallelism, [https://drive.google.com/file/d/1vW3VJXi04JB2N7XpVoNnXXSNv4i1Pnet/view?usp=sharing (presentation)]&lt;br /&gt;
&lt;br /&gt;
* 2021.02.10 - Kevin &amp;amp; Spiros&lt;br /&gt;
:* GPU Architecture, [https://drive.google.com/file/d/1LfDwsbdscSpTk3eBT74lfIlSyD-W_Zwh/view?usp=sharing (presentation)]&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8954</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8954"/>
		<updated>2023-04-18T16:51:56Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
A quick note on fidelity. For most of this research project we have been using a fidelity metric from Ref. [https://arxiv.org/pdf/2209.02795.pdf]. This metric is a simple calculation of the number of single qubit gates and their error rates along with the respective metrics from CNOT gates for some particular circuit. &lt;br /&gt;
&lt;br /&gt;
Fidelity in itself is not a strict metric. Rather, it is an abstract computation which can be used to predict the probability that one quantum state can pass as another [https://en.wikipedia.org/wiki/Fidelity_of_quantum_states]. Allegedly, Jozsa points out in the publication found here [https://www.tandfonline.com/doi/epdf/10.1080/09500349414552171?needAccess=true] that an overlap of pure quantum states on the geometry of hilbert space can easily be defined as:&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;ψ|χ&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
Which will be 1 where |χ&amp;gt; = |ψ&amp;gt; and 0 if they are perfectly orthogonal. This can be visualized as a simple overlap of two quantum states and the result is exactly how much they overlap. Since the QHED circuit produces pure quantum states we consider this as a fidelity option to calculate. However, I am not entirely convinced that our noisy circuits produce pure quantum states. I need to run metrics on density matrix purity to determine this. With that being said, Jozsa had produced a fidelity metric for one pure state and one mixed state. Given two density operators where one is pure and the other mixed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;F(ρ,σ) = (tr &amp;amp;#8730; (&amp;amp;#8730;ρ σ &amp;amp;#8730;ρ))&amp;amp;#178;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other definitions for fidelity in the case of mixed states developed by Jozsa, Nielsen[https://arxiv.org/pdf/quant-ph/0205035.pdf], and several others [http://www.physik.uni-leipzig.de/~uhlmann/PDF/Uh76a.pdf]. A more robust technique is called Quantum Tomography [https://en.wikipedia.org/wiki/Quantum_tomography]. This, I believe, falls out of the scope of QHED. QHED relies only on the output state of the circuit, therefore I believe that Josza&#039;s trace definition should suffice.&lt;br /&gt;
&lt;br /&gt;
In short, the Qiskit definition of fidelity in their paper is not wrong, but rather incomplete in my opinion. There is no strict definition for fidelity. Rather, fidelity is used to give insight to the closeness between states in quantum information theory. I think that redefining this metric for ourselves within the scope of Jozsa&#039;s definition allows for a more robust representation of what we have actually accomplished with these optimizations since we are comparing the ideal output directly to the actual result.&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8953</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8953"/>
		<updated>2023-04-18T16:11:00Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== Quantum Fidelity ==&lt;br /&gt;
&lt;br /&gt;
A quick note on fidelity. For most of this research project&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8930</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8930"/>
		<updated>2023-04-10T14:36:51Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Paper */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/64341df873168e42fe8c2624]&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8929</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8929"/>
		<updated>2023-04-09T17:59:00Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* April 9, 2023 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8928</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8928"/>
		<updated>2023-04-09T17:58:45Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Literature : Quantum Classifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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]. 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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [8] QDNN: deep neural networks with quantum layers ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8927</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8927"/>
		<updated>2023-04-09T17:43:29Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* April 9, 2023 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
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]. 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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
Things to consider/progress to be made:&lt;br /&gt;
&lt;br /&gt;
1. As far as quantum classifiers for nuclear physics goes I have not found this network architecture applied yet.&lt;br /&gt;
2. Outside of a few &amp;quot;toy&amp;quot; example datasets (MNIST) and those used for dissipative quantum neural networks, these networks seem to be rare.&lt;br /&gt;
3. Nobody has utilized this architecture in a distributive manner.&lt;br /&gt;
4. I will continue using qiskit for now but I must consider c++ or cuda based applications for a quicker expectation measurements.&lt;br /&gt;
5. I am dedicating approximately 30 minutes to 1 hour of literature review every day to ensure that 1-3 are true.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
1. Creating a scalable quantum classification network for high energy particle physics which has not been seen before.&lt;br /&gt;
2. The network has real utility in the future.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8926</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8926"/>
		<updated>2023-04-09T17:06:10Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== April 9, 2023 ==&lt;br /&gt;
&lt;br /&gt;
[[File:FCQNN_diagram.png|1500px]]&lt;br /&gt;
&lt;br /&gt;
A (hopefully) novel Fully Connected Quantum Neural Network can be seen above. 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&#039;s, U(θ), act as the weight matrices. It can be thought of more as a connected series of smaller classical Neural networks.&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:FCQNN_diagram.png&amp;diff=8925</id>
		<title>File:FCQNN diagram.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:FCQNN_diagram.png&amp;diff=8925"/>
		<updated>2023-04-09T16:57:46Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8923</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8923"/>
		<updated>2023-04-07T15:10:19Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Paper ==&lt;br /&gt;
Find the current version of paper here[https://www.overleaf.com/project/63924b684bfa06b39df1bdfc]&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8920</id>
		<title>Internal:Quantum Edge Detection</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Edge_Detection&amp;diff=8920"/>
		<updated>2023-04-07T15:08:38Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Quantum Hadamard Edge Detection (QHED) =&lt;br /&gt;
&lt;br /&gt;
A recent quantum edge detection algorithm called Quantum Hadamard Edge Detection[2] (QHED) provides a promising means of quantum image processing and experimentation. This is done by providing full boundary gradient across a 1D mapping of a 2D image. Due to fidelity issues on NISQ era hardware, we are required to divide our images into sub images (domain decomposition) for proper edge detection[1]. When doing this, we find a boundary error issue with the algorithm. In addition, we utilize a series of optimization techniques found in Ref. [6] to overcome the resultant hardware noise. The hardware limitations and the few issues with the QHED algorithm itself are reduced in order to produce simulated NISQ hardware results on large images.&lt;br /&gt;
&lt;br /&gt;
The overall goal of this project is to produce high quality results via the QHED circuit on large medical images via REAL NISQ era hardware. Classically, we can use space filling curves or pixel buffers to improve results upon the decomposed image. As far as real hardware is concerned, areas of interest to achieve quality results are by implementing major improvements upon the decrement gate which seems to be the failure point. We can tackle this by a combination of efficient mathematics[7], NISQ error mitigation techniques[6], and VQC techniques. The combination of all of these applied to the three major sections of the circuit (ignoring the measurement phase) could very well result in accurate edge detection results on real quantum hardware. Without access to larger number of qubits (&amp;gt;7 qubits) we need to use the topology taken from noisy simulated hardware. The principles of CX error, single gate error, fidelity, and coherence normally found in real hardware are applicable to noisy simulations. Thus, this remains as a quality means of data analysis prior to execution on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
Download the Decrement and image encoding notebooks here [https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2Fquantum%5Fedge%5Fdetection%2Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== QHED Circuit ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed circuit.png|500px|thumb|none|Figure 1 Generalized qHED Circuit with input vector f and output vector g.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== State Prep ===&lt;br /&gt;
[[File:Rcmo.png|500px|thumb|none|Figure 2 Row (left) and Column (right) major ordered mapping.]]&lt;br /&gt;
&lt;br /&gt;
The image is first mapped as a 2D array to a 1D vector. Ref. [2] uses methodology known as row and column major ordering (RCMO). Each pixel is then normalized such that the sum of their squares is equal to 1, a necessary quality of quantum states. Using a module presented by Ref. [3] (or through Qiskit&#039;s StatePreparation), we can calculate a quantum circuit which achieves what is known as amplitude encoding. The normalized pixel values of the input vector will be returned as the probability amplitudes of computational basis states. Those computational basis states act as the indexing of the original vector. I.e. if we had a length 64 vector, the 7th element is represented as c_7|000111&amp;gt;. The resultant normalized image state can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Img state.png|200px]]&lt;br /&gt;
&lt;br /&gt;
The Hadamard gate in the state prep acts on the Least Significant Bit (LSB) initialized to state |0&amp;gt; which outputs the |+&amp;gt; state. Application of the H-Gate on the LSB has the following tensor product on the input image state:&lt;br /&gt;
&lt;br /&gt;
[[File:State prep.png|400px]]&lt;br /&gt;
&lt;br /&gt;
=== Decrement ===&lt;br /&gt;
&lt;br /&gt;
The decrement portion of the quantum algorithm can be represented by the matrix unitary:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement unitary.png|400px]]&lt;br /&gt;
&lt;br /&gt;
With application of that unitary gate to the state prepared vector yields the decrement state:&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
To the best of our abilities, we find that references to the QHED method provide very little (if any) detail as to the architecture of the decrement gate. Refs. [4] and presumably [5] use a qiskit unitary class function to convert a numpy matrix into a circuit. Although quite useful for simulations, this type of construction fails on real hardware. We can find a far more reasonable design of the gate in Ref. [7] which is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:decrement_gate.png|500px|thumb|none|Multi controlled NOT gates perform the decrement operation. q_0 being the least significant qubit.]]&lt;br /&gt;
&lt;br /&gt;
Although it is known that multi qubit gates are highly error prone, we achieve reasonable results when we compare the two methodologies. We begin with a 4 qubit circuit initialized to the state |0000&amp;gt; = (1...0) which is to be decremented to state |1111&amp;gt; = (0...1). Shown below are the results of the more careful multi controlled qubit construction and the unitary class function executed on the real quantum device, ibmq_lima. Based on the results, we know that we must design our own decrement gates and cannot rely on any arbitrary unitary transformation algorithim.&lt;br /&gt;
&lt;br /&gt;
[[File:Lima tl 3.png|500px|thumb|none| Although the results are far from perfect, we can clearly see the state 1111&amp;gt; has been formed from the state 0000&amp;gt;.]]&lt;br /&gt;
 &lt;br /&gt;
[[File:Lima np.png|500px|thumb|none| The results of our gate are lost in the noise of the output using the unitary class function.]]&lt;br /&gt;
&lt;br /&gt;
We can improve upon the Decrement gate by using 2n total qubits by altering the increment gates in Ref. [8]. More simply, using open controls (bit flip in the case of the qubit being in the state |0&amp;gt;) alters the increment permutation to a decrement.&lt;br /&gt;
&lt;br /&gt;
[[File:Decrement op.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the CX counts and fidelity estimates for QHED circuits show promising results. The upcoming section &amp;quot;Methods of Optimization&amp;quot; will describe the optimizations themselves as they are labeled in the charts below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed cx.png|500px]]&lt;br /&gt;
[[File:Qhed fidelity.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Permutation ===&lt;br /&gt;
This is the portion of the circuit where the actual edge detection occurs. It can be thought of as a series of identity gates tensored together with an H-Gate in the LSB tensored last. The resultant unitary matrix can be written as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation unitary.png|500px]]&lt;br /&gt;
&lt;br /&gt;
With application of the resultant decrement vector as:&lt;br /&gt;
&lt;br /&gt;
[[File:Permutation state.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This is the final output state. Note that if the LSB is in the state |1&amp;gt; we retrieve all of the odd indexed states i.e. |...001&amp;gt; (1), |...011&amp;gt; (3), |...111&amp;gt; (5), ect. These states provide the boundary gradient across the 1D input image. An overview of the QHED algorithm can be visualized as having the following effect on the input of an image state:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED output.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Methods of Optimization ==&lt;br /&gt;
&lt;br /&gt;
The improved decrement gate was already discussed in the previous section so we will leave it there.&lt;br /&gt;
&lt;br /&gt;
We then utilize Qiskit&#039;s transpiler. The optimal SWAP mapping is an NP-Hard problem which yields ambiguous results. &amp;quot;The choice of initial layout can mean the difference between getting a result, and getting nothing but noise.&amp;quot; To compute the best low noise layout, we use an open source module called mapomatic. Mapomatic finds the best low noise sub-graph for some given hardware backend(s). The end result is that the module returns the best set of qubits and their appropriate ordering to execute your circuit with minimal noise. This qubit layout is sent to the transpiler. A heuristic fidelity estimate is taken from Ref. [6].&lt;br /&gt;
&lt;br /&gt;
We now turn to a means of error reduction in the measurement output of the circuit. Researchers are able to perform a variety of experiments to measure a qubit&#039;s state preparation and measurement (SPAM) errors forming a relationship of noisy probabilities to ideal probabilities in the form of a matrix transformation. The correction matrix can be measured by using a variety of circuits with known outcomes and finding the noisy outcome of every possible bit-string for a particular piece of hardware. From this, it is possible to reconstruct our desired output.&lt;br /&gt;
&lt;br /&gt;
There are obvious scaling issues when it comes to building 2^n x 2^n matricies. There are alternatives to this which do not require such scaling or computational overhead. We make use of such a module called mthree. An excellent demonstration of this can be found in the Qiskit Textbook.&lt;br /&gt;
&lt;br /&gt;
In the case of large images, we must perform domain decomposition to preserve fidelity and reduce noise. However, we find that when applying the suggested RMO and CMO indexed 2D to 1D mapping on decomposed sub images there is a non negligible quality reduction to the output edge detected image. This is due to the fact that this use of mapping does not preserve locality. It can be seen from Fig. [2] how these methods of indexing will provide errors across the boundaries of the image/sub images. Consider the output state |g&amp;gt;. It can be seen how non adjacent pixels of the original image will be compared with each other e.g. c_{3} - c_{4} in the Fig. [2] RMO mapping or c_{12} - c_{1} in the CMO mapping. This may lead to detected edges where there are none. To avoid these discrepancies we apply buffer cells to our decomposed images. We choose to do a row by row decomposition for the horizontal scan as shown below. This leaves 2 redundant pixels per sub image, no matter the decomposition size.&lt;br /&gt;
&lt;br /&gt;
[[File:Boundary buffer.png|500px|thumb|none|Buffer pixels of value 0 are applied to the boundary of the overall image.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Buffer cells.png|500px|thumb|none|Further decomposition is then possible by adding neighboring pixels to be used as a buffer due to QHED error. The red cells are ultimately disposed in the final output.]]&lt;br /&gt;
&lt;br /&gt;
With the decrement gate optimization, the more NISQ-era friendly QHED circuit takes the form shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Qhed op.png|500px|thumb|none|QHED circuit with expanded, noise mitigated, decrement gate]]&lt;br /&gt;
&lt;br /&gt;
== Domain Decomposition ==&lt;br /&gt;
&lt;br /&gt;
Consider a 1024x1024 medical image. This comes out to 1,048,576 pixels requiring 20 (2^20) qubits plus 1 ancillary qubit for the QHED algorithm. Additionally, the amplitude encoding process expands exponentially with regards to qubit number. We can divide the image into separate sub images and solve either iteratively or in parallel (multithreading).  Each sub image is now considered to be a sub input of the overall problem.&lt;br /&gt;
&lt;br /&gt;
[[File:NaF-PROSTATE-01-0001_22.png|500px|thumb|none|Example of 1024x1024 Medical image decomposed into 256x256 sub images.]]&lt;br /&gt;
&lt;br /&gt;
Errors begin to occur with the 2D to 1D mapping of subdomains. Consider the row major ordering in figure 1. Elements c_3 and c_4 will provide gradient detection for the output pixel at location 3. This is because the RCMO mappings do not preserve locality at the boarders of multi dimensional arrays. In a full image pass of the algorithm this would hardly be noticeable and leave little error on the output image. It becomes readily apparent in decomposed domains, however:&lt;br /&gt;
&lt;br /&gt;
[[File:Rcmo example.png|1000px|thumb|none|RCMO 2D to 1D mapping applied prior to the output of QHED (simulated) shown above. RCMO mapping does not preserve locality and thus non neighboring pixels are calculated to have edges between them where no such edges exist.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Space Filling Curves ===&lt;br /&gt;
&lt;br /&gt;
One way to solve this issue without the addition of extra qubits is to use space filling curves as a means of 2D to 1D mapping. Space filling curves preserve locality in that the final output of the algorithm will provide boundary detection across exclusively neighboring pixels (with the exception of one pixel per domain in certain cases).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:QHED space filling curves.png|1200px|thumb|none|Example of 1024x1024 Medical image decomposed into 64x64 sub images. In the domain decomposed images (bottom row) a different space filling curve is used for mapping. A laplacian (far left column) edge detection stenciling is used as a classical analog for comparisons.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QHED in 3 Dimensions ===&lt;br /&gt;
&lt;br /&gt;
We can apply the same principles to 3D. The main difference is that instead of performing a vertical and horizontal detection we need to add in a third in order to achieve a full boundary about each pixel. We consider a &amp;quot;scan&amp;quot; about the x, y, and z planes.&lt;br /&gt;
&lt;br /&gt;
[[File:3d model.png|1200px|thumb|none|Example of 3D Medical image to be edge detected.]]&lt;br /&gt;
[[File:3d model rcmo.png|1200px|thumb|none|3D Medical image passed through the QHED algorithm (simulated) 3 times (x,y,z plane). The entire image was passed through each plane.]]&lt;br /&gt;
[[File:3d model rcmo dd.png|1200px|thumb|none|3D Medical image with decomposed domains. Each sub domain (3D block) passed through the QHED algorithm (simulated) 3 times (x,y,z plane). Each block was mapped using RCMO, edge detected, and pieced back together.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] Acampora, Giovanni, et al. “D-NISQ: A Reference Model for Distributed Noisy Intermediate-Scale Quantum Computers.” Information Fusion, vol. 89, 2023, pp. 16–28., https://doi.org/10.1016/j.inffus.2022.08.003.&lt;br /&gt;
&lt;br /&gt;
[2] .-W. Yao, H. Wang, Z. Liao, M.-C. Chen, J. Pan, J. Li, K. Zhang, X. Lin, Z. Wang, Z. Luo,&lt;br /&gt;
et al., Quantum image processing and its application to edge detection: Theory and experiment,&lt;br /&gt;
Physical Review X 7 (3) (2017). doi:10.1103/physrevx.7.031041.&lt;br /&gt;
&lt;br /&gt;
[3]I. F. Araujo, D. K. Park, F. Petruccione, A. J. da Silva, A divide-and-conquer algo-&lt;br /&gt;
rithm for quantum state preparation, Scientific Reports 11 (1) (2021). doi:10.1038/&lt;br /&gt;
s41598-021-85474-1.&lt;br /&gt;
&lt;br /&gt;
[4] Team, T. Q. (2022, July 6). Quantum Edge Detection - qhed algorithm on small and large images. Quantum Edge Detection - QHED Algorithm on Small and Large Images. Retrieved October 28, 2022, from https://qiskit.org/textbook/ch-applications/quantum-edge-detection.html &lt;br /&gt;
&lt;br /&gt;
[5] Anand, A., Lyu, M., Baweja, P. S., &amp;amp;amp; Patil, V. (2022). Quantum Image Processing. https://doi.org/https://arxiv.org/pdf/2203.01831.pdf &lt;br /&gt;
&lt;br /&gt;
[6] Ferris, K. J., Ramusson, A. J., Bronn, N. T., &amp;amp;amp; Lanes, O. (2022). Quantum Simulation on Noisy Superconducting Quantum Computers. https://doi.org/https://doi.org/10.48550/arXiv.2209.02795&lt;br /&gt;
&lt;br /&gt;
[7] LI, X. I. A. O. Y. U., YANG, G. U. O. W. U., TORRES, C. A. R. L. O. S. M. A. N. U. E. L., ZHENG, D. E. S. H. E. N. G., &amp;amp;amp; WANG, K. A. N. G. L. (2013). A class of efficient quantum incrementer gates for quantum circuit synthesis. International Journal of Modern Physics B, 28(01), 1350191. https://doi.org/10.1142/s0217979213501919&lt;br /&gt;
&lt;br /&gt;
[8] . Gidney, Constructing large increment gates. URL https://algassert.com/circuits/2015/06/12/Constructing-Large-Increment-Gates.html&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8919</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8919"/>
		<updated>2023-04-07T15:03:52Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Code : */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Code : =&lt;br /&gt;
&lt;br /&gt;
Download the notebooks here[https://olddominion-my.sharepoint.com/personal/nchrisoc_odu_edu/_layouts/15/onedrive.aspx?ga=1&amp;amp;id=%2Fpersonal%2Fnchrisoc%5Fodu%5Fedu%2FDocuments%2FSpring%5F23%2FQML%20Course%2Fqml%5Fnotebooks&amp;amp;view=0]&lt;br /&gt;
&lt;br /&gt;
= Literature : Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8902</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8902"/>
		<updated>2023-04-04T23:22:39Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8901</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8901"/>
		<updated>2023-04-04T23:21:56Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* [6] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [7] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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 meaning we will have x number of circuits in the next layer.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8900</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8900"/>
		<updated>2023-04-04T22:50:51Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Classifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [6] Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules ==&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
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 meaning we will have x number of circuits in the next layer.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8899</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8899"/>
		<updated>2023-03-31T19:53:16Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Progress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
== March 31, 2023 ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[[File:Scalable_qnn.png|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Encoding ===&lt;br /&gt;
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 &amp;quot;Predictor&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== VQC&#039;s ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
p_1[0] p_1[1]... p_1[n]&lt;br /&gt;
&lt;br /&gt;
p_2[0] p_2[1]... p_2[n]&lt;br /&gt;
&lt;br /&gt;
p_3[0] p_3[1]... p_3[n]&lt;br /&gt;
&lt;br /&gt;
p_4[0] p_4[1]... p_4[n]&lt;br /&gt;
&lt;br /&gt;
And for the predictor layer we will have only one row of parameters since there is only one circuit:&lt;br /&gt;
&lt;br /&gt;
p_pre[0] p_pre[1]... p_pre[n]&lt;br /&gt;
&lt;br /&gt;
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&#039;s dissertation.&lt;br /&gt;
&lt;br /&gt;
=== Classical Device ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=File:Scalable_qnn.png&amp;diff=8898</id>
		<title>File:Scalable qnn.png</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=File:Scalable_qnn.png&amp;diff=8898"/>
		<updated>2023-03-31T19:26:01Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8897</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8897"/>
		<updated>2023-03-31T19:21:41Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Classifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== [1] Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [2] Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [3] Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [4] Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [5] Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== [6] Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8896</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8896"/>
		<updated>2023-03-29T20:53:10Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* March 27, 2023 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
See [https://medium.com/@wenrudong/what-is-opencvs-inter-area-actually-doing-282a626a09b3] for INTER_AREA&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8895</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8895"/>
		<updated>2023-03-27T19:58:46Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: /* Quantum Classifiers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
== Scalable Quantum Neural Networks for Classification ==&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum convolutional neural networks ==&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum convolutional neural networks for high energy physics data analysis ==&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quantum machine learning for particle physics using a variational quantum classifier ==&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Challenges and opportunities in quantum machine learning for high-energy physics ==&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Quantum machine learning in high energy physics ==&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
	<entry>
		<id>https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8894</id>
		<title>Internal:Quantum Machine Learning</title>
		<link rel="alternate" type="text/html" href="https://crtc.cs.odu.edu/index.php?title=Internal:Quantum_Machine_Learning&amp;diff=8894"/>
		<updated>2023-03-27T19:58:05Z</updated>

		<summary type="html">&lt;p&gt;Ebillias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress =&lt;br /&gt;
&lt;br /&gt;
== March 21, 2023 ==&lt;br /&gt;
&lt;br /&gt;
Many of these models require a hybrid approach. Brookhaven, for example, uses a distributed series of VQC&#039;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 &amp;quot;cheaper&amp;quot;. I am not sure if our 4,032 pixel data constitutes. I am required to accomplish two distinct goals with this project:&lt;br /&gt;
&lt;br /&gt;
1. Distinguish myself by using a Quantum particle data classifier which has not been seen before.&lt;br /&gt;
&lt;br /&gt;
2. The product of 1. must have some utility&lt;br /&gt;
&lt;br /&gt;
In regards to the Qiskit QCNN method of attaining results on the particle data we find two main problems:&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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%).&lt;br /&gt;
&lt;br /&gt;
* The 6 feature data encoded with the same Pauli methods attain very poor results as shown below.&lt;br /&gt;
&lt;br /&gt;
There exists a few solutions to the 36x112 feature problem number:&lt;br /&gt;
&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
* We find ways of optimizing the circuits for training. Qiskit allegedly has several &amp;quot;fast&amp;quot; sampling methods. Learning the modules and applying a few test runs should determine if the full 12 qubits can be encoded correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I propose a series of problems to solve where, if solved, any one of them will be both distinguishable and possess utility:&lt;br /&gt;
&lt;br /&gt;
* We can optimize training the Qiskit circuits. There are other ways to produce the required results.&lt;br /&gt;
** 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 &amp;quot;pure&amp;quot; QCNN than those seen in other papers as well as having the utility of being run on real hardware (in the near future maybe!).&lt;br /&gt;
&lt;br /&gt;
* 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&#039;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).&lt;br /&gt;
&lt;br /&gt;
* 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 &amp;quot;less&amp;quot; qubits per circuit. This means, with a sufficient distribution, every datapoint will be encoded into it&#039;s own qubit even for the 36x112 feature data. +4,000 qubits won&#039;t be an issue if they&#039;re broken up into sufficiently small circuits with distributed calculations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== March 27, 2023 ==&lt;br /&gt;
&lt;br /&gt;
From last week, two major problems are solved:&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
   cv2.resize(samples, dsize=(n, len(samples)), interpolation=cv2.INTER_AREA)&lt;br /&gt;
&lt;br /&gt;
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, in turn, not only greatly decreasing training times and quickens convergence, but also increases the accuracy of result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The GPU implementation only requires a few lines of code to be optimized:&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        simulator_gpu = Aer.get_backend(&#039;aer_simulator&#039;)&lt;br /&gt;
        simulator_gpu.set_options(device=&#039;GPU&#039;, precision=&#039;single&#039;)&lt;br /&gt;
    except AerError as e:&lt;br /&gt;
        print(&#039;GPU Err:\n&#039;,e)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;complete&amp;quot; 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&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Quantum Classifiers =&lt;br /&gt;
=== Scalable Quantum Neural Networks for Classification ===&lt;br /&gt;
Jindi Wu, Zeyi Tao, Qun Li&lt;br /&gt;
https://arxiv.org/abs/2208.07719&lt;br /&gt;
&lt;br /&gt;
Relies on a hybrid classical-quantum architecture. Each subdomain has the following:&lt;br /&gt;
&lt;br /&gt;
1. Encoding Unit&lt;br /&gt;
* Authors utilize angle encoding (N qubits for N features) because it can support gradient calculations&lt;br /&gt;
* Amplitude encoding not used due to error rate and difficulty in computing gradients&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. VQC&lt;br /&gt;
* They follow the VQC introduced in https://www.tensorflow.org/quantum/tutorials/mnist#21_build_the_model_circuit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Measurement&lt;br /&gt;
* Calculation of the expectation value, seemingly Pauli-Z operator giving [-1, 1]&lt;br /&gt;
&lt;br /&gt;
4. The measurement of the sub domain is then encoded into a qubit in the next layer.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;pooling layers&amp;quot; are not parameterized since the pooling is the measurement itself. Additionally, we can run circuits in parallel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quantum convolutional neural networks ===&lt;br /&gt;
Iris Cong et al., Nature Physics&lt;br /&gt;
https://doi.org/10.1038/s41567-019-0648-8&lt;br /&gt;
&lt;br /&gt;
N qubit input requires O(log(N)) variational parameters. &amp;quot;This corresponds to a double exponential reduction compared with a generic quantum circuit-based classifier...&amp;quot; hopefully leading to faster training times?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quantum convolutional neural networks for high energy physics data analysis ===&lt;br /&gt;
Chen et al., Brookhaven National Labs&lt;br /&gt;
https://journals.aps.org/prresearch/pdf/10.1103/PhysRevResearch.4.013231&lt;br /&gt;
&lt;br /&gt;
The (SIMULATED) QCNN follows the following protocol:&lt;br /&gt;
&lt;br /&gt;
1. Feature mapped (Amplitude encoded?) particle images of size 30x30 are implemented in the encoding layer.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
3. Pooling is done classically with nonlinear activation functions in between convolutional layers (look deeper into this).&lt;br /&gt;
&lt;br /&gt;
4. Categorical Cross Entropy Loss Function is applied to the final output.&lt;br /&gt;
&lt;br /&gt;
5. Back Prop to adjust the parameters in the VQC&#039;s (convolutional layers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can implement this &amp;quot;by hand&amp;quot; in qiskit using their approximate expectation function on a Wahab GPU node using simulator.set_options(device=&#039;GPU&#039;). This is considerable because it may be a faster process (also for larger circuits) than available public access QML methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quantum machine learning for particle physics using a variational quantum classifier ===&lt;br /&gt;
Andrew Blancea and Michael Spannowsky&lt;br /&gt;
https://link.springer.com/article/10.1007/JHEP02(2021)212&lt;br /&gt;
&lt;br /&gt;
This method follows the same methodology as many others.&lt;br /&gt;
&lt;br /&gt;
1. Angle Encoding the data&lt;br /&gt;
2. Generic VQC using universal single qubit gates and CNOTs producing layers of two entangled qubits&lt;br /&gt;
3. Measurement is performed by experimental repetitions to determine the expectation value of the Pauli-Z operator, not calculated deterministically&lt;br /&gt;
&lt;br /&gt;
Rudimentary introduction to QNN classification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Challenges and opportunities in quantum machine learning for high-energy physics ===&lt;br /&gt;
Sau Lan Wu and Shinjae Yoo2&lt;br /&gt;
https://www.nature.com/articles/s42254-022-00425-7&lt;br /&gt;
&lt;br /&gt;
&amp;quot;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...&lt;br /&gt;
&lt;br /&gt;
... 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.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Quantum machine learning in high energy physics ===&lt;br /&gt;
Guan et al.&lt;br /&gt;
https://iopscience.iop.org/article/10.1088/2632-2153/abc17d/pdf&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Ebillias</name></author>
	</entry>
</feed>