File: groundstate_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 (184 lines) | stat: -rw-r--r-- 4,997 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
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8"?>
<simulation xmds-version="2">
  <testing>
    <xsil_file name="groundstate.xsil" expected="groundstate_expected.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
    <xsil_file name="groundstate_break.xsil" expected="groundstate_expected_break.xsil" absolute_tolerance="1e-7" relative_tolerance="1e-5" />
  </testing>
  
  <name>groundstate</name>
  <author>Graham Dennis</author>
  <description>
    Calculate the ground state of a negative gaussian potential.
  </description>
  
  <features>
    <auto_vectorise />
    <benchmark />
    <bing />
    <fftw plan="patient" />
  </features>
  
  <geometry>
    <propagation_dimension> t </propagation_dimension>
    <transverse_dimensions>
      <dimension name="y" lattice="1024"  domain="(-12.0, 12.0)" />
    </transverse_dimensions>
  </geometry>
  
  <vector name="potential" initial_basis="y" type="complex">
    <components>
      V1
    </components>
    <initialisation>
      <![CDATA[
        double Vtrap = -exp(-y*y);
      
        V1  = -i*Vtrap;
      
      ]]>
    </initialisation>
  </vector>
  
  <vector name="wavefunction" initial_basis="y" type="complex">
    <components>
      phi
    </components>
    <initialisation>
      <![CDATA[
      
      // This will be automatically normalised later
      phi = exp(-y*y);
      ]]>
    </initialisation>
  </vector>
  
  <computed_vector name="normalisation" dimensions="" type="double">
    <components> Ncalc </components>
    <evaluation>
      <dependencies fourier_space="y">wavefunction</dependencies>
      <![CDATA[
        // Calculate the current normalisation of the wave function.
        Ncalc = mod2(phi);
      ]]>
    </evaluation>
  </computed_vector>
  
  <sequence>
    <integrate algorithm="RK4" interval="1.0" steps="1000">
      <samples>50 50 50</samples>
      <filters>
        <filter>
          <dependencies>wavefunction normalisation</dependencies>
          <![CDATA[
            // Correct normalisation of the wavefunction
            phi *= sqrt(1.0/Ncalc);
          ]]>
        </filter>
      </filters>
      <operators>
        <operator kind="ip" constant="yes">
          <operator_names>T</operator_names>
          <![CDATA[
            T = -0.5*ky*ky;
          ]]>
        </operator>
        <integration_vectors>wavefunction</integration_vectors>
        <dependencies>potential</dependencies>
        <![CDATA[
          dphi_dt = T[phi] - (i*V1)*phi;
        ]]>
      </operators>
    </integrate>
    <breakpoint filename="groundstate_break.xsil">
      <dependencies>wavefunction potential</dependencies>
    </breakpoint>
  </sequence>
  <output format="binary">
    <group>
      <sampling initial_sample="no">
        <dimension name="y" />
        <moments>dens</moments>
        <dependencies>wavefunction</dependencies>
        <![CDATA[
          dens = mod2(phi);
        ]]>
      </sampling>
    </group>
    <group>
      <sampling initial_sample="no">
        <moments>N</moments>
        <dependencies>normalisation</dependencies>
        <![CDATA[
          N = Ncalc;
        ]]>
      </sampling>
    </group>
    <group>
      <sampling initial_sample="no">
        <moments>N</moments>
        <dimension name="y" lattice="0" />
        <dependencies>wavefunction</dependencies>
        <![CDATA[
          N = mod2(phi);
        ]]>
      </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">2</Param>
  <Array Name="variables" Type="Text">
    <Dim>3</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
t y dens 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>50</Dim>
    <Dim>1024</Dim>
    <Dim>3</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="LittleEndian"/>
groundstate_expected_mg0.dat
    </Stream>
  </Array>
</XSIL>

<XSIL Name="moment_group_2">
  <Param Name="n_independent">1</Param>
  <Array Name="variables" Type="Text">
    <Dim>2</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
t N 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>50</Dim>
    <Dim>2</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="LittleEndian"/>
groundstate_expected_mg1.dat
    </Stream>
  </Array>
</XSIL>

<XSIL Name="moment_group_3">
  <Param Name="n_independent">1</Param>
  <Array Name="variables" Type="Text">
    <Dim>2</Dim>
    <Stream><Metalink Format="Text" Delimiter=" \n"/>
t N 
    </Stream>
  </Array>
  <Array Name="data" Type="double">
    <Dim>50</Dim>
    <Dim>2</Dim>
    <Stream><Metalink Format="Binary" UnsignedLong="uint32" precision="double" Type="Remote" Encoding="LittleEndian"/>
groundstate_expected_mg2.dat
    </Stream>
  </Array>
</XSIL>
</simulation>