forked from antimatter-gravity-iit/interferometer_simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
132 lines (97 loc) · 6.61 KB
/
INSTALL
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
Interferometer simulation
=========================
Copyright (C) 2016 Antimatter Gravity Interferometer Group, Illinois Institute of Technology (IIT).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Installing the interferometer simulation program from source
============================================================
Prerequisites
------------------------------------------------------------
In a nutshell, this interferometer simulation program needs:
* GCC (and G++) version 5.4.0 or higher (possibly);
* ROOT v6.06.02 or higher (possibly).
This program has been compiled using the C++11 standard. It is possible that other standards of the C++ language will
also work, but that hasn't been tested so far. Also, the program uses libraries from the ROOT data analysis framework
for plotting graphs, so you will need to have ROOT installed on your system.
The GCC/G++ compiler is maintained by the GCC team; installation instructions are available at https://gcc.gnu.org/install/.
GCC and G++ 5.4.0 are copyright (C) 2015 Free Software Foundation, Inc.
ROOT was originally developed at CERN by Rene Brun and Fons Rademakers. ROOT is distribted under the GNU Lesser General
Public License version 2.1.
Build configuration
------------------------------------------------------------
The Makefile that builds the program (step 2 below) is currently configured to use GCC (and G++) version 5. You can
edit it if you want to use another version, but that is currently untested. Also, the Makefile looks for ROOT
under the directory /usr/local. If ROOT is installed in a different location on your system, you'll need to manually
set the ROOT constant inside the Makefile to point to the correct path where ROOT is installed.
The relevant lines in the Makefile are:
CC = gcc-5
CXX = g++-5
(...)
ROOT = /usr/local
Check where ROOT is installed and replace "/usr/local" with the correct path.
Again, it's not tested yet, but if you want to use a different compiler version, you can replace the values of CC and CXX
with whatever commands you use to run GCC and G++.
Basic build
------------------------------------------------------------
You can build the interferometer simulation from the source files and run it in 5 easy steps:
1. Download or clone the Git repository located at https://github.com/antimatter-gravity-iit/interferometer_simulation.
If you've downloaded it as a compressed file, extract the contents before proceeding.
Say the path to the directory where you placed the compressed file or where you executed the "git clone" command is
/<path>/<to>/<directory>. Inside there should now be a directory called "interferometer_simulation" (without the quotes),
unless you specified a different name.
2. Enter the new directory; its path should be /<path>/<to>/<directory>/interferometer_simulation. Inside it you'll find
another directory called "source" (without the quotes). Enter it and examine its contents; you should see a bunch of .c, .h
and .cpp source code files, and another file called simply Makefile.
3. Type the command "make" (without the quotes) into the terminal and hit enter. After the compiling is done you should see
two new executable files in the "source" directory called "program" and "sptest". If this is true, hooray! You've built the
program succesfully. If it doesn't work, check the build configuration section above.
4. Run the "sptest" program with the terminal command "./sptest" (without the quotes). You should see a ROOT window show up
with some test plot in it. Click "File>>Quit ROOT" in this window to continue. Repeat until no more windows show up.
5. If the previous step ran smoothly, you're ready to go! To run the program, use the command "./program" followed by
the values you want to input into it. See section "Running the simulation" below for more information.
Other build options
------------------------------------------------------------
These are all the targets you can supply to the "make" command (step 3 above):
all builds the usual program plus the test program (default)
program builds the usual program only
sptest builds a test program for SimplePlot Misc.c BeamParams.c Gratings.c PhaseShifts.c
debug_program builds usual program with added debugging information (necessary for gdb) and extra warnings
debug_sptest builds test program with added debugging information and extra warnings
debug builds all with debugging information
clean removes output files (executables)
For example; running "make sptest" only creates the test program, while "make clean" removes the executable files.
Running the simulation
============================================================
Beam propagating through the gratings (side view):
------------------------------------------------------------
x axis (vertical)
^
| z = 1 micron z = 4.5 cm z = 9.0 cm
|
| || || ||
| || || ||
| || || ||
| --||----------||----------||----->
| --||----------||----------||----->
| --||----------||----------||----->
| || || ||
| || || ||
| || || ||
|
======================================> z axis (beam direction)
Command-line arguments
------------------------------------------------------------
The program takes the following simulation parameters as input:
* 1. Account for gravity? 1 = True, 0 = False.
* 2. Account for Van der Waals interactions? 1 = True, 0 = False.
* 3. Resolution [300-400 recommended].
* 4. Velocity of particles in m/s.
* 5. Pitch of gratings [in nm]
* 6. Output the total simulation [1]? or the final interference pattern [2]?
* 7. (if argv[6] == 1), logscale [1] or normal scale [0]?
When running the executable file with the "./" shell command, you must supply the arguments in the order above, with blank
spaces between them. For example: if you want a full simulation of 6300 m/s fast atom beam interferometry, plotted with
a logarithmic intensity scale, accounting for gravity and Van der Waals interactions, with a resolution of 300 pixels
and a grating pitch of 100 nm, you have to type "./program 1 1 300 6300 100 1 1" in your terminal. Yup.
After the program runs (it can take several minutes) you should be shown a ROOT plot with the simulation,
which you can save as a pdf (or a variety of other file types) by clicking "File>>Save as..." in the ROOT window. Done!