GTPhMPBFields[file,object]
is used to read a electromagnetic field component from file defined by an object, calculated by MPB.
GTPhMPBFields
GTPhMPBFields[file,object]
is used to read a electromagnetic field component from file defined by an object, calculated by MPB.
Details and Options
- MPB calculates the electromagnetic fields. Each mode at a certain k-point is stored in a separte file. Before reading a file it has to be treated with the programm mpb-data, which comes with the MPB package. Details of the preparation of the electromagnetic fields by mpb-data can be found at: http://ab-initio.mit.edu/wiki/index.php/MPB_Data_Analysis_Tutorial. Finally GTPhMPBFields transforms the output of MPB, which is in hdf5 format, in a useful format for the symmetry analysis.
- Before the symmetry analysis can be done, a correction of the boundary of the image has to be performed (GOTransformation=True). To calculate the phase factors correctly the real and imaginary parts of the field as well as the Bloch wavevector are necessary.
- The following options can be given:
-
GOPlot False Plots a contour plot of the corresponding field component GOTransformation False Transforms of datafor symmetry analysis GOStore 0 Writes output to file - See: W. Hergert, M. Geilhufe, Group Theory in Solid State Physics and Photonics. Problem Solving with Mathematica, chapter 11.2
- J. D. Joannopoulos, S. G. Johnson, J. N. Winn, R. D. Meade, Photonic Crystals. Molding the flow of light, Princton 2008, p.70
Examples
open all close allBasic Examples (1)
Needs["GroupTheory`"]SetDirectory[NotebookDirectory[] <> "datasets/MPB/"];The example of a square array of dielectric columns (see Joannopoulos et al., p. 70) with
a is used. The permittivity is set to
(alumina). The electric fields are calculated for the eight lowest bands at the symmetry point
.
If object is set to “Datasets”, the data sets in the hdf5 file are listed.
GTPhMPBFields["e.k01.b02.z.tm.h5", "Datasets"]data = GTPhMPBFields["e.k01.b02.z.tm.h5", {"Bloch wavevector", "z.r-new"}, GOPlot -> True]Options (3)
GOPlot (1)
The field can also be plotted directly.
GTPhMPBFields["e.k01.b02.z.tm.h5", {"Bloch wavevector", "z.r-new"}, GOPlot -> True]g = {};Do[gr = GTPhMPBFields["e.k01.b0" <> ToString[i] <> ".z.tm.h5", {"Bloch wavevector", "z.r-new"}, GOPlot -> True];g = Append[g, gr], {i, 1, 8}]Partition[g, 4]GOStore (1)
GTPhMPBFields["e.k01.b02.z.tm.h5", {"Bloch wavevector", "z.i-new", "z.r-new"}, GOStore -> "test1.dat", GOTransformation -> True];The data can be plotted with standard plot methods of Mathematica. The ColorFunction of the package can be substituted by another ColorFunction.
{kp, field} = GTReadFromFile["test1.dat"];ListDensityPlot[Re[field], ColorFunction -> GTBlueRed]ListDensityPlot[Im[field], ColorFunction -> GTBlueRed]ListDensityPlot[Abs[field], ColorFunction -> GTBlueRed]GOTransformation (1)
data = GTPhMPBFields["e.k01.b02.z.tm.h5", {"Bloch wavevector", "z.r-new", "z.i-new"}, GOPlot -> True, GOTransformation -> True]