Open main menu

CDOT Wiki β

Changes

Team NP Complete

811 bytes added, 14:40, 21 December 2017
no edit summary
= Simulating Quantum Tunneling With OpenMP =
 
Members:
# [mailto:jali-clarke@myseneca.ca?subject=DPS921 Jinnah Ali-Clarke]
# [mailto:claffan@myseneca.ca?subject=DPS921 Cassandra Laffan]
= Simulating Quantum Tunneling With OpenMP ===Introduction==
The concept of ''quantum tunneling'' is a subset of the Quantum Mechanics branch of theoretical physics. The core concept of Quantum Mechanics is that on a microscopic level, particles behave strangely, often in counter-intuitive ways. ''Quantum Tunneling'' refers to the phenomenon in which particles pass through barriers if the particles have enough energy and if the barrier is thin enough. In essence, said particles 'ignore' the barrier, continuing on as if nothing were there at all.
[[File:TunnelEffektKling1.png|thumb| fig 1.1 Quantum tunnelling through a barrier. The energy of the tunnelled particle is the same but the probability amplitude is decreased.]]
'''==Visualizing'''==
A good way to contrast quantum tunneling with intuition is to consider the following scenario: picture yourself at the bottom of a large hill. You have a tennis ball that you want to roll up the hill far enough that it rolls down the other side. If you don't give it enough energy to reach the top of the hill, the ball will merely roll back to you.
=OpenMP=[[File:OpenMP.png|thumb| fig 2.1 A chart of OpenMP constructs.]] OpenMP is a parallel programming API provided by Intel for C, C++, and Fortran. It enables flexible implementation of parallel algorithms, allowing computers of all builds to utilize all cores it has access to.  In this project, the <nowiki>#pragma omp parallel for</nowiki> statement was used in several locations in the program where for loops had no external dependencies. Where there were dependencies, math was used in such a way that the for loops no longer required the external variables. Their usage will be discussed further down. =Program==='''Without Parallel Processes'''==[[File:FFT.png|thumb|fig 23.1 Fourier transformation code block.]][[File:FT.png|thumb|fig 23.2 Fourier transformations are called, in which the potential energy half step is calculated, then the full kinetic energy step, then finally the final potential energy half step.]]
Originally, this program would calculate the path of a particle using Fourier transformations. These were used in place of the time resource consuming Schrodinger equations because the Schrodinger equations require the simulation to take into account, at each point: the potential energy after a half step, the kinetic energy after a whole step, then finally going back to take the potential energy of the half step. This was even more complicated because, for each particle, every neighboring particle had to be analyzed and accounted for as well. The Fourier transformations converted this into a simple process of multiplication, as shown in the code in figure 1.2:
'''==With Optimized Parallel Processes'''==[[File:PFFT.png|thumb|fig 34.1 Fourier transformation code block, with OpenMP parallelization.]][[File:PFT.png|thumb|fig 34.2 Fourier transformations called in OpenMP.]]
With the introduction of OpenMP into this project, several processes could be done in parallel. In the evolve() function, whenever a for loop was called, it could be parallelized because none of them had external variable dependencies. That eliminated quite a bit of overhead in the runtime. With the inclusion of OpenMP, the Fourier function, itself, was condensed substantially. This was achieved by introducing the Complex type into the program, so that complex calculations could be done in-line. The dynamic call to #pragma omp parallel also cut out a considerable amount of idle time that the CPU spent waiting to initialized all the threads that the program indicated that it required, rather than created threads on a need basis.
==Comparison and Analysis===Initial Performance== Below, you can see the analysis provided by the VTune Amplifier, through visual studio. Here we can see the total elapsed time as well as the overhead time that the program used:
[[File:initial_analysis.png|1000px|center|Initial performance ]]
28
edits