GQCP
Loading...
Searching...
No Matches
SpinResolved2DM.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
30
31
32namespace GQCP {
33
34
40template <typename _Scalar>
42 public DoublySpinResolvedBase<PureSpinResolved2DMComponent<_Scalar>, MixedSpinResolved2DMComponent<_Scalar>, SpinResolved2DM<_Scalar>>,
43 public DoublySpinResolvedBasisTransformable<SpinResolved2DM<_Scalar>>,
44 public DoublySpinResolvedJacobiRotatable<SpinResolved2DM<_Scalar>> {
45public:
46 // The scalar type of one of the density matrix elements: real or complex.
47 using Scalar = _Scalar;
48
49 // The type of 'this'.
51
52 // The type components this spin resolved object is made of.
55
56
57public:
58 /*
59 * MARK: Constructors
60 */
61
62 // Inherit `DoublySpinResolvedBase`'s constructors.
64
65
66 /*
67 * MARK: General information
68 */
69
76 size_t numberOfOrbitals(const Spin sigma, const Spin tau) const {
77
78 if (sigma == Spin::alpha && tau == Spin::beta) {
79 return this->alphaAlpha().numberOfOrbitals();
80 } else if (sigma == Spin::alpha && tau == Spin::beta) {
81 return this->alphaBeta().numberOfOrbitals();
82 } else if (sigma == Spin::beta && tau == Spin::alpha) {
83 return this->betaAlpha().numberOfOrbitals();
84 } else {
85 return this->betaBeta().numberOfOrbitals();
86 }
87 }
88
89
94 return Orbital2DM<Scalar> {this->alphaAlpha().tensor().Eigen() + this->alphaBeta().tensor().Eigen() + this->betaAlpha().tensor().Eigen() + this->betaBeta().tensor().Eigen()};
95 }
96
97
102 // Since `rotate` and `rotated` are both defined in `DoublySpinResolvedBasisTransformable` and `DoublySpinResolvedJacobiRotatable`, we have to explicitly enable these methods here.
103
104 // Allow the `rotate` method from `DoublySpinResolvedBasisTransformable`, since there's also a `rotate` from `DoublySpinResolvedJacobiRotatable`.
106
107 // Allow the `rotated` method from `DoublySpinResolvedBasisTransformable`, since there's also a `rotated` from `DoublySpinResolvedJacobiRotatable`.
109
110 // Allow the `rotate` method from `DoublySpinResolvedJacobiRotatable`, since there's also a `rotate` from `DoublySpinResolvedBasisTransformable`.
112
113 // Allow the `rotated` method from `DoublySpinResolvedJacobiRotatable`, since there's also a `rotated` from `DoublySpinResolvedBasisTransformable`.
115};
116
117
118/*
119 * MARK: BasisTransformableTraits
120 */
121
125template <typename Scalar>
127
128 // The type of transformation that is naturally related to a `SpinResolved2DM`.
130};
131
132
133/*
134 * MARK: JacobiRotatableTraits
135 */
136
140template <typename Scalar>
142
143 // The type of Jacobi rotation for which the Jacobi rotation should be defined.
145};
146
147
148} // namespace GQCP
void rotate(const Transformation &U)
Definition: BasisTransformable.hpp:107
Definition: DoublySpinResolvedBase.hpp:36
Definition: DoublySpinResolvedBasisTransformable.hpp:35
Definition: DoublySpinResolvedJacobiRotatable.hpp:35
SpinResolved2DM< _Scalar > rotated(const JacobiRotationType &jacobi_rotation) const override
Definition: DoublySpinResolvedJacobiRotatable.hpp:54
Definition: MixedSpinResolved2DMComponent.hpp:37
size_t numberOfOrbitals() const
Definition: MixedSpinResolved2DMComponent.hpp:94
const SquareRankFourTensor< Scalar > & tensor() const
Definition: MixedSpinResolved2DMComponent.hpp:79
Definition: Orbital2DM.hpp:41
Definition: PureSpinResolved2DMComponent.hpp:36
size_t numberOfOrbitals() const
Definition: Simple2DM.hpp:113
const SquareRankFourTensor< Scalar > & tensor() const
Definition: Simple2DM.hpp:98
Definition: SpinResolved2DM.hpp:44
Orbital2DM< Scalar > orbitalDensity() const
Definition: SpinResolved2DM.hpp:93
typename DoublySpinResolvedBase< PureSpinResolved2DMComponent< _Scalar >, MixedSpinResolved2DMComponent< _Scalar >, SpinResolved2DM< _Scalar > >::Pure PureComponentType
Definition: SpinResolved2DM.hpp:53
SpinResolved2DM< Scalar > Self
Definition: SpinResolved2DM.hpp:50
size_t numberOfOrbitals(const Spin sigma, const Spin tau) const
Definition: SpinResolved2DM.hpp:76
typename DoublySpinResolvedBase< PureSpinResolved2DMComponent< _Scalar >, MixedSpinResolved2DMComponent< _Scalar >, SpinResolved2DM< _Scalar > >::Mixed MixedComponentType
Definition: SpinResolved2DM.hpp:54
_Scalar Scalar
Definition: SpinResolved2DM.hpp:47
const Base & Eigen() const
Definition: Tensor.hpp:116
Definition: UJacobiRotation.hpp:32
Definition: BaseOneElectronIntegralBuffer.hpp:25
Spin
Definition: Spin.hpp:27
@ beta
Definition: Spin.hpp:29
@ alpha
Definition: Spin.hpp:28
Definition: BasisTransformable.hpp:37
Definition: JacobiRotatable.hpp:37