Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LanczosPlusPlus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alvarez, Gonzalo
LanczosPlusPlus
Commits
f35bf344
Commit
f35bf344
authored
6 years ago
by
Alvarez, Gonzalo
Browse files
Options
Downloads
Patches
Plain Diff
spectral functions: multiple TSPSites supported
parent
01d3c9b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/sqomega.pl
+11
-10
11 additions, 10 deletions
scripts/sqomega.pl
src/Engine/LanczosDriver1.h
+42
-32
42 additions, 32 deletions
src/Engine/LanczosDriver1.h
with
53 additions
and
42 deletions
scripts/sqomega.pl
+
11
−
10
View file @
f35bf344
...
...
@@ -15,13 +15,10 @@ my $total = readLabel($template,"TotalNumberOfSites");
my
$centralSite
=
int
(
$total
/
2
)
-
1
;
my
@data
;
for
(
my
$i
=
0
;
$i
<
$total
;
++
$i
)
{
my
$input
=
createInput
(
$i
);
if
(
$obs
ne
"
0
")
{
system
("
./lanczos -f
$input
-g
$obs
-s
$spins
&>
$rootInput$i
.comb
");
print
STDERR
"
$0: Created
$rootInput$i
.comb
\n
";
}
my
$input
=
createInput
(
$total
);
system
("
./lanczos -f
$input
-g
$obs
-s
$spins
")
if
(
$obs
ne
"
0
");
for
(
my
$i
=
0
;
$i
<
$total
;
++
$i
)
{
system
("
perl ../scripts/extractOrbitals.pl
$orb1
$orb2
$orbitals
<
$rootInput$i
.comb >
$rootInput$i
.comb2
");
print
STDERR
"
$0: Created
$rootInput$i
.comb2
\n
";
system
("
echo
\"
#SITES
$centralSite
$i
\"
>
$rootInput$i
.cf
");
...
...
@@ -91,10 +88,8 @@ sub readData
sub
createInput
{
my
(
$ind
)
=
@_
;
my
$input
=
"
$rootInput$ind
.inp
";
my
$site1
=
$centralSite
;
my
$site2
=
$ind
;
my
(
$total
)
=
@_
;
my
$input
=
"
$rootInput
.inp
";
open
(
FILE
,
"
<
",
$template
)
or
die
"
$0: Cannot open
$template
: $!
\n
";
open
(
FOUT
,
"
>
",
"
$input
")
or
die
"
$0: Cannot write to
$input
: $!
\n
";
...
...
@@ -112,6 +107,12 @@ sub createInput
}
close
(
FILE
);
my
$c
=
int
(
$total
/
2
)
-
1
;
for
(
my
$i
=
0
;
$i
<
$total
;
++
$i
)
{
print
FOUT
"
TSPSites 2
$c
$i
\n
";
}
close
(
FOUT
);
print
STDERR
"
$0: Created
$input
\n
";
...
...
This diff is collapsed.
Click to expand it.
src/Engine/LanczosDriver1.h
+
42
−
32
View file @
f35bf344
...
...
@@ -61,41 +61,51 @@ void mainLoop3(const ModelType& model,
RealType
Eg
=
engine
.
gsEnergy
();
std
::
cout
.
precision
(
8
);
std
::
cout
<<
"Energy="
<<
Eg
<<
"
\n
"
;
PsimagLite
::
String
filename
=
PsimagLite
::
basenameOf
(
io
.
filename
());
for
(
SizeType
gfi
=
0
;
gfi
<
lanczosOptions
.
gf
.
size
();
gfi
++
)
{
io
.
read
(
lanczosOptions
.
sites
,
"TSPSites"
);
if
(
lanczosOptions
.
sites
.
size
()
==
0
)
throw
std
::
runtime_error
(
"No sites in input file!
\n
"
);
if
(
lanczosOptions
.
sites
.
size
()
==
1
)
lanczosOptions
.
sites
.
push_back
(
lanczosOptions
.
sites
[
0
]);
std
::
cout
<<
"#gf(i="
<<
lanczosOptions
.
sites
[
0
]
<<
",j="
;
std
::
cout
<<
lanczosOptions
.
sites
[
1
]
<<
")
\n
"
;
typedef
PsimagLite
::
ContinuedFraction
<
TridiagonalMatrixType
>
ContinuedFractionType
;
typedef
PsimagLite
::
ContinuedFractionCollection
<
ContinuedFractionType
>
ContinuedFractionCollectionType
;
typename
EngineType
::
VectorStringType
vstr
;
PsimagLite
::
IoSimple
::
Out
ioOut
(
std
::
cout
);
ContinuedFractionCollectionType
cfCollection
(
PsimagLite
::
FREQ_REAL
);
SizeType
norbitals
=
maxOrbitals
(
model
);
for
(
SizeType
orb1
=
0
;
orb1
<
norbitals
;
orb1
++
)
{
for
(
SizeType
orb2
=
orb1
;
orb2
<
norbitals
;
orb2
++
)
{
engine
.
spectralFunction
(
cfCollection
,
vstr
,
lanczosOptions
.
gf
[
gfi
],
lanczosOptions
.
sites
[
0
],
lanczosOptions
.
sites
[
1
],
lanczosOptions
.
spins
,
std
::
pair
<
SizeType
,
SizeType
>
(
orb1
,
orb2
));
SizeType
counter
=
0
;
while
(
true
)
{
try
{
io
.
read
(
lanczosOptions
.
sites
,
"TSPSites"
);
}
catch
(
std
::
exception
&
)
{
break
;
}
if
(
lanczosOptions
.
sites
.
size
()
==
0
)
throw
std
::
runtime_error
(
"No sites in input file!
\n
"
);
if
(
lanczosOptions
.
sites
.
size
()
==
1
)
lanczosOptions
.
sites
.
push_back
(
lanczosOptions
.
sites
[
0
]);
std
::
cout
<<
"#gf(i="
<<
lanczosOptions
.
sites
[
0
]
<<
",j="
;
std
::
cout
<<
lanczosOptions
.
sites
[
1
]
<<
")
\n
"
;
typedef
PsimagLite
::
ContinuedFraction
<
TridiagonalMatrixType
>
ContinuedFractionType
;
typedef
PsimagLite
::
ContinuedFractionCollection
<
ContinuedFractionType
>
ContinuedFractionCollectionType
;
typename
EngineType
::
VectorStringType
vstr
;
PsimagLite
::
IoSimple
::
Out
ioOut
(
filename
+
ttos
(
counter
)
+
".comb"
);
ContinuedFractionCollectionType
cfCollection
(
PsimagLite
::
FREQ_REAL
);
SizeType
norbitals
=
maxOrbitals
(
model
);
for
(
SizeType
orb1
=
0
;
orb1
<
norbitals
;
orb1
++
)
{
for
(
SizeType
orb2
=
orb1
;
orb2
<
norbitals
;
orb2
++
)
{
engine
.
spectralFunction
(
cfCollection
,
vstr
,
lanczosOptions
.
gf
[
gfi
],
lanczosOptions
.
sites
[
0
],
lanczosOptions
.
sites
[
1
],
lanczosOptions
.
spins
,
std
::
pair
<
SizeType
,
SizeType
>
(
orb1
,
orb2
));
}
}
}
ioOut
<<
"#INDEXTOCF "
;
for
(
SizeType
i
=
0
;
i
<
vstr
.
size
();
++
i
)
ioOut
<<
vstr
[
i
]
<<
" "
;
ioOut
<<
"
\n
"
;
cfCollection
.
write
(
ioOut
);
ioOut
<<
"#INDEXTOCF "
;
for
(
SizeType
i
=
0
;
i
<
vstr
.
size
();
++
i
)
ioOut
<<
vstr
[
i
]
<<
" "
;
ioOut
<<
"
\n
"
;
cfCollection
.
write
(
ioOut
);
++
counter
;
}
}
for
(
SizeType
cicji
=
0
;
cicji
<
lanczosOptions
.
cicj
.
size
();
cicji
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment