Esempio n. 1
0
        void WriteBands(TightBinding tb, KptList kpts, StreamWriter w)
        {
            int bandCount = kpts.Kpts[0].Wavefunctions.Count;


            BandTetrahedron tet = null;

            for (int i = 0; i < tb.KPath.Kpts.Count; i++)
            {
                var kpt = tb.KPath.Kpts[i];

                if (tet == null || tet.Contains(kpt) == false)
                {
                    GetTetrahedron(tb, kpt, kpts);
                }

                w.Write(i);
                w.Write("   ");

                for (int band = 0; band < bandCount; band++)
                {
                    double energy = tet.Interpolate(kpt);

                    w.Write("{0}  ", energy);
                }

                w.WriteLine();
            }
        }
Esempio n. 2
0
        BandTetrahedron GetTetrahedron(TightBinding tb, KPoint kpt, KptList kpts)
        {
            List <Pair <int, double> > lst = new List <Pair <int, double> >();

            double[] weights = new double[kpts.Kpts.Count];
            for (int j = 0; j < kpts.Kpts.Count; j++)
            {
                double distance = CalcDistance(tb, kpts.Kpts[j].Value, kpt.Value);

                weights[j] = 1 / (distance + 0.00001);
            }

            for (int j = 0; j < weights.Length; j++)
            {
                lst.Add(new Pair <int, double>(j, weights[j]));
            }

            lst.Sort((x, y) => { return(y.Second.CompareTo(x.Second)); });

            lst.RemoveRange(4, lst.Count - 4);
            List <int> ilist = lst.Select(x => x.First).ToList();

            BandTetrahedron retval = new BandTetrahedron(tb, kpt.Value, kpts, ilist);

            return(retval);
        }
Esempio n. 3
0
        BandTetrahedron GetTetrahedron(TightBinding tb, KPoint kpt, KptList kpts)
        {
            List<Pair<int, double>> lst = new List<Pair<int, double>>();

            double[] weights = new double[kpts.Kpts.Count];
            for (int j = 0; j < kpts.Kpts.Count; j++)
            {
                double distance = CalcDistance(tb, kpts.Kpts[j].Value, kpt.Value);

                weights[j] = 1 / (distance + 0.00001);
            }

            for (int j = 0; j < weights.Length; j++)
            {
                lst.Add(new Pair<int, double>(j, weights[j]));
            }

            lst.Sort((x,y) => { return y.Second.CompareTo(x.Second); });

            lst.RemoveRange(4, lst.Count - 4);
            List<int> ilist = lst.Select(x => x.First).ToList();

            BandTetrahedron retval = new BandTetrahedron(tb, kpt.Value, kpts, ilist);

            return retval;
        }