Commit 004b31cc authored by Éamonn Murray's avatar Éamonn Murray

Minor text change

parent 2ca0f095
......@@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
......@@ -43,9 +41,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Let's start with a function that generates some oscillating data using a sin\n",
......@@ -91,9 +87,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Now let's define a function for the forward transformation\n",
......@@ -113,9 +107,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Initialize and plot our sampled data\n",
......@@ -164,9 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"samples_a = vib_data1(num_points=20, freq=0.1, phase=0.0, timestep=1.0)\n",
......@@ -189,9 +179,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"samples_a = vib_data1(num_points=2000, freq=0.1, phase=0.0, timestep=0.01)\n",
......@@ -224,7 +212,7 @@
"\n",
"Look at the implementation of the discrete Fourier transform above. You can see that as we have a double nested loop, each with $N$ elements, the implementation will scale with O($N^2$).\n",
"\n",
"The Fast Fourier Transform (FFT) algorithm is based on a clever reorganisation of the nested sum that improves the scaling to O($N\\log N$). The method originally relied on $N$ being a power of 2 so that the summation could be repeatedly broken down into smaller parts. It has been steadily generalized since then, so that even prime values of $N$ can achieve O($N\\log N$) scaling.\n",
"The Fast Fourier Transform (FFT) algorithm is based on a clever reorganisation of the nested sum that improves the scaling to $\\mathrm{O}(N\\log N$). The method originally relied on $N$ being a power of 2 so that the summation could be repeatedly broken down into smaller parts. It has been steadily generalized since then, so that even prime values of $N$ can achieve O($N\\log N$) scaling.\n",
"\n",
"The FFT will produce exactly the same output as the naive implementation above, but allows significantly larger data sets to be used.\n",
"\n",
......@@ -245,9 +233,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"n = 20; f= 0.1; p = np.pi * 0; t = 1;\n",
......@@ -290,9 +276,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import scipy.fftpack\n",
......@@ -343,7 +327,7 @@
"\n",
"If we have some distribution of electrons $n(r)$ in a periodic system, it's common to calculate the their electrostatic interaction with each other as a single term contributing to the total energy of the system (along with several other terms depending on what method is being used). This is usually referred to as the Hartree term and is given by:\n",
"$$ E_\\mathrm H = \\frac{1}{2} \\int \\int \\frac{n(\\mathbf r) n(\\mathbf r')}{|\\mathbf r-\\mathbf r'|}\n",
"\\mathbf d\\mathbf r \\mathbf d\\mathbf r' $$\n",
"\\mathbf d\\mathbf r \\mathbf d\\mathbf r'. $$\n",
"\n",
"As you might imagine, this term when considered in isolation, diverges since it only considers the negative electrons and we have a periodic (infinitely repeating) system. You can see this if you consider a one dimensional system consisting of a chain of equal charges, $q$, per cell of dimension $a$, and each charge at position $x$ within its cell. The energy of these charges interacting with each other if we consider $N$ neighbouring cells is given by\n",
"$$ E_e = \\frac{1}{2} \\Sigma_{i=1}^N \\Sigma_{j=1,j\\ne i}^N \\frac{q^2}{|x_i - x_j|}\n",
......@@ -394,7 +378,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.5.3"
}
},
"nbformat": 4,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment