Xped
Loading...
Searching...
No Matches
Heisenberg.hpp
Go to the documentation of this file.
1#ifndef HEISENBERG_H_
2#define HEISENBERG_H_
3
4#include <algorithm>
5#include <cassert>
6#include <cmath>
7#include <cstddef>
8#include <iostream>
9#include <numeric>
10#include <sstream>
11#include <string>
12#include <vector>
13
14#include </home/mpeschke/__LIBS__/eigen/Eigen/Core>
15#include </home/mpeschke/__LIBS__/eigen/Eigen/Sparse>
16
17#include "/home/mpeschke/Nextcloud/postdoc/code/ED/src/Basis.h"
18
19namespace Models {
20
22{
23public:
24 typedef double Scalar;
25 typedef Eigen::SparseMatrix<Scalar> MatrixType;
26
28 Heisenberg(const std::size_t& L_in, const std::size_t& D_in = 3)
29 : basis_(L_in, D_in){};
30 Heisenberg(const std::vector<std::size_t>& Ds_in)
31 : basis_(Ds_in){};
32
33 std::size_t L() const { return basis_.L(); }
34 std::size_t dim() const { return basis_.dim(); }
35
36 MatrixType Sz(const std::size_t& site) const;
37 MatrixType Sp(const std::size_t& site) const;
38 MatrixType Sm(const std::size_t& site) const { return Sp(site).adjoint(); }
39 MatrixType Sx(const std::size_t& site) const { return 0.5 * (Sp(site) + Sm(site)); }
40
41 MatrixType H(const Eigen::Matrix<Scalar, -1, -1>& J) const;
42
43private:
44 Basis basis_;
45};
46
47} // namespace Models
48#endif
Definition: Heisenberg.hpp:22
Heisenberg()
Definition: Heisenberg.hpp:27
Eigen::SparseMatrix< Scalar > MatrixType
Definition: Heisenberg.hpp:25
MatrixType H(const Eigen::Matrix< Scalar, -1, -1 > &J) const
Definition: Heisenberg.cpp:33
MatrixType Sp(const std::size_t &site) const
Definition: Heisenberg.cpp:17
Heisenberg(const std::size_t &L_in, const std::size_t &D_in=3)
Definition: Heisenberg.hpp:28
std::size_t dim() const
Definition: Heisenberg.hpp:34
double Scalar
Definition: Heisenberg.hpp:24
std::size_t L() const
Definition: Heisenberg.hpp:33
MatrixType Sx(const std::size_t &site) const
Definition: Heisenberg.hpp:39
Heisenberg(const std::vector< std::size_t > &Ds_in)
Definition: Heisenberg.hpp:30
MatrixType Sm(const std::size_t &site) const
Definition: Heisenberg.hpp:38
MatrixType Sz(const std::size_t &site) const
Definition: Heisenberg.cpp:8
Definition: Heisenberg.cpp:3
Eigen::SparseMatrix< Scalar > MatrixType
Definition: Heisenberg.cpp:6