Skip to content

Commit cf4d975

Browse files
authored
Merge pull request #4 from temken/dev
Dev
2 parents 3eb066c + 9584465 commit cf4d975

36 files changed

Lines changed: 1523 additions & 467 deletions

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ jobs:
7777

7878
# # TESTS
7979
# - name: Test installed executable
80-
# working-directory: ${{runner.workspace}}/graphene/bin
80+
# working-directory: ${{runner.workspace}}/Darphene/bin
8181
# shell: bash
8282
# # Execute the executable from the /bin/ directory.
83-
# run: ./graphene config.cfg
83+
# run: ./Darphene config.cfg
8484

8585
- name: Unit tests
8686
working-directory: ${{runner.workspace}}/build

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.12)
22

3-
project(graphene VERSION "0.1.0")
3+
project(Darphene VERSION "0.1.0")
44

55
# Use C++-14
66
set(CMAKE_CXX_STANDARD 14)
@@ -37,7 +37,7 @@ include(FetchContent)
3737
set(OBSCURA_DIR ${EXTERNAL_DIR}/obscura)
3838
FetchContent_Declare(obscura
3939
GIT_REPOSITORY https://github.com/temken/obscura.git
40-
GIT_TAG origin/dev
40+
GIT_TAG v1.0.3
4141
SOURCE_DIR "${OBSCURA_DIR}"
4242
CMAKE_ARGS "-DCMAKE_BUILD_TYPE=Release -DCODE_COVERAGE=OFF")
4343
FetchContent_GetProperties(obscura)
@@ -60,7 +60,7 @@ endif()
6060
set(GTEST_DIR ${EXTERNAL_DIR}/googletest)
6161
FetchContent_Declare(googletest
6262
GIT_REPOSITORY https://github.com/google/googletest.git
63-
GIT_TAG release-1.10.0
63+
GIT_TAG release-1.12.1
6464
SOURCE_DIR "${GTEST_DIR}/src"
6565
BINARY_DIR "${GTEST_DIR}/build"
6666
CONFIGURE_COMMAND ""

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Timon Emken
3+
Copyright (c) 2023 Timon Emken
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 182 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,186 @@
1-
[![Build Status](https://github.com/temken/graphene/workflows/Build%20Status/badge.svg)](https://github.com/temken/graphene/actions)
2-
[![codecov](https://codecov.io/gh/temken/graphene/branch/main/graph/badge.svg)](https://codecov.io/gh/temken/template_cpp_cmake_obscura)
1+
[![Build Status](https://github.com/temken/Darphene/workflows/Build%20Status/badge.svg)](https://github.com/temken/Darphene/actions)
2+
[![codecov](https://codecov.io/gh/temken/Darphene/branch/main/graph/badge.svg)](https://codecov.io/gh/temken/template_cpp_cmake_obscura)
33
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
44

5-
# Graphene
5+
# Darphene - Modelling general dark matter - electron interactions in graphene targets
66

7+
[![DOI](https://zenodo.org/badge/xxx.svg)](https://zenodo.org/badge/latestdoi/xxx)
8+
[![arXiv](https://img.shields.io/badge/arXiv-2303.xxxxx-B31B1B.svg)](https://arxiv.org/abs/2303.xxxxx)
79

8-
- build with [CMake](https://cmake.org/)
9-
- continuous integration with [Github Actions](https://github.com/actions)
10-
- unit testing with [googletest](https://github.com/google/googletest)
11-
- code coverage with [codecov](https://codecov.io/).
12-
- imports the static library [obscura](https://github.com/temken/obscura) and thereby also [libphysica](https://github.com/temken/libphysica) and [libconfig](https://github.com/hyperrealm/libconfig)
10+
11+
<img width="500" src="https://user-images.githubusercontent.com/29034913/227547647-9d2825dd-9cfd-4fde-9573-04d6c885a99f.png">
12+
13+
*Darphene* calculates predicted signal rates for dark matter detection experiments using graphene as target material using the [tight-binding approximation](https://en.wikipedia.org/wiki/Tight_binding). Details on the physics can be found in [the corresponding publication](https://arxiv.org/abs/2303.XXXXX).
14+
15+
<img width="250" src="https://user-images.githubusercontent.com/29034913/226607786-762d3a59-88d8-4927-bd16-eb2a577391d2.png">
16+
17+
## General notes
18+
19+
- The material properties of the graphene target are modeled using the tight-binding approxmation, which uses atomic orbitals of carbon as a basis for the initial wavefunction of the electrons in graphene.
20+
- The final electron states are approximated as plane-waves.
21+
- *Darphene* is written in C++ and build using CMake.
22+
- Parts of the calculations, in particular tabulation of event rates, are parallelized using MPI.
23+
24+
<details><summary>Repository content</summary>
25+
<p>
26+
27+
The included folders are:
28+
29+
- *bin/*: This folder contains the executable after successful installation together with the configuration files.
30+
- *data/*: Contains additional data necessary for the simulations, e.g. the solar model tables.
31+
- *external/*: This folder will only be created and filled during the build with CMake and will contain the [obscura](https://github.com/temken/obscura) library necessary for all direct detection computations.
32+
- *include/*: All header files of Darphene can be found here.
33+
- *results/*: Each run of Darphene generates result files in a dedicated sub-folder named after the run's simulation ID string, which is specified in the configuration file.
34+
- *src/*: Here you find the source code of Darphene.
35+
- *tests/*: All code and executable files of the unit tests are stored here.
36+
37+
</p>
38+
</details>
39+
40+
41+
## Getting started
42+
43+
<details><summary>1. Dependencies</summary>
44+
<p>
45+
46+
Before we can install *Darphene*, we need to make sure that a few dependencies are taken care of.
47+
48+
- [arb](https://arblib.org/): For the evaluation of hypergeometric functions.
49+
- [boost](https://www.boost.org/): For numerical integration (used by *libphysica*).
50+
- [CMake](https://cmake.org/): *Darphene* as well as the libraries *libphysica* and *obscura* are built with CMake.
51+
- [eigen](https://eigen.tuxfamily.org): For the numerical procedure to find eigenvalues and eigenvectors of the generalized eigen problem.
52+
- [libconfig](https://github.com/hyperrealm/libconfig): For the configuration files, *Darphene* uses the *libconfig* library (required version at least 1.6). This will be installed by *libphysica*, if it is not already installed.
53+
- [libphysica](https://github.com/temken/libphysica): Automatically downloaded to */external/obscura/external/*, compiled, and linked by *CMake*.
54+
- [MPI](https://www.mpi-forum.org/): The tabulation of DM observables is accelerated via parallelization using MPI.
55+
- [obscura](https://github.com/temken/obscura): Automatically downloaded to */external/*, compiled, and linked by *CMake*.
56+
57+
On macOS, the dependencies can be installed using [homebrew](https://brew.sh/).
58+
59+
```
60+
>brew install arb boost cmake eigen libconfig open-mpi
61+
```
62+
63+
On Linux machines, we can use APT:
64+
65+
```
66+
>sudo apt-get update -y
67+
>sudo apt-get install -y arb libboost-all-dev libeigen3-dev libconfig-dev openmpi-bin openmpi-doc libopenmpi-dev
68+
```
69+
70+
<details><summary>Notes on libconfig</summary>
71+
<p>
72+
73+
The installation of `libconfig` is optional, since `libphysica` will install it automatically, if it is not available. Alternatively, it can be built from the source files via
74+
75+
```
76+
>wget https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.2.tar.gz
77+
>tar -xvzf libconfig-1.7.2.tar.gz
78+
>pushd libconfig-1.7.2
79+
>./configure
80+
>make
81+
>sudo make install
82+
>popd
83+
```
84+
</p>
85+
</details>
86+
87+
</p>
88+
</details>
89+
90+
<details><summary>2. Download & Installation</summary>
91+
<p>
92+
The *Darphene* source code can be downloaded by cloning this git repository:
93+
94+
```
95+
>git clone https://github.com/temken/Darphene.git
96+
>cd Darphene
97+
```
98+
99+
The code is compiled and the executable is created using CMake.
100+
101+
```
102+
>cmake -E make_directory build
103+
>cd build
104+
>cmake -DCMAKE_BUILD_TYPE=Release -DCODE_COVERAGE=OFF ..
105+
>cmake --build . --config Release
106+
>cmake --install .
107+
```
108+
109+
If everything worked well, there should be the executable *Darphene* in the */bin/* folder.
110+
111+
</p>
112+
</details>
113+
114+
<details><summary>3. Usage</summary>
115+
<p>
116+
Once *Darphene* is installed, it can run by running the following command from the */bin/* folder:
117+
118+
```
119+
>./Darphene Darphene.cfg
120+
```
121+
122+
Alternative, one can use MPI to speed up calculations.
123+
124+
```
125+
>mpirun -n N Darphene Darphene.cfg
126+
```
127+
128+
where *N* is the number of desired MPI processes.
129+
130+
</p>
131+
</details>
132+
133+
## Version History
134+
135+
- 27.03.2023: Release of version 0.1.0
136+
137+
## Everything else
138+
139+
<details><summary>Citing Darphene</summary>
140+
<p>
141+
142+
If you decide to use this code, please cite the latest archived version,
143+
144+
> Emken, T., 2023, Darphene [Code, v0.1.0], [[DOI:10.5281/zenodo.xxxxxxx]](https://doi.org/10.5281/zenodo.xxxxxxx)
145+
146+
<details><summary>BibTeX entry</summary>
147+
<p>
148+
149+
```
150+
@software{Darphene,
151+
author = {Emken, Timon},
152+
title = {{Darphene [Code, v0.1.0]}},
153+
year = {2023},
154+
publisher = {Zenodo},
155+
version = {v0.1.0},
156+
doi = {DOI:10.5281/zenodo.xxxxxxx},
157+
url = {https://doi.org/10.5281/zenodo.xxxxxxx},
158+
howpublished={The code can be found under \url{https://github.com/temken/Darphene}. Version 0.1.0 is archived as \href{https://doi.org/10.5281/zenodo.xxxxxxx}{DOI:10.5281/zenodo.xxxxxxx}}
159+
}
160+
```
161+
</p>
162+
</details>
163+
164+
As well as the original publication,
165+
166+
> R. Catena, T. Emken, M. Matas, N.A. Spaldin, E. Urdshals , 2023, **Direct searches for general dark matter-electron interactions with graphene detectors: Part I. Electronic structure calculations**, [[arXiv:2303.xxxxx]](https://arxiv.org/abs/2303.xxxxx).
167+
168+
</p>
169+
</details>
170+
171+
<details><summary>Author & Contact</summary>
172+
<p>
173+
174+
The author of *Darphene* is Timon Emken.
175+
176+
For questions, bug reports or other suggestions please open an [issue](https://github.com/temken/Darphene/issues).
177+
</p>
178+
</details>
179+
180+
<details><summary>License</summary>
181+
<p>
182+
183+
This project is licensed under the MIT License - see the LICENSE file.
184+
185+
</p>
186+
</details>

bin/Darphene.cfg

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//Darphene - Configuration File
2+
3+
//ID
4+
ID = "result_ID";
5+
6+
// Run modus
7+
run_modus = "Graphene"; //Options: "Energy-Spectrum", "Total-Rate" "Directional-Spectrum", "Daily-Modulation", "Graphene", "Exclusion-Limit" "Custom"
8+
MC_points = 1000;
9+
grid_points = 10;
10+
11+
// Graphene Options
12+
carbon_wave_functions = "RHF"; // Options: "Hydrogenic" and "Roothaan-Hartree-Fock"/"RHF"
13+
// Recommended: "RHF"
14+
work_function = 4.3; // in eV
15+
16+
//Dark matter particle
17+
DM_mass = 100.0; // in MeV
18+
DM_spin = 0.5;
19+
DM_fraction = 1.0; // the DM particle's fractional abundance (set to 1.0 for 100%)
20+
21+
DM_interaction = "NREFT"; // Options: "Dark-Photon", "NREFT", "Electric-Dipole", "Magnetic-Dipole", "Anapole"
22+
23+
// Options for "Dark-Photon"
24+
DM_cross_section_electron = 1.0e-37; //in cm^2 (only relevant for dark photon model)
25+
DM_form_factor = "Contact"; // Options: "Contact", "Long-Range", "General"
26+
DM_mediator_mass = 0.0; // in MeV (only relevant if 'DM_form_factor' is "General")
27+
28+
// Options for "NREFT" (operator, effective coupling, form factor, parameter e.g. mediator mass [MeV])
29+
NREFT_couplings = (
30+
(1, 1.0, "Contact", 3.0),
31+
# (5, 1.0, "Contact", 3.0)
32+
);
33+
// Options for "Electric-Dipole", "Magnetic-Dipole", "Anapole"
34+
DM_coupling = 1.0; // either in GeV^-1 or GeV^-2 (depending on the interaction)
35+
36+
//Dark matter distribution
37+
DM_distribution = "SHM"; //Options: "SHM", "SHM++"
38+
DM_local_density = 0.4; //in GeV / cm^3
39+
time = 6.0; // in hr. t = 0 corresponds to the DM wind coming from the top.
40+
41+
//Options for "SHM" and "SHM++"
42+
SHM_v0 = 238.0; //in km/sec
43+
SHM_vObserver = (0.0, 0.0, 250.552); //in km/sec
44+
SHM_vEscape = 544.0; //in km/sec
45+
//Options for "SHM++"
46+
SHMpp_eta = 0.2;
47+
SHMpp_beta = 0.9;
48+
49+
//Computation of exclusion limits (relevant for "Exclusion-Limit" mode)
50+
exposure = 1.0; //in gram*year
51+
constraints_certainty = 0.95; //Certainty level
52+
constraints_mass_min = 20.0; //in MeV
53+
constraints_mass_max = 1000.0; //in MeV
54+
constraints_masses = 10;

data/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Reference for Roothaan-Hartree-Fock ground state atomic wave functions
2+
3+
The coefficients for the RHF wavefunctions of carbons are taken from
4+
5+
> C. F. Bunge, J. A. Barrientos, and A. V. Bunge, **Roothaan-Hartree-Fock Ground-State Atomic Wave Functions: Slater-Type Orbital Expansions and Expectation Values for Z = 2-54", [Atom. Data Nucl. Data Tabl. 53, 113–162 (1993)](https://www.sciencedirect.com/science/article/pii/S0092640X8371003X)
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
#include <string>
77
#include <vector>
88

9-
namespace graphene
9+
namespace Darphene
1010
{
1111

1212
// 1. Base class for atomic wavefunctions of carbon
1313
class Carbon_Wavefunctions
1414
{
1515
protected:
1616
public:
17+
std::string name;
1718
Carbon_Wavefunctions() {};
1819

1920
// Position space wavefunctions
@@ -35,7 +36,7 @@ class Hydrogenic : public Carbon_Wavefunctions
3536

3637
public:
3738
Hydrogenic(double Z2s, double Z2pxpy, double Z2pz)
38-
: Zeff_2s(Z2s), Zeff_2pxpy(Z2pxpy), Zeff_2pz(Z2pz) {};
39+
: Zeff_2s(Z2s), Zeff_2pxpy(Z2pxpy), Zeff_2pz(Z2pz) { name = "Hydrogenic"; };
3940

4041
// Position space wavefunctions
4142
virtual double Wavefunction_Position(const Eigen::Vector3d& xVec, const std::string& orbital) override;
@@ -45,10 +46,16 @@ class Hydrogenic : public Carbon_Wavefunctions
4546
};
4647

4748
// 3. Roothaan-Hartree-Fock wavefunctions
49+
extern std::complex<double> Hypergeometric_2F1(double a, double b, double c, double z);
50+
extern double Slate_Type_Orbital_Position(double r, double Z, double n);
51+
extern std::complex<double> Slate_Type_Orbital_Momentum(double k, double Z, double n, int l);
52+
4853
class Roothaan_Hartree_Fock : public Carbon_Wavefunctions
4954
{
5055
protected:
5156
std::vector<std::vector<double>> C_nlj, Z_lj, n_lj;
57+
58+
public:
5259
void Import_RHF_Coefficients();
5360

5461
double Radial_Wavefunction_Position(double r, const std::string& orbital) const;
@@ -64,6 +71,6 @@ class Roothaan_Hartree_Fock : public Carbon_Wavefunctions
6471
virtual std::complex<double> Wavefunction_Momentum(const Eigen::Vector3d& kVec, const std::string& orbital) override;
6572
};
6673

67-
} // namespace graphene
74+
} // namespace Darphene
6875

6976
#endif
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
#include "obscura/Configuration.hpp"
55

6-
#include "graphene/DM_Particle_NREFT.hpp"
7-
#include "graphene/Graphene.hpp"
6+
#include "Darphene/DM_Particle_NREFT.hpp"
7+
#include "Darphene/Graphene.hpp"
88

9-
namespace graphene
9+
namespace Darphene
1010
{
1111
// 1. Configuration class for input file, which extends the obscura::Configuration class.
1212

@@ -31,12 +31,15 @@ class Configuration : public obscura::Configuration
3131
double graphene_work_function, time;
3232
std::string run_modus, carbon_wavefunctions;
3333
unsigned int MC_points, grid_points;
34+
// For constraints
35+
double exposure, constraints_certainty, constraints_mass_min, constraints_mass_max;
36+
unsigned int constraints_masses;
3437

3538
explicit Configuration(std::string cfg_filename, int MPI_rank = 0);
3639

3740
void Print_Summary(int mpi_rank = 0) override;
3841
};
3942

40-
} // namespace graphene
43+
} // namespace Darphene
4144

4245
#endif

0 commit comments

Comments
 (0)