-
Notifications
You must be signed in to change notification settings - Fork 6
/
PsimagLiteFp0.tex
254 lines (230 loc) · 5.78 KB
/
PsimagLiteFp0.tex
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
\documentclass[twocolumn]{article}
\usepackage{booktabs}
\usepackage{marginnote}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\begin{document}
\title{PsimagLite Feature Proposal:
Input System}
\author{G.A.}
\maketitle
\section{Lexical}
ASCII.
Define EOF, whitespace, and EOL.
Comments: \verb!#! until EOL
Tokens + Strings Literals + Other literals
Keywords: Types: integer, real, complex, char, string, function, vector, matrix.
Attributes: require const. Properties: defined, typeof.
\begin{verbatim}
require integer a;
# declare pi, make pi value constant
const real pi = 3.1415927;
pi = 3.14; # ERROR, pi constant
#
integer b = 3;
b = 4; # OK
b = 3.5; # ERROR, not integer
#
c = 3.5; # ERROR c undefined
\end{verbatim}
\subsection{Strings and Characters}
\begin{verbatim}
string s="Hello, ";
char c = 'W';
s = s + c + "orld!";
string d = "'";
char e = '"';
\end{verbatim}
Properties: \verb!s.length! \verb!s[0]!
\subsection{Scalars}
\begin{verbatim}
integer a=1; # defines int scalar
complex b=3*i + 1.2; # defines complex scalar
a = a + 1.5; # OK, a promoted to real
a = a + 1.5*i; # ERROR
b = b + 1.5*i; # OK
\end{verbatim}
\subsection{Vectors}
\begin{verbatim}
vector.integer v=[ 1, 2, 3 ];
vector w=[ 1, a, 3*a ];
vector x=v+w;
vector y = [];
y.size = 4;
# equivalent to y = [ 1, 1 ,1, 1]
y = [1, ... ];
\end{verbatim}
Properties: \verb!v.size! \verb!v[0]!
Vectors values: scalars, strings, and characters.
\subsection{Matrices}
\begin{verbatim}
matrix m = [[0, 1], [1, 0]];
# As vector of vectors
vector v1 = [0,1];
vector v2 = [1,0];
matrix m2 = [v1, v2];
# As a hash
hash m2 = ({ rows : 4, cols : 2, data :
[0, 1, 1, 0, 0, 1, 1, 0] });
matrix m3 = 3.5*m;
\end{verbatim}
Properties: \verb!rows! \verb!cols! \verb!data!.
Matrix values: scalars.
\subsection{Groups}
\begin{verbatim}
groupName={ name="chain";
Connections=[ 1, 1 ];
string a = "my local value"; };
#The above would be lowered to
groupName.name="chain";
groupName.Connections=[ 1, 1 ];
string groupName.a = "my local value";
# Groups can be nested
# Unnamed groups?
\end{verbatim}
\section{Operators and Functions}
\begin{tabular}{lll}\toprule
Op. & Type & Description\\\midrule
$+,-$ & 3, [], [[]] & scalar, vector, matrix\\
$+$ & ``''& str. + str. or str. + char\\
$*,/$ & 3*3, 3/3 & scalar $*$ and $/$\\
$*$ & various & 3*[], 3*[[]], [[]]*[]\\
$*$ & [[]]*[[]] & matrix*matrix = matrix\\
$*$ & []*[] & vector*vector = scalar\\
$**$ & 3$**$2 & $=9$\\
$\%$ & 3\%2 & modulus\\
$[]$ & vectors & entry\\
{[}\textquotedbl\textquotedbl{]} & hashes & value given key\\
(,) & matrices & matrix element\\
\bottomrule\\
\end{tabular}
Operators for binary numbers? User defined operators are not allowed.
User defined functions must be entered as a string in prefix notation.
\begin{verbatim}
# f(t) = 3.5*cos(t)
function f = "*,cos,%t,3.5";
real a = f(0.25); # = 3.3911...
\end{verbatim}
Mathematical functions for scalars:
\texttt{abs, conj, sqrt, exp, log, sin, cos, atan}.
Functions for complex numbers \verb!abs! \verb!real! \verb!imag! \verb!arg!
Example \texttt{real a = 3.5*sin(b);}
Inputs 52 from the TestSuite follows.
\begin{tiny}
\begin{verbatim}
##1.0
TotalNumberOfSites=8;
NumberOfTerms=1;
DegreesOfFreedom=1;
GeometryKind="ladder";
GeometryOptions="ConstantValues";
dir0:Connectors = [1.0];
dir1:Connectors = [0.5];
LadderLeg=2;
Model="HubbardOneBand";
hubbardU = [10, ... ];
potentialV = [0, ...];
SolverOptions="TimeStepTargetting";
Version="4.52";
OutputFile="data52.txt";
InfiniteLoopKeptStates=200;
FiniteLoops = [
[ 3, 400, 0],
[-6, 400, 0],
[ 6, 200, 0]
];
RepeatFiniteLoopsFrom=1;
RepeatFiniteLoopsTimes=5;
TargetElectronsUp=4;
TargetElectronsDown=4;
GsWeight=0.1;
TSPTau=0.1;
TSPTimeSteps=5;
TSPAdvanceEach=6;
TSPAlgorithm="Krylov";
TSPSites = [4, 2];
TSPLoops = [1, 1];
TSPProductOrSum="product";
TSPOperator="expression";
OperatorExpression="c+(-1.0)*c*c?1*c?1'+c?1+(-1.0)*c?1*c*c'";
TSPOperator="expression";
OperatorExpression="c'*c?1*c?1'+c?1'*c*c'";
#ci getTimeObservablesInSitu 2 '<P0|nup|P0>'
#ci getTimeObservablesInSitu 4 '<P0|nup|P0>'
#ci getTimeObservablesInSitu 5 '<P0|nup|P0>'
#ci getTimeObservablesInSitu 2 '<P0|doubleOcc|P0>'
#ci getTimeObservablesInSitu 4 '<P0|doubleOcc|P0>'
#ci getTimeObservablesInSitu 5 '<P0|doubleOcc|P0>'
\end{verbatim}
\end{tiny}
Inputs 340 from the TestSuite follows.
\begin{tiny}
\begin{verbatim}
##1.0
TotalNumberOfSites=8;
Orbitals=2;
NumberOfTerms=3;
gt0={ # gt means geometry term
DegreesOfFreedom=Orbitals;
GeometryKind="ladderx";
GeometryOptions="ConstantValues";
LadderLeg=2;
dir0:Connectors = [ # x-dir
[-0.058, 0],
[0, -0.2196]];
dir1:Connectors = [ # y-dir
[-0.2196, 0],
[0, -0.058]];
dir2:Connectors = [ # x+y
[0.20828, 0.079],
[0.079, 0.20828]];
dir3:Connectors = [ # x-y
[0.20828, -0.079]
[-0.079, 0.20828]];
};
gt1={
DegreesOfFreedom=1;
GeometryKind="ladderx";
GeometryOptions="ConstantValues";
LadderLeg=2;
dir0:Connectors = [0.1];
dir1:Connectors = [0.1];
dir2:Connectors = [0.02];
dir3:Connectors = [0.02];
};
gt2={ # gt means geometry term
DegreesOfFreedom=Orbitals;
GeometryKind="ladderx";
GeometryOptions="ConstantValues";
LadderLeg=2;
dir0:Connectors = [ # x-dir
[-0.058, 0],
[0, -0.2196]];
dir1:Connectors = [ # y-dir
[-0.2196, 0],
[0, -0.058]];
dir2:Connectors = [ # x+y
[0.20828, 0.079],
[0.079, 0.20828]];
dir3:Connectors = [ # x-y
[0.20828, -0.079]
[-0.079, 0.20828]];
};
hubbardU = [0.0, 0.0, 0.0, 0.0];
potentialV = [0, ...32];
Model="FeAsBasedScExtended";
FeAsMode="INT_PAPER33";
SolverOptions="none";
Version="61289987cdd32b8485213ac0415baf4e9cd16432";
OutputFile="data340.txt";
InfiniteLoopKeptStates=60;
FiniteLoops = [
[ 3, 100, 0],
[-3, 100, 0],
[-3, 100, 0],
[ 3, 100, 0]]; # note the abbreviation here
TargetElectronsUp=8;
TargetElectronsDown=TargetElectronsUp;
\end{verbatim}
\end{tiny}
\end{document}