File: hermitegauss_transform_2d_expected.xsil

package info (click to toggle)
xmds2 3.1.0%2Bdfsg2-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 42,580 kB
  • sloc: python: 64,048; cpp: 4,868; ansic: 1,463; makefile: 144; sh: 54; javascript: 8
file content (172 lines) | stat: -rw-r--r-- 5,219 bytes parent folder | download | duplicates (7)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8"?>
<simulation xmds-version="2">
  <testing>
    <xsil_file name="hermitegauss_transform_2d.xsil" expected="hermitegauss_transform_2d_expected.xsil" absolute_tolerance="1e-8" relative_tolerance="1e-5" />
  </testing>

  <name>hermitegauss_transform_2d</name>
  <author>Graham Dennis</author>
  <description>
    Solve the Schroedinger equation in 2D using the hermite-Gauss basis.
  </description>
  
  <features>
    <benchmark />
    <!-- <error_check /> -->
    <bing />
    <!-- <fftw plan="estimate" /> -->
    <mmt />
    <validation kind="run-time" />
    <globals>
      <![CDATA[
        const double M = 9.1e-31; // Mass of an electron
        const double hbar = 1.05e-34;
        const double omega = 2*M_PI*1e3;
        const double offset = 1.0 * sqrt(hbar/(M*omega));
        
      ]]>
    </globals>
  </features>
  
  <geometry>
    <propagation_dimension> t </propagation_dimension>
    <transverse_dimensions>
      <dimension name="x" lattice="20" length_scale="sqrt(hbar/(M*omega))" transform="hermite-gauss" />
      <dimension name="y" lattice="20" length_scale="sqrt(hbar/(M*omega))" transform="hermite-gauss" />
    </transverse_dimensions>
  </geometry>
  
  <vector name="main" initial_basis="x y" type="complex">
    <components>
      psi
    </components>
    <initialisation>
      <![CDATA[
        // initial state is the groundstate in the x axis, but shifted by offset
      psi = pow(M*omega/(hbar*M_PI), 0.25) * exp(-0.5*(M*omega/hbar)*(x - offset)*(x - offset));
        // and an expanded gaussian in the y axis
      psi *= pow(M*omega/(hbar*M_PI), 0.25) * exp(-0.25*(M*omega/hbar)*y*y);
      ]]>
    </initialisation>
  </vector>
  
  <computed_vector name="normalisation" dimensions="" type="double">
    <components>N integral_y2</components>
    <evaluation>
      <dependencies>main</dependencies>
      <![CDATA[
        N = mod2(psi);
        integral_y2 = mod2(psi)*y*y;
      ]]>
    </evaluation>
  </computed_vector>
  
  <sequence>
    <integrate algorithm="ARK45" tolerance="1e-6" interval="1e-3" steps="400">
      <samples>10 1 100</samples>
      <operators>
        <operator kind="ip" constant="yes" fourier_space="nx ny">
          <operator_names>L</operator_names>
          <![CDATA[
            L = -i*(nx + ny + 1.0)*omega;
          ]]>
        </operator>
        <integration_vectors>main</integration_vectors>
        <![CDATA[
          dpsi_dt = L[psi];
        ]]>
      </operators>
    </integrate>
  </sequence>
  <output format="binary">
      <sampling_group initial_sample="yes">
        <dimension name="x" fourier_space="no" />
        <dimension name="y" fourier_space="no" />
        <moments>dens</moments>
        <dependencies>main</dependencies>
        <![CDATA[
          dens = mod2(psi);
        
        ]]>
      </sampling_group>
      <sampling_group initial_sample="no">
        <dimension name="x" fourier_space="yes" />
        <dimension name="y" fourier_space="yes" />
        <moments>dens</moments>
        <dependencies>main</dependencies>
        <![CDATA[
          dens = mod2(psi);
        
        ]]>
      </sampling_group>
      <sampling_group initial_sample="yes">
        <dimension name="x" lattice="0" />
        <dimension name="y" lattice="0" />
        <moments>mean_x mean_sigmay</moments>
        <dependencies>main normalisation</dependencies>
        <![CDATA[
          mean_x = mod2(psi)*x/N;
          mean_sigmay = sqrt(integral_y2/N);
        ]]>
      </sampling_group>
  </output>

<info>
Script compiled with xpdeint version VERSION_PLACEHOLDER (SUBVERSION_REVISION_PLACEHOLDER)
See http://www.xmds.org for more information.
</info>

<XSIL Name="moment_group_1">
  <Param Name="n_independent">3</Param>
  <Array Name="variables" Type="Text">
    <Dim>4</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
t x y dens 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>11</Dim>
    <Dim>20</Dim>
    <Dim>20</Dim>
    <Dim>4</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="BigEndian"/>
hermitegauss_transform_2d_expected_mg0.dat
    </Stream>
  </Array>
</XSIL>

<XSIL Name="moment_group_2">
  <Param Name="n_independent">2</Param>
  <Array Name="variables" Type="Text">
    <Dim>3</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
nx ny dens 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>20</Dim>
    <Dim>20</Dim>
    <Dim>3</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="BigEndian"/>
hermitegauss_transform_2d_expected_mg1.dat
    </Stream>
  </Array>
</XSIL>

<XSIL Name="moment_group_3">
  <Param Name="n_independent">1</Param>
  <Array Name="variables" Type="Text">
    <Dim>3</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
t mean_x mean_sigmay 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>101</Dim>
    <Dim>3</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="BigEndian"/>
hermitegauss_transform_2d_expected_mg2.dat
    </Stream>
  </Array>
</XSIL>
</simulation>