File: export_all_paths_1.xmds

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 (140 lines) | stat: -rw-r--r-- 3,730 bytes parent folder | download | duplicates (3)
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
<simulation xmds-version="2">
  <testing>
    <xsil_file name="export_all_paths_1.xsil" expected="export_all_paths_1_expected.xsil" absolute_tolerance="1e-6" relative_tolerance="1e-6" />
  </testing>

  <name> export_all_paths_1 </name>

  <description>
    Throw in lots of weird output sampling to properly test that the dimensions don't
    get mangled
  </description>

  
  <features>
    <benchmark />
    <auto_vectorise />
    <globals>
      <![CDATA[
        real N = 10.0; // number of atoms
        real g = 1.0;  // nonlinear coupling
      ]]>
    </globals>
  </features>
  
  <geometry>
    <propagation_dimension> t </propagation_dimension>
    <transverse_dimensions>
      <dimension name="x" lattice="20"
                 domain="(-7, 7)" />
	  <dimension name="y" lattice="20"
		  	 	 domain="(-7, 7)" />	
       	  <dimension name="j" lattice="2" type="integer"
       		  	 	 domain="(0, 1)" />	
    </transverse_dimensions>
  </geometry>

  <driver name="multi-path" paths = "8" />

  <vector name="potential" type="real">
    <components> V </components>
    <initialisation>
      <![CDATA[
        V = 0.5*(x*x + y*y);
      ]]>
    </initialisation>
  </vector>
  
  <vector name="wavefunction" type="complex">
    <components> psi </components>
    <initialisation>
      <![CDATA[
        psi = sqrt(N) * pow(M_PI, -0.25) * exp(-(x*x + y*y)/2);
      ]]>
    </initialisation>
  </vector>

  <sequence>
    <integrate algorithm="ARK45" interval="0.628" 
                                 tolerance="1e-5">
      <samples> 2 2 2 2  </samples>
      <operators>

        <operator kind="ip" constant="yes" dimensions="x">
          <operator_names> Tx </operator_names>
          <![CDATA[
            Tx = -i * 0.5 * (kx * kx);
          ]]>
        </operator>

        <operator kind="ip" constant="yes" dimensions="y">
          <operator_names> Ty </operator_names>
          <![CDATA[
            Ty = -i * 0.5 * (ky * ky);
          ]]>
        </operator>
        <operator kind="ip" constant="yes" dimensions="">
          <operator_names> T </operator_names>
          <![CDATA[
            T = -0.2;
          ]]>
        </operator>

        <operator kind="ip" constant="yes" dimensions="j">
          <operator_names> Tj </operator_names>
          <![CDATA[
            Tj = -0.2*j;
          ]]>
        </operator>

        <integration_vectors>
          wavefunction
        </integration_vectors> 
        <dependencies> potential </dependencies>
        <![CDATA[
          dpsi_dt = Tx[psi] + Ty[psi] + T[psi] + Tj[psi] - i * (V + g * mod2(psi)) * psi;
        ]]>
      </operators>
    </integrate>
  </sequence>

  <output format="hdf5">
    <sampling_group initial_sample="yes" basis="x y j" export_all_paths="yes">
      <dependencies> wavefunction </dependencies>
      <moments> psireal </moments>
      <![CDATA[
        psireal = Re(psi);
      ]]>
    </sampling_group>


    <sampling_group initial_sample="yes" basis="kx(10) y(10) j" export_all_paths="yes">
      <dependencies> wavefunction </dependencies>
      <moments> psiimag </moments>
      <![CDATA[
        psiimag = Im(psi);
      ]]>
    </sampling_group>


    <sampling_group initial_sample="yes" basis="kx(0) y(0) j(0)" export_all_paths="yes">
      <dependencies> wavefunction </dependencies>
      <moments> psireal psiimag </moments>
      <![CDATA[
        psireal = Re(psi);
        psiimag = Im(psi);
      ]]>
    </sampling_group>

    <sampling_group initial_sample="yes" basis="kx(0) y(0) j(0)" >
      <dependencies> wavefunction </dependencies>
      <moments> psireal psiimag </moments>
      <![CDATA[
        psireal = Re(psi);
      ]]>
    </sampling_group>


  </output>

</simulation>