TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
brillouin_zone.cpp
Go to the documentation of this file.
1// Copyright (c) 2016-2018 Commissariat à l'énergie atomique et aux énergies alternatives (CEA)
2// Copyright (c) 2016-2018 Centre national de la recherche scientifique (CNRS)
3// Copyright (c) 2018-2022 Simons Foundation
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You may obtain a copy of the License at
16// https://www.gnu.org/licenses/gpl-3.0.txt
17//
18// Authors: Thomas Ayral, Michel Ferrero, Olivier Parcollet, Nils Wentzell
19
24
25#include "./bravais_lattice.hpp"
26#include "./brillouin_zone.hpp"
27
28#include <h5/h5.hpp>
29#include <nda/nda.hpp>
30
31#include <numbers>
32#include <string>
33#include <utility>
34
35namespace triqs::lattice {
36
37 brillouin_zone::brillouin_zone(bravais_lattice bl) : lattice_(std::move(bl)) {
38 using std::numbers::pi;
39 k_units_ = 2 * pi * nda::linalg::inv(nda::transpose(lattice_.units()));
40 k_units_inv_ = 1 / (2 * pi) * nda::transpose(lattice_.units());
41 }
42
43 void h5_write(h5::group g, std::string const &name, brillouin_zone const &bz) {
44 h5::group gr = g.create_group(name);
45 h5::write_hdf5_format(gr, bz); // NOLINT (downcasting to base class)
46 h5::write(gr, "bravais_lattice", bz.lattice_);
47 }
48
49 void h5_read(h5::group g, std::string const &name, brillouin_zone &bz) {
50 h5::group gr = g.open_group(name);
52 h5::read(gr, "bravais_lattice", bl);
53 bz = brillouin_zone{bl};
54 }
55
56} // namespace triqs::lattice
Provides a Bravais lattice class.
Provides a Brillouin zone class.
friend void h5_write(h5::group g, std::string const &name, brillouin_zone const &bz)
Write a triqs::lattice::brillouin_zone to HDF5.
friend void h5_read(h5::group g, std::string const &name, brillouin_zone &bz)
Read a triqs::lattice::brillouin_zone from HDF5.
brillouin_zone()
Construct a Brillouin zone for a simple cubic lattice with lattice constant .