Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
qpong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
qpong
Commits
1d753bb0
Commit
1d753bb0
authored
Nov 21, 2019
by
Armin Co
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into feature_heapBuffer
parents
f42ffe0d
0fbdfb4e
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+2
-3
2 additions, 3 deletions
README.md
src/Particle.cpp
+17
-3
17 additions, 3 deletions
src/Particle.cpp
src/QuantumMath.cpp
+8
-8
8 additions, 8 deletions
src/QuantumMath.cpp
src/QuantumMath.hpp
+4
-4
4 additions, 4 deletions
src/QuantumMath.hpp
with
31 additions
and
18 deletions
README.md
+
2
−
3
View file @
1d753bb0
...
@@ -8,9 +8,8 @@
...
@@ -8,9 +8,8 @@
Dependencies:
Dependencies:
*
cmake
*
cmake
*
gtkmm
*
libgtkmm-3.0-dev
*
fftw
*
libfftw3-dev
*
omp
````
````
mkdir build && cd build
mkdir build && cd build
...
...
This diff is collapsed.
Click to expand it.
src/Particle.cpp
+
17
−
3
View file @
1d753bb0
...
@@ -55,6 +55,20 @@ Particle::~Particle()
...
@@ -55,6 +55,20 @@ Particle::~Particle()
void
Particle
::
propagate
()
void
Particle
::
propagate
()
{
{
#pragma omp parallel for
for
(
unsigned
long
iy
=
0
;
iy
<
ny
;
iy
++
)
{
double
y
=
yAt
(
iy
);
for
(
unsigned
long
ix
=
0
;
ix
<
nx
;
ix
++
)
{
constexpr
double
l
=
0.001
;
//lambda
double
x
=
xAt
(
ix
);
double
E
=
square
(
y
)
*
l
;
int
index
=
nx
*
iy
+
ix
;
m_psi
[
index
]
*=
exp
(
-
Ci
*
dt
/
hbar
*
E
);
}
}
fftw_execute
(
m_planForward
);
// transform into impulse repr.
fftw_execute
(
m_planForward
);
// transform into impulse repr.
#pragma omp parallel for
#pragma omp parallel for
for
(
unsigned
long
iy
=
0
;
iy
<
ny
;
iy
++
)
for
(
unsigned
long
iy
=
0
;
iy
<
ny
;
iy
++
)
...
@@ -70,9 +84,9 @@ void Particle::propagate()
...
@@ -70,9 +84,9 @@ void Particle::propagate()
}
}
}
}
updateImpulseImage
();
updateImpulseImage
();
//momentum
fftw_execute
(
m_planBackward
);
// transform into local repr.
fftw_execute
(
m_planBackward
);
// transform into local repr.
updateLocalImage
();
updateLocalImage
();
//position
}
}
...
...
This diff is collapsed.
Click to expand it.
src/QuantumMath.cpp
+
8
−
8
View file @
1d753bb0
...
@@ -7,26 +7,26 @@
...
@@ -7,26 +7,26 @@
#include
"QuantumMath.hpp"
#include
"QuantumMath.hpp"
const
double
xAt
(
unsigned
i
)
const
double
xAt
(
int
i
)
{
{
return
(
i
-
(
int
)
nx
/
2
)
*
dx
;
return
(
(
int
)
i
-
(
int
)
nx
/
2
)
*
dx
;
}
}
const
double
yAt
(
unsigned
iy
)
const
double
yAt
(
int
iy
)
{
{
return
(
iy
-
(
int
)
ny
/
2
)
*
dy
;
return
(
(
int
)
iy
-
(
int
)
ny
/
2
)
*
dy
;
}
}
const
double
pxAt
(
unsigned
ix
)
const
double
pxAt
(
int
ix
)
{
{
if
(
ix
>
(
int
)
nx
/
2
)
if
(
(
int
)
ix
>
(
int
)
nx
/
2
)
ix
-=
(
int
)
nx
;
ix
-=
(
int
)
nx
;
return
ix
*
2.0
*
M_PI
*
hbar
/
(
nx
*
dx
);
return
ix
*
2.0
*
M_PI
*
hbar
/
(
nx
*
dx
);
}
}
const
double
pyAt
(
unsigned
iy
)
const
double
pyAt
(
int
iy
)
{
{
if
(
iy
>
(
int
)
ny
/
2
)
if
(
(
int
)
iy
>
(
int
)
ny
/
2
)
iy
-=
(
int
)
ny
;
iy
-=
(
int
)
ny
;
return
iy
*
2.0
*
M_PI
*
hbar
/
(
ny
*
dy
);
return
iy
*
2.0
*
M_PI
*
hbar
/
(
ny
*
dy
);
}
}
This diff is collapsed.
Click to expand it.
src/QuantumMath.hpp
+
4
−
4
View file @
1d753bb0
...
@@ -38,13 +38,13 @@ const double dy = 2.0 / ny;
...
@@ -38,13 +38,13 @@ const double dy = 2.0 / ny;
///
///
/// @brief Get index to access array in local representation.
/// @brief Get index to access array in local representation.
///
///
const
double
xAt
(
unsigned
i
);
const
double
xAt
(
int
i
);
const
double
yAt
(
unsigned
iy
);
const
double
yAt
(
int
iy
);
///
///
/// @brief Get index to access array in impulse representation.
/// @brief Get index to access array in impulse representation.
///
///
const
double
pxAt
(
unsigned
ix
);
const
double
pxAt
(
int
ix
);
const
double
pyAt
(
unsigned
iy
);
const
double
pyAt
(
int
iy
);
#endif
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment