-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultimode.xmds
110 lines (110 loc) · 3.79 KB
/
multimode.xmds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0"?>
<!--Example Simulations illustrating GEM Storage in Three Level Atom-->
<simulation>
<author>Originally written by G. Hetet, modified by M. Hosseini, and AMCDawes </author>
<!--Each xmds simulation is enclosed within a set of < simulation > tags -->
<error_check>yes</error_check>
<!--Optional. Whether or not to run the simulation at the half-time step as well as at
the full time step and give the difference between the results. Defaults to yes -->
<prop_dim>z</prop_dim>
<!--The propagation dimension of the cross propagating vector-->
<!--In the following part, globals are used to define any numerical constants that
are useful to have globally available to all sections of code-->
<globals>
<![CDATA[
const double g = 1.0;
const double sample_length = 1.0; //Length of the sample
const double time_input = 3; //mm
const double sigma = 1.5;
const double input_height = 1.0; // input pulse height
const double gama = 0.1;
const double eta = 10;
const double timeswitchz = 20.0;
const double N = 30;
]]>
</globals>
<!--The following part is a container for the other information that we are using
to describe the field. If no name is given for the field, it defaults to "main". The vector is
written in terms of the dimensions of the field. It is possible to define other vectors that
are part of the field, but the vector of the field that is integrating is the main vector-->
<field>
<dimensions>t</dimensions>
<lattice>12000</lattice>
<domains>(0.0, 40.0)</domains>
<samples> 1 1 </samples>
<vector>
<name>main</name>
<type> complex </type>
<components> E </components>
E=input_height*exp(-(t-time_input)*(t-time_input)/(sigma*sigma));
</vector>
<!--The CDATA section gives the C code version of what equations of motion
describes.-->
<vector>
<name>cross</name>
<type> complex </type>
<components> alpha </components>
<![CDATA[
alpha = 0.0; //atomic coherence
]]>
</vector>
</field>
<!--In the sequence section we tell xmds how to actually perform the integration
of the field. It may have as many of the other sub-elements as desired to perform the
calculation. An algorithm tag is optional and will default to SIEX for stocastic simulations
and to RK4EX for non-stochastic simulations. The length of the integration interval, the
total number of steps to take, and the number of samples for each output moment to take
within these steps are denoted by the < interval >, < lattice > and < samples > tags
respectively. The differential equation is described in terms of the C language code that
xmds is to use to evolve the solution forward-->
<sequence>
<integrate>
<algorithm> RK4EX </algorithm>
<interval> sample_length </interval>
<lattice> 800 </lattice>
<samples> 400 400 </samples>
<vectors>main cross</vectors>
<![CDATA[
dE_dz=i*N*(alpha);
]]>
<cross_propagation>
<vectors>cross</vectors>
<prop_dim> t </prop_dim>
<![CDATA[
double sw = (t < timeswitchz ? 1.0:-1.0);
dalpha_dt = (-1.0*gama/2.0 - i*sw*eta*(z - sample_length/2))*alpha + i*g*E;
]]>
</cross_propagation>
</integrate>
</sequence>
<!--Output element: The < output > element is just a container for the other tags
that specify what is to be output. The < f ilename > tag (fairly obviously) specifies the
filename of the output data file. This tag is optional and defaults to the simulation name.
The < group > tag contains a description (and to a degree the definition) of the moments
of the output data. -->
<output format="binary">
<group>
<sampling>
<type> complex </type>
<lattice> 400 </lattice><!--fort-->
<moments> probereal probeimag </moments>
<![CDATA[
probereal = real(E);
probeimag = imag(E);
]]>
</sampling>
</group>
<group>
<sampling>
<vectors>main cross</vectors>
<type> complex </type>
<lattice> 400 </lattice><!--fort-->
<moments> alpreal alpimag </moments>
<![CDATA[
alpreal = real(alpha);
alpimag = imag(alpha);
]]>
</sampling>
</group>
</output>
</simulation>