README.md 6.72 KB
Newer Older
Martin Reinecke's avatar
Martin Reinecke committed
1
NIFTy - Numerical Information Field Theory
Jait Dixit's avatar
Jait Dixit committed
2
==========================================
Philipp Arras's avatar
Philipp Arras committed
3
4
[![pipeline status](https://gitlab.mpcdf.mpg.de/ift/nifty/badges/NIFTy_7/pipeline.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty/-/commits/NIFTy_7)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/nifty/badges/NIFTy_7/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/nifty/-/commits/NIFTy_7)
Jait Dixit's avatar
Jait Dixit committed
5

Martin Reinecke's avatar
Martin Reinecke committed
6
**NIFTy** project homepage:
Martin Reinecke's avatar
Martin Reinecke committed
7
[http://ift.pages.mpcdf.de/nifty](http://ift.pages.mpcdf.de/nifty)
Jait Dixit's avatar
Jait Dixit committed
8
9
10
11
12
13

Summary
-------

### Description

Martin Reinecke's avatar
Martin Reinecke committed
14
**NIFTy**, "**N**umerical **I**nformation **F**ield **T**heor<strong>y</strong>", is
Jait Dixit's avatar
Jait Dixit committed
15
a versatile library designed to enable the development of signal
16
17
18
19
inference algorithms that operate regardless of the underlying grids
(spatial, spectral, temporal, …) and their resolutions.
Its object-oriented framework is written in Python, although it accesses
libraries written in C++ and C for efficiency.
Jait Dixit's avatar
Jait Dixit committed
20

Martin Reinecke's avatar
Martin Reinecke committed
21
NIFTy offers a toolkit that abstracts discretized representations of
Jait Dixit's avatar
Jait Dixit committed
22
continuous spaces, fields in these spaces, and operators acting on
23
24
these fields into classes.
This allows for an abstract formulation and programming of inference
Jait Dixit's avatar
Jait Dixit committed
25
algorithms, including those derived within information field theory.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
NIFTy's interface is designed to resemble IFT formulae in the sense
that the user implements algorithms in NIFTy independent of the topology
of the underlying spaces and the discretization scheme.
Thus, the user can develop algorithms on subsets of problems and on
spaces where the detailed performance of the algorithm can be properly
evaluated and then easily generalize them to other, more complex spaces
and the full problem, respectively.

The set of spaces on which NIFTy operates comprises point sets,
*n*-dimensional regular grids, spherical spaces, their harmonic
counterparts, and product spaces constructed as combinations of those.
NIFTy takes care of numerical subtleties like the normalization of
operations on fields and the numerical representation of model
components, allowing the user to focus on formulating the abstract
inference procedures and process-specific model properties.
Jait Dixit's avatar
Jait Dixit committed
41
42
43
44
45
46
47


Installation
------------

### Requirements

Martin Reinecke's avatar
Martin Reinecke committed
48
- [Python 3](https://www.python.org/) (3.6.x or later)
49
- [SciPy](https://www.scipy.org/)
Martin Reinecke's avatar
Martin Reinecke committed
50
51

Optional dependencies:
52
- [DUCC0](https://gitlab.mpcdf.mpg.de/mtr/ducc) for faster FFTs, spherical
Martin Reinecke's avatar
Martin Reinecke committed
53
    harmonic transforms, and radio interferometry gridding support
Martin Reinecke's avatar
Martin Reinecke committed
54
55
- [mpi4py](https://mpi4py.scipy.org) (for MPI-parallel execution)
- [matplotlib](https://matplotlib.org/) (for field plotting)
Jait Dixit's avatar
Jait Dixit committed
56

Martin Reinecke's avatar
Martin Reinecke committed
57
### Sources
Jait Dixit's avatar
Jait Dixit committed
58

Martin Reinecke's avatar
Martin Reinecke committed
59
60
The current version of NIFTy7 can be obtained by cloning the repository and
switching to the NIFTy_7 branch:
Jait Dixit's avatar
Jait Dixit committed
61

Martin Reinecke's avatar
Martin Reinecke committed
62
    git clone https://gitlab.mpcdf.mpg.de/ift/nifty.git
Jait Dixit's avatar
Jait Dixit committed
63

Martin Reinecke's avatar
Martin Reinecke committed
64
### Installation
Jait Dixit's avatar
Jait Dixit committed
65

Martin Reinecke's avatar
Martin Reinecke committed
66
67
In the following, we assume a Debian-based distribution. For other
distributions, the "apt" lines will need slight changes.
Martin Reinecke's avatar
Martin Reinecke committed
68

Martin Reinecke's avatar
Martin Reinecke committed
69
NIFTy7 and its mandatory dependencies can be installed via:
Martin Reinecke's avatar
Martin Reinecke committed
70

Martin Reinecke's avatar
Martin Reinecke committed
71
    sudo apt-get install git python3 python3-pip python3-dev
Martin Reinecke's avatar
Martin Reinecke committed
72
    pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/nifty.git@NIFTy_7
Martin Reinecke's avatar
Martin Reinecke committed
73

Martin Reinecke's avatar
Martin Reinecke committed
74
75
Plotting support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
76
    sudo apt-get install python3-matplotlib
Martin Reinecke's avatar
Martin Reinecke committed
77

78
The DUCC0 package is installed via:
Jait Dixit's avatar
Jait Dixit committed
79

80
    pip3 install ducc0
Martin Reinecke's avatar
switch    
Martin Reinecke committed
81
82

If this library is present, NIFTy will detect it automatically and prefer
83
`ducc0.fft` over SciPy's FFT. The underlying code is actually the same, but
Martin Reinecke's avatar
switch    
Martin Reinecke committed
84
85
DUCC's FFT is compiled with optimizations for the host CPU and can provide
significantly faster transforms.
Jait Dixit's avatar
Jait Dixit committed
86

Martin Reinecke's avatar
Martin Reinecke committed
87
88
MPI support is added via:

Martin Reinecke's avatar
Martin Reinecke committed
89
    sudo apt-get install python3-mpi4py
Martin Reinecke's avatar
Martin Reinecke committed
90

Theo Steininger's avatar
Theo Steininger committed
91
92
### Running the tests

Martin Reinecke's avatar
Martin Reinecke committed
93
94
To run the tests, additional packages are required:

Martin Reinecke's avatar
fixes    
Martin Reinecke committed
95
    sudo apt-get install python3-pytest-cov
96

Martin Reinecke's avatar
Martin Reinecke committed
97
98
Afterwards the tests (including a coverage report) can be run using the
following command in the repository root:
99

Martin Reinecke's avatar
Martin Reinecke committed
100
    pytest-3 --cov=nifty7 test
Theo Steininger's avatar
Theo Steininger committed
101

Jait Dixit's avatar
Jait Dixit committed
102
103
### First Steps

Martin Reinecke's avatar
Martin Reinecke committed
104
For a quick start, you can browse through the [informal
Martin Reinecke's avatar
Martin Reinecke committed
105
introduction](http://ift.pages.mpcdf.de/nifty/code.html) or
Martin Reinecke's avatar
Martin Reinecke committed
106
dive into NIFTy by running one of the demonstrations, e.g.:
Jait Dixit's avatar
Jait Dixit committed
107

Martin Reinecke's avatar
Martin Reinecke committed
108
    python3 demos/getting_started_1.py
Jait Dixit's avatar
Jait Dixit committed
109

110
111
112
113
114
115
116
117
### Building the documentation from source

To build the documentation from source, install
[sphinx](https://www.sphinx-doc.org/en/stable/index.html) and the
[Read The Docs Sphinx Theme](https://github.com/readthedocs/sphinx_rtd_theme)
on your system and run

    sh docs/generate.sh
118

Martin Reinecke's avatar
fixes    
Martin Reinecke committed
119
### Acknowledgements
Jait Dixit's avatar
Jait Dixit committed
120

Martin Reinecke's avatar
Martin Reinecke committed
121
Please acknowledge the use of NIFTy in your publication(s) by using a
Jait Dixit's avatar
Jait Dixit committed
122
123
phrase such as the following:

Martin Reinecke's avatar
Martin Reinecke committed
124
> "Some of the results in this publication have been derived using the
125
126
> NIFTy package [(https://gitlab.mpcdf.mpg.de/ift/NIFTy)](https://gitlab.mpcdf.mpg.de/ift/NIFTy)"

Martin Reinecke's avatar
Martin Reinecke committed
127
and a citation to one of the [publications](http://ift.pages.mpcdf.de/nifty/citations.html).
128
129


Martin Reinecke's avatar
fixes    
Martin Reinecke committed
130
### Licensing terms
Jait Dixit's avatar
Jait Dixit committed
131

Martin Reinecke's avatar
Martin Reinecke committed
132
The NIFTy package is licensed under the terms of the
Martin Reinecke's avatar
Martin Reinecke committed
133
[GPLv3](https://www.gnu.org/licenses/gpl.html) and is distributed
Jait Dixit's avatar
Jait Dixit committed
134
*without any warranty*.
Philipp Arras's avatar
Philipp Arras committed
135
136


Philipp Arras's avatar
Philipp Arras committed
137
138
139
Contributing
------------

Martin Reinecke's avatar
Martin Reinecke committed
140
141
Please note our convention not to use pure Python `assert` statements in
production code. They are not guaranteed to by executed by Python and can be
Philipp Arras's avatar
Philipp Arras committed
142
143
144
145
turned off by the user (`python -O` in cPython). As an alternative use
`ift.myassert`.


Philipp Arras's avatar
Philipp Arras committed
146
147
148
Contributors
------------

Philipp Arras's avatar
Philipp Arras committed
149
150
### NIFTy7

Philipp Arras's avatar
Philipp Arras committed
151
- Andrija Kostic
Philipp Arras's avatar
Philipp Arras committed
152
- Gordian Edenhofer
Philipp Arras's avatar
Philipp Arras committed
153
154
- Jakob Knollmüller
- Jakob Roth
Philipp Arras's avatar
Philipp Arras committed
155
- Lukas Platz
Philipp Arras's avatar
Philipp Arras committed
156
- Matteo Guardiani
Philipp Arras's avatar
Philipp Arras committed
157
- Martin Reinecke
Philipp Arras's avatar
Philipp Arras committed
158
- [Philipp Arras](https://philipp-arras.de)
Philipp Arras's avatar
Philipp Arras committed
159
160
- Philipp Frank
- [Reimar Heinrich Leike](https://wwwmpa.mpa-garching.mpg.de/~reimar/)
Philipp Arras's avatar
Philipp Arras committed
161
162
- Simon Ding
- Vincent Eberle
Philipp Arras's avatar
Philipp Arras committed
163

Philipp Arras's avatar
Philipp Arras committed
164
165
### NIFTy6

Philipp Arras's avatar
Philipp Arras committed
166
167
- Andrija Kostic
- Gordian Edenhofer
Philipp Arras's avatar
Philipp Arras committed
168
- Jakob Knollmüller
Philipp Arras's avatar
Philipp Arras committed
169
170
- Lukas Platz
- Martin Reinecke
Philipp Arras's avatar
Philipp Arras committed
171
- [Philipp Arras](https://wwwmpa.mpa-garching.mpg.de/~parras/)
Philipp Arras's avatar
Philipp Arras committed
172
173
- Philipp Frank
- Philipp Haim
Reimar Leike's avatar
Reimar Leike committed
174
- [Reimar Heinrich Leike](https://wwwmpa.mpa-garching.mpg.de/~reimar/)
Philipp Arras's avatar
Philipp Arras committed
175
- Rouven Lemmerz
Philipp Arras's avatar
Philipp Arras committed
176
- [Torsten Enßlin](https://wwwmpa.mpa-garching.mpg.de/~ensslin/)
Philipp Arras's avatar
Philipp Arras committed
177
- Vincent Eberle
Philipp Arras's avatar
Philipp Arras committed
178
179
180
181


### NIFTy5

Philipp Arras's avatar
Philipp Arras committed
182
183
184
185
186
187
188
189
190
- Christoph Lienhard
- Gordian Edenhofer
- Jakob Knollmüller
- Julia Stadler
- Julian Rüstig
- Lukas Platz
- Martin Reinecke
- Max-Niklas Newrzella
- Natalia
Philipp Arras's avatar
Philipp Arras committed
191
- [Philipp Arras](https://wwwmpa.mpa-garching.mpg.de/~parras/)
Philipp Arras's avatar
Philipp Arras committed
192
193
194
195
196
- Philipp Frank
- Philipp Haim
- Reimar Heinrich Leike
- Sebastian Hutschenreuter
- Silvan Streit
Philipp Arras's avatar
Philipp Arras committed
197
- [Torsten Enßlin](https://wwwmpa.mpa-garching.mpg.de/~ensslin/)
Philipp Arras's avatar
Philipp Arras committed
198
199
200
201


### NIFTy4

Philipp Arras's avatar
Philipp Arras committed
202
203
204
205
206
- Christoph Lienhard
- Jakob Knollmüller
- Lukas Platz
- Martin Reinecke
- Mihai Baltac
Philipp Arras's avatar
Philipp Arras committed
207
- [Philipp Arras](https://wwwmpa.mpa-garching.mpg.de/~parras/)
Philipp Arras's avatar
Philipp Arras committed
208
209
210
- Philipp Frank
- Reimar Heinrich Leike
- Silvan Streit
Philipp Arras's avatar
Philipp Arras committed
211
- [Torsten Enßlin](https://wwwmpa.mpa-garching.mpg.de/~ensslin/)
Philipp Arras's avatar
Philipp Arras committed
212
213
214
215


### NIFTy3

Philipp Arras's avatar
Philipp Arras committed
216
217
218
219
220
221
- Daniel Pumpe
- Jait Dixit
- Jakob Knollmüller
- Martin Reinecke
- Mihai Baltac
- Natalia
Philipp Arras's avatar
Philipp Arras committed
222
- [Philipp Arras](https://wwwmpa.mpa-garching.mpg.de/~parras/)
Philipp Arras's avatar
Philipp Arras committed
223
- Philipp Frank
Philipp Arras's avatar
Tweaks    
Philipp Arras committed
224
225
- Reimar Heinrich Leike
- Matevz Sraml
Philipp Arras's avatar
Philipp Arras committed
226
227
- Theo Steininger
- csongor
Philipp Arras's avatar
Philipp Arras committed
228
229
230

### NIFTy2

Philipp Arras's avatar
Philipp Arras committed
231
232
233
- Jait Dixit
- Theo Steininger
- csongor
Philipp Arras's avatar
Philipp Arras committed
234
235
236
237


### NIFTy1

Philipp Arras's avatar
Philipp Arras committed
238
239
240
- Johannes Buchner
- Marco Selig
- Theo Steininger