GQCP
Loading...
Searching...
No Matches
G1DM.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
25
26
27namespace GQCP {
28
29
30/*
31 * MARK: G1DM implementation
32 */
33
39template <typename _Scalar>
40class G1DM:
41 public Simple1DM<_Scalar, G1DM<_Scalar>> {
42public:
43 // The scalar type used for a density matrix element: real or complex.
44 using Scalar = _Scalar;
45
46public:
47 /*
48 * MARK: Constructors
49 */
50
51 // Inherit `Simple1DM`'s constructors.
53
54
63
64 // The goal in this named constructor is to build up the general density matrix (2K x 2K) from the spin-resolved (K_sigma x K_sigma) ones.
65 const auto K_alpha = D.alpha().numberOfOrbitals();
66 const auto K_beta = D.beta().numberOfOrbitals();
67 const auto M = K_alpha + K_beta;
68
70
71 // alpha | 0
72 // 0 | beta
73 D_general.topLeftCorner(K_alpha, K_alpha) = D.alpha().matrix();
74 D_general.bottomRightCorner(K_beta, K_beta) = D.beta().matrix();
75
76 return G1DM<Scalar> {D_general};
77 }
78};
79
80
81/*
82 * MARK: `BasisTransformableTraits`
83 */
84
88template <typename Scalar>
90
91 // The type of transformation that is naturally related to a `G1DM`.
93};
94
95
96/*
97 * MARK: `JacobiRotatableTraits`
98 */
99
103template <typename Scalar>
105
106 // The type of Jacobi rotation that is naturally related to a `G1DM`.
108};
109
110
111/*
112 * MARK: `DensityMatrixTraits`
113 */
114
118template <typename Scalar>
119struct DensityMatrixTraits<G1DM<Scalar>> {
120
121 // The type of transformation that is naturally related to a `G1DM`.
123};
124
125
126} // namespace GQCP
Definition: G1DM.hpp:41
_Scalar Scalar
Definition: G1DM.hpp:44
static G1DM< Scalar > FromSpinResolved(const SpinResolved1DM< Scalar > &D)
Definition: G1DM.hpp:62
Definition: JacobiRotation.hpp:33
Definition: Simple1DM.hpp:48
size_t numberOfOrbitals() const
Definition: Simple1DM.hpp:111
const SquareMatrix< Scalar > & matrix() const
Definition: Simple1DM.hpp:96
Simple1DM()
Definition: Simple1DM.hpp:85
Definition: SpinResolved1DM.hpp:44
const Of & beta() const
Definition: SpinResolvedBase.hpp:140
const Of & alpha() const
Definition: SpinResolvedBase.hpp:130
Definition: SquareMatrix.hpp:39
static Self Zero(const size_t dim)
Definition: SquareMatrix.hpp:289
Definition: BaseOneElectronIntegralBuffer.hpp:25
Definition: BasisTransformable.hpp:37
Definition: DensityMatrixTraits.hpp:28
Definition: JacobiRotatable.hpp:37