-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathoutput.cpp
More file actions
68 lines (57 loc) · 1.55 KB
/
output.cpp
File metadata and controls
68 lines (57 loc) · 1.55 KB
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
//
// output.cpp
// SPT
//
// Created by Bin Xu on 9/5/14.
// Copyright (c) 2014 Bin Xu. All rights reserved.
//
#include "output.h"
////////////////////////////////////////////////////////////////////////////////
// Output functions
////////////////////////////////////////////////////////////////////////////////
ostream& operator<<(ostream& os, Pxy& p)
{
os << "Px = " << p.px << "\tPy = " << p.py;
return os;
}
ostream& operator<<(ostream& os, const Pxy& p)
{
os << "Px = " << p.px << "\tPy = " << p.py;
return os;
}
ostream& operator<<(ostream& os, Orbital& orb)
{
os << "Px = " << orb.p.px << "\tPy = " << orb.p.py\
<< "\t Spin: " << (int)orb.spin;
return os;
}
ostream& operator<<(ostream& os, const Orbital& orb)
{
os << "Px = " << orb.p.px << "\tPy = " << orb.p.py\
<< "\t Spin is " <<(int)orb.spin;
return os;
}
ostream& operator<<(ostream& os, CompactState& cstate)
{
for (int i = 0; i < cstate.size(); i++)
{
os<<cstate[i];
}
return os;
}
ostream& operator<<(ostream& os, OrbPair& pair)
{
const char up[] = "\xe2\x88\x86";
const char down[] = "\xe2\x88\x87";
os << "Orbital "<<" : ( " << pair.orb1.p.px << ", " << pair.orb1.p.py <<\
" )\t" << (pair.orb1.spin == 1 ? up : down) << "\tOrbital "<<\
" : ( " << pair.orb2.p.px << ", " << pair.orb2.p.py << " )\t" <<\
(pair.orb2.spin == 1 ? up : down);
return os;
}
ostream& operator<<(ostream & os, MatEle & mat_ele)
{
os << "<" << mat_ele.bra << "|H|" << mat_ele.ket << "> = "\
<< mat_ele.amplitude;
return os;
}