Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:OurMaths.GPESolver"/> class
        /// with all necassary definitons and no extern input.
        /// </summary>
        public GPESolver()
        {
            // Physical Defintion
            mass = 87 * PhysConst.amu;                                      // mass of rubidium
            aSc  = 5.8 * Math.Pow(10, -9);                                  // Scattering Length
            N    = 1000;                                                    // Atom number
            wX   = 40 * 2 * Math.PI;                                        // trap freq
            lX   = Math.Sqrt(PhysConst.hbar / (mass * wX));                 // ho length of trap
            wR   = 100 * 2 * Math.PI;                                       // radial trap freq
            lR   = Math.Sqrt(PhysConst.hbar / (mass * wR));                 // ho length of trap

            g1D = 2 * Math.Pow(PhysConst.hbar, 2) * aSc / (mass * lR * lR); // 1D interaction coefficient


            // Grid definitions
            xSteps    = 512;                                    // number of points in real space, power of two
            kSteps    = xSteps;                                 // number of points in momentum space
            deltaX    = 2 * Math.Pow(10, -7);                   // distance between points in real space
            deltaK    = 2 * Math.PI / ((xSteps - 1) * deltaX);  //distance between points in momentum space
            deltaT    = Math.Pow(10, -6);                       // time intervall
            timeSteps = 100;                                    // number of timesteps

            // create Grids
            X = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                X[i] = (i - xSteps / 2 + 1) * deltaX;
            }
            V = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                V[i] = 0.5 * mass * wX * wX * X[i] * X[i] / PhysConst.hbar;
            }
            K = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                K[i] = (i - xSteps / 2 + 1) * deltaK;
            }

            // preparation for bitReversal
            reversedBits = new uint[xSteps];
            for (uint i = 0; i < xSteps; i++)
            {
                reversedBits[i] = FFT.BitReverse(i, (int)Math.Log(xSteps, 2));
            }

            // create Starting wave function
            psi = new ComplexNumber[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                psi[i] = Math.Sqrt(N / lX) * Math.Pow(Math.PI, -0.25) * Math.Exp(-X[i] * X[i] / (2.2 * lX * lX));
            }
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:OurMaths.GPESolver"/> class
        /// with basic definitions and external input.
        /// </summary>
        /// <param name="atomMass">Atom mass.</param>
        /// <param name="numberOfAtoms">Number of atoms.</param>
        /// <param name="scatteringlength">Scatteringlength.</param>
        /// <param name="wx">Wx.</param>
        /// <param name="wr">Wr.</param>
        public GPESolver(double atomMass, int numberOfAtoms, double scatteringlength, double wx, double wr)
        {
            // Physical Defintion
            mass = atomMass;                                                // mass of an atom
            aSc  = scatteringlength;                                        // Scattering Length
            N    = numberOfAtoms;                                           // Atom number
            wX   = wx;                                                      // trap freq
            lX   = Math.Sqrt(PhysConst.hbar / (mass * wX));                 //ho length of trap
            wR   = wr;                                                      // radial trap freq
            lR   = Math.Sqrt(PhysConst.hbar / (mass * wR));                 // ho length of trap

            g1D = 2 * Math.Pow(PhysConst.hbar, 2) * aSc / (mass * lR * lR); // 1D interaction coefficient


            /// Grid definitions


            xSteps    = 512;                                    // number of points im Ortsraum; power of two
            kSteps    = xSteps;                                 // number of points in momentum space
            deltaX    = 2 * Math.Pow(10, -7);                   // distance between points im Ortsraum
            deltaK    = 2 * Math.PI / ((xSteps - 1) * deltaX);  //distance between points in momentum space
            deltaT    = Math.Pow(10, -6);                       // time intervall
            timeSteps = 10000;                                  // Anzahl der Zeitentwicklungsschritte

            // create Grids
            X = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                X[i] = (i - xSteps / 2 + 1) * deltaX;
            }
            V = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                V[i] = 0.5 * mass * wX * wX * X[i] * X[i] / PhysConst.hbar;
            }
            K = new double[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                K[i] = (i - xSteps / 2 + 1) * deltaK;
            }

            // prepare for bitReversal
            reversedBits = new uint[xSteps];
            int a     = 0;
            int findA = xSteps;

            while (findA > 1)
            {
                findA = findA >> 1;
                a++;
            }
            for (uint i = 0; i < xSteps; i++)
            {
                reversedBits[i] = FFT.BitReverse(i, a);
            }


            // create Starting wave function
            psi = new ComplexNumber[xSteps];
            for (int i = 0; i < xSteps; i++)
            {
                psi[i] = Math.Sqrt(N / lX) * Math.Pow(Math.PI, -0.25) * Math.Exp(-X[i] * X[i] / (2.2 * lX * lX));
            }
        }