GQCP
Loading...
Searching...
No Matches
JacobiRotation.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser 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// GQCG-GQCP 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 Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
21#include "Utilities/Eigen.hpp"
22
23#include <cstdlib>
24#include <ostream>
25
26
27namespace GQCP {
28
29
34private:
35 // The index of the first rotated orbital. (p > q)
36 size_t m_p;
37
38 // The index of the second rotated orbital. (p > q)
39 size_t m_q;
40
41 // The angle of rotation, in radians.
42 double m_angle;
43
44
45public:
46 /*
47 * MARK: Constructors
48 */
49
55 JacobiRotation(const size_t p, const size_t q, const double angle);
56
61
62
63 /*
64 * MARK: Operators
65 */
66
73 friend std::ostream& operator<<(std::ostream& os, const JacobiRotation& jacobi_rotation);
74
75
76 /*
77 * MARK: General information
78 */
79
83 double angle() const { return this->m_angle; }
84
88 size_t p() const { return this->m_p; }
89
93 size_t q() const { return this->m_q; }
94
95
96 /*
97 * MARK: Conversions
98 */
99
103 Eigen::JacobiRotation<double> Eigen() const { return Eigen::JacobiRotation<double> {std::cos(this->angle()), std::sin(this->angle())}; }
104};
105
106
107} // namespace GQCP
Definition: JacobiRotation.hpp:33
double angle() const
Definition: JacobiRotation.hpp:83
Eigen::JacobiRotation< double > Eigen() const
Definition: JacobiRotation.hpp:103
size_t p() const
Definition: JacobiRotation.hpp:88
friend std::ostream & operator<<(std::ostream &os, const JacobiRotation &jacobi_rotation)
Definition: JacobiRotation.cpp:64
size_t q() const
Definition: JacobiRotation.hpp:93
JacobiRotation()
Definition: JacobiRotation.cpp:50
Definition: BaseOneElectronIntegralBuffer.hpp:25