GQCP
Loading...
Searching...
No Matches
SQHamiltonian.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
33
34#include <numeric>
35#include <vector>
36
37
38namespace GQCP {
39
40
41/*
42 * MARK: SQHamiltonian implementation
43 */
44
51template <typename _ScalarSQOneElectronOperator, typename _ScalarSQTwoElectronOperator>
53 public BasisTransformable<SQHamiltonian<_ScalarSQOneElectronOperator, _ScalarSQTwoElectronOperator>>,
54 public JacobiRotatable<SQHamiltonian<_ScalarSQOneElectronOperator, _ScalarSQTwoElectronOperator>> {
55public:
56 // The type of second-quantized one-electron operator underlying this Hamiltonian.
57 using ScalarSQOneElectronOperator = _ScalarSQOneElectronOperator;
58
59 // The type of second-quantized two-electron operator underlying this Hamiltonian.
60 using ScalarSQTwoElectronOperator = _ScalarSQTwoElectronOperator;
61
62 // Check if the spinor tags of the one- and two-electron operators match.
63 static_assert(std::is_same<typename ScalarSQOneElectronOperator::SpinorTag, typename ScalarSQTwoElectronOperator::SpinorTag>::value, "The spinor tags of the one- and two-electron operators do not match.");
64
65 // The spinor tag associated to this Hamiltonian.
66 using SpinorTag = typename ScalarSQOneElectronOperator::SpinorTag;
67
68 // Check if the scalar type of the parameters/matrix elements of the one-electron and two-electron operators are equal.
69 static_assert(std::is_same<typename ScalarSQOneElectronOperator::Scalar, typename ScalarSQTwoElectronOperator::Scalar>::value, "The scalar type of the one- and two-electron parameters/matrix elements do not match.");
70
71 // The scalar type used for a single parameter/matrix element: real or complex.
72 using Scalar = typename ScalarSQOneElectronOperator::Scalar;
73
74 // The type of 'this'
76
77 // The type of the one-particle density matrix that is naturally associated to the second-quantized Hamiltonian.
79
80 // The type of the two-particle density matrix that is naturally associated to the second-quantized Hamiltonian.
82
83 // The type of transformation that is naturally associated to the Hamiltonian.
85
86 // The type of Jacobi rotation for which the Jacobi rotation should be defined.
88
89
90private:
91 // The total one-electron interaction operator, i.e. the core Hamiltonian.
93
94 // The total two-electron interaction operator.
96
97 // The contributions to the total one-electron interaction operator.
98 std::vector<ScalarSQOneElectronOperator> h_contributions;
99
100 // The contributions to the total two-electron interaction operator.
101 std::vector<ScalarSQTwoElectronOperator> g_contributions;
102
103
104public:
105 /*
106 * MARK: Constructors
107 */
108
115 SQHamiltonian(const std::vector<ScalarSQOneElectronOperator>& h_contributions, const std::vector<ScalarSQTwoElectronOperator>& g_contributions) :
116 h_contributions {h_contributions},
117 g_contributions {g_contributions} {
118
119 // Check if the dimensions of the one- and two-electron operators are compatible.
120 const std::invalid_argument dimension_error {"SQHamiltonian::SQHamiltonian(const std::vector<ScalarSQOneElectronOperator<Scalar>& h_contributions, const std::vector<ScalarSQTwoElectronOperator<Scalar>& g_contributions: The dimensions of the contributing operators are incompatible"};
121
122 const auto dim = h_contributions[0].numberOfOrbitals();
123 for (const auto& h : this->h_contributions) {
124 if (h.numberOfOrbitals() != dim) {
125 throw dimension_error;
126 }
127 }
128
129 for (const auto& g : this->g_contributions) {
130 if (g.numberOfOrbitals() != dim) {
131 throw dimension_error;
132 }
133 }
134
135
136 // Calculate the total one- and two-electron operators.
137 this->h = std::accumulate(h_contributions.begin(), h_contributions.end(), ScalarSQOneElectronOperator::Zero(dim));
138 this->g = std::accumulate(g_contributions.begin(), g_contributions.end(), ScalarSQTwoElectronOperator::Zero(dim));
139 }
140
141
150 std::vector<ScalarSQTwoElectronOperator> {g}) {}
151
152
166 template <typename Z1 = Scalar, typename Z2 = SpinorTag>
168
169 const auto h = hubbard_hamiltonian.core();
170 const auto g = hubbard_hamiltonian.twoElectron();
171
172 return Self {h, g};
173 }
174
175
183 template <typename Z = SpinorTag>
185
186 const auto h_u = ScalarUSQOneElectronOperator<Scalar>::FromRestricted(r_hamiltonian.core());
187 const auto g_u = ScalarUSQTwoElectronOperator<Scalar>::FromRestricted(r_hamiltonian.twoElectron());
188
189 return Self {h_u, g_u};
190 }
191
192
202 template <typename Z = Scalar>
204
205 const auto h = ScalarSQOneElectronOperator::Random(dim);
206 const auto g = ScalarSQTwoElectronOperator::Random(dim);
207
208 return Self {h, g};
209 }
210
211
221 template <typename Z1 = Scalar, typename Z2 = SpinorTag>
222 static enable_if_t<std::is_same<Z1, double>::value && std::is_same<Z2, RestrictedSpinOrbitalTag>::value, SQHamiltonian<ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator>> FromFCIDUMP(const std::string& fcidump_filename) {
223
224 std::ifstream input_file_stream = validateAndOpen(fcidump_filename, "FCIDUMP");
225
226
227 // Do the actual parsing
228
229 // Get the number of orbitals to check if it's a valid FCIDUMP file
230 std::string start_line; // first line contains orbitals and electron count
231 std::getline(input_file_stream, start_line);
232 std::stringstream linestream {start_line};
233
234 size_t K = 0;
235 char iter;
236
237 while (linestream >> iter) {
238 if (iter == '=') {
239 linestream >> K; // right here we have the number of orbitals
240 break; // we can finish reading the linestream after we found K
241 }
242 }
243
244 if (K == 0) {
245 throw std::invalid_argument("SQHamiltonian::FromFCIDUMP(std::string): The .FCIDUMP-file is invalid: could not read a number of orbitals.");
246 }
247
248
251 g.setZero();
252
253 // Skip 3 lines
254 for (size_t counter = 0; counter < 3; counter++) {
255 std::getline(input_file_stream, start_line);
256 }
257
258
259 // Start reading in the one- and two-electron integrals
260 double x;
261 size_t i, j, a, b;
262
263 std::string line;
264 while (std::getline(input_file_stream, line)) {
265 std::istringstream iss {line};
266
267 // Based on what the values of the indices are, we can read one-electron integrals, two-electron integrals and the internuclear repulsion energy
268 // See also (http://hande.readthedocs.io/en/latest/manual/integrals.html)
269 // I think the documentation is a bit unclear for the two-electron integrals, but we can rest assured that FCIDUMP files give the two-electron integrals in CHEMIST's notation.
270 iss >> x >> i >> a >> j >> b;
271
272 // Single-particle eigenvalues (skipped)
273 if ((a == 0) && (j == 0) && (b == 0)) {
274 }
275
276 // One-electron integrals (h_core)
277 else if ((j == 0) && (b == 0)) {
278 size_t p = i - 1;
279 size_t q = a - 1;
280 h_core(p, q) = x;
281
282 // Apply the permutational symmetry for real orbitals
283 h_core(q, p) = x;
284 }
285
286 // Two-electron integrals are given in CHEMIST'S NOTATION, so just copy them over
287 else if ((i > 0) && (a > 0) && (j > 0) && (b > 0)) {
288 size_t p = i - 1;
289 size_t q = a - 1;
290 size_t r = j - 1;
291 size_t s = b - 1;
292 g(p, q, r, s) = x;
293
294 // Apply the permutational symmetries for real orbitals
295 g(p, q, s, r) = x;
296 g(q, p, r, s) = x;
297 g(q, p, s, r) = x;
298
299 g(r, s, p, q) = x;
300 g(s, r, p, q) = x;
301 g(r, s, q, p) = x;
302 g(s, r, q, p) = x;
303 }
304 } // while loop
305
306
308 }
309
310
311 /*
312 * MARK: Access
313 */
314
318 const ScalarSQOneElectronOperator& core() const { return this->h; }
319
323 ScalarSQOneElectronOperator& core() { return this->h; }
324
328 const std::vector<ScalarSQOneElectronOperator>& coreContributions() const { return this->h_contributions; }
329
333 std::vector<ScalarSQOneElectronOperator>& coreContributions() { return this->h_contributions; }
334
338 const ScalarSQTwoElectronOperator& twoElectron() const { return this->g; }
339
344
348 const std::vector<ScalarSQTwoElectronOperator>& twoElectronContributions() const { return this->g_contributions; }
349
353 std::vector<ScalarSQTwoElectronOperator>& twoElectronContributions() { return this->g_contributions; }
354
355
356 /*
357 * MARK: General information
358 */
359
363 size_t numberOfOrbitals() const { return this->core().numberOfOrbitals(); }
364
365
366 /*
367 * MARK: Calculations
368 */
369
379 template <typename Z = SpinorTag>
380 enable_if_t<std::is_same<Z, RestrictedSpinOrbitalTag>::value || std::is_same<Z, GeneralSpinorTag>::value, double> calculateEdmistonRuedenbergLocalizationIndex(const OrbitalSpace orbital_space) const {
381
382 const auto& g_total_par = this->twoElectron().parameters();
383
384 // TODO: When Eigen releases TensorTrace, use it here.
385 double localization_index = 0.0;
386 for (const auto& i : orbital_space.indices(OccupationType::k_occupied)) {
387 localization_index += g_total_par(i, i, i, i);
388 }
389
390 return localization_index;
391 }
392
393
401 template <typename Z = SpinorTag>
403
404 return this->core() + this->twoElectron().effectiveOneElectronPartition();
405 }
406
407
416 Scalar calculateExpectationValue(const OneDM& D, const TwoDM& d) const {
417
418 // An SQHamiltonian contains ScalarSQOperators, so we access their expectation values with ().
419 return this->core().calculateExpectationValue(D)() + this->twoElectron().calculateExpectationValue(d)();
420 }
421
422
433 template <typename Z = SpinorTag>
434 enable_if_t<std::is_same<Z, RestrictedSpinOrbitalTag>::value || std::is_same<Z, GeneralSpinorTag>::value, SquareMatrix<Scalar>> calculateFockianMatrix(const OneDM& D, const TwoDM& d) const {
435
436 // An SQHamiltonian contains ScalarSQOperators, so we access their Fockian matrices with (0).
437 return this->core().calculateFockianMatrix(D, d)() + this->twoElectron().calculateFockianMatrix(D, d)();
438 }
439
440
449 template <typename Z = SpinorTag>
451
452 // An SQHamiltonian contains ScalarSQOperators, so we access their Fockian matrices with (0).
453 return this->core().calculateSuperFockianMatrix(D, d)().Eigen() + this->twoElectron().calculateSuperFockianMatrix(D, d)().Eigen(); // We have to call .Eigen() because operator+ isn't fully enabled on SquareRankFourTensor.
454 }
455
456
464 template <typename Z = SpinorTag>
466
467 const auto& h_par = this->core().parameters();
468 const auto& g_par = this->twoElectron().parameters();
469
470 // A KISS implementation of the calculation of the (general) inactive Fockian matrix
471 auto F_par = h_par; // one-electron part
472
473 // Two-electron part
474 for (const auto& p : orbital_space.indices()) {
475 for (const auto& q : orbital_space.indices()) {
476
477 for (const auto& i : orbital_space.indices(OccupationType::k_occupied)) {
478 F_par(p, q) += g_par(p, q, i, i) - g_par(p, i, i, q);
479 }
480 }
481 } // F elements loop
482
483 return ScalarSQOneElectronOperator {F_par};
484 }
485
486
494 template <typename Z = SpinorTag>
496 const auto& h_par = this->core().parameters();
497 const auto& g_par = this->twoElectron().parameters();
498
499
500 // A KISS implementation of the calculation of the (restricted) inactive Fockian matrix
501 auto F_par = h_par; // one-electron part
502
503 // Two-electron part
504 for (const auto& p : orbital_space.indices()) {
505 for (const auto& q : orbital_space.indices()) {
506
507 for (const auto& i : orbital_space.indices(OccupationType::k_occupied)) {
508 F_par(p, q) += 2 * g_par(p, q, i, i) - g_par(p, i, i, q);
509 }
510 }
511 } // F elements loop
512
513 return ScalarSQOneElectronOperator {F_par};
514 }
515
516
517 /*
518 * MARK: Conforming to BasisTransformable
519 */
520
528 Self transformed(const Transformation& T) const override {
529
530 auto result = *this;
531
532 // Transform the one and two-electron contributions.
533 for (auto& h : result.coreContributions()) {
534 h.transform(T);
535 }
536
537 for (auto& g : result.twoElectronContributions()) {
538 g.transform(T);
539 }
540
541 // Transform the total one- and two-electron interactions.
542 result.core().transform(T);
543 result.twoElectron().transform(T);
544
545 return result;
546 }
547
548
549 // Allow the `rotate` method from `BasisTransformable`, since there's also a `rotate` from `JacobiRotatable`.
551
552 // Allow the `rotated` method from `BasisTransformable`, since there's also a `rotated` from `JacobiRotatable`.
554
555
556 /*
557 * MARK: Conforming to JacobiRotatable
558 */
559
567 Self rotated(const JacobiRotationType& jacobi_rotation) const override {
568
569 auto result = *this;
570
571 // Transform the one and two-electron contributions.
572 for (auto& h : result.coreContributions()) {
573 h.rotate(jacobi_rotation);
574 }
575
576 for (auto& g : result.twoElectronContributions()) {
577 g.rotate(jacobi_rotation);
578 }
579
580 // Transform the total one- and two-electron interactions.
581 result.core().rotate(jacobi_rotation);
582 result.twoElectron().rotate(jacobi_rotation);
583
584 return result;
585 }
586
587 // Allow the `rotate` method from `JacobiRotatable`, since there's also a `rotate` from `BasisTransformable`.
589
590
591 /*
592 * MARK: Operations related to one-electron operators
593 */
594
599
600 // Update the one-electron contributions and the total one-electron operator.
601 this->h_contributions.push_back(sq_one_op);
602 this->h += sq_one_op;
603
604 return *this;
605 }
606
607
612 lhs += rhs;
613 return lhs;
614 }
615
616
621 return rhs += lhs;
622 }
623
624
629
630 *this += -sq_one_op;
631 return *this;
632 }
633
634
639 lhs -= rhs;
640 return lhs;
641 }
642
643
644 /*
645 * MARK: Operations related to two-electron operators
646 */
647
652
653 // Update the one-electron contributions and the total one-electron operator.
654 this->g_contributions.push_back(sq_two_op);
655 this->g += sq_two_op;
656
657 return *this;
658 }
659
660
665 lhs += rhs;
666 return lhs;
667 }
668
669
674 return rhs += lhs;
675 }
676
677
682
683 *this += -sq_two_op;
684 return *this;
685 }
686
687
692 lhs -= rhs;
693 return lhs;
694 }
695};
696
697
698/*
699 * MARK: Operator traits
700 */
701
705template <typename ScalarSQOneElectronOperator, typename ScalarSQTwoElectronOperator>
706struct OperatorTraits<SQHamiltonian<ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator>> {
707
708 // The type of transformation that is naturally associated to the second-quantized Hamiltonian.
710
711 // The type of the one-particle density matrix that is naturally associated to the second-quantized Hamiltonian.
713
714 // The type of the two-particle density matrix that is naturally associated to the second-quantized Hamiltonian.
716};
717
718
719/*
720 * MARK: BasisTransformableTraits
721 */
722
726template <typename ScalarSQOneElectronOperator, typename ScalarSQTwoElectronOperator>
727struct BasisTransformableTraits<SQHamiltonian<ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator>> {
728
729 // The type of the transformation for which the basis transformation should be defined.
731};
732
733
734/*
735 * MARK: JacobiRotatableTraits
736 */
737
741template <typename ScalarSQOneElectronOperator, typename ScalarSQTwoElectronOperator>
742struct JacobiRotatableTraits<SQHamiltonian<ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator>> {
743
744 // The type of Jacobi rotation for which the Jacobi rotation should be defined.
746};
747
748
749/*
750 * MARK: Convenience aliases
751 */
752
753
754// An `SQHamiltonian` related to restricted spin-orbitals. See `RestrictedSpinOrbitalTag`.
755template <typename Scalar>
757
758
759// An `SQHamiltonian` related to unrestricted spin-orbitals. See `UnrestrictedSpinOrbitalTag`.
760template <typename Scalar>
762
763
764// An `SQHamiltonian` related to general spinors. See `GeneralSpinorTag`.
765template <typename Scalar>
767
768
769} // namespace GQCP
Definition: BasisTransformable.hpp:50
void rotate(const Transformation &U)
Definition: BasisTransformable.hpp:107
virtual void transform(const Transformation &T)
Definition: BasisTransformable.hpp:79
Definition: GSQTwoElectronOperator.hpp:43
Definition: HubbardHamiltonian.hpp:36
enable_if_t< std::is_same< Z, double >::value, ScalarRSQTwoElectronOperator< double > > twoElectron() const
Definition: HubbardHamiltonian.hpp:189
enable_if_t< std::is_same< Z, double >::value, ScalarRSQOneElectronOperator< double > > core() const
Definition: HubbardHamiltonian.hpp:164
Definition: JacobiRotatable.hpp:50
Definition: OrbitalSpace.hpp:40
const std::vector< size_t > & indices() const
Definition: OrbitalSpace.hpp:150
Definition: RSQOneElectronOperator.hpp:42
Definition: RSQTwoElectronOperator.hpp:43
Definition: SQHamiltonian.hpp:54
SQHamiltonian< ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator > Self
Definition: SQHamiltonian.hpp:75
typename ScalarSQOneElectronOperator::SpinorTag SpinorTag
Definition: SQHamiltonian.hpp:66
static enable_if_t< std::is_same< Z, double >::value, Self > Random(const size_t dim)
Definition: SQHamiltonian.hpp:203
const std::vector< ScalarSQTwoElectronOperator > & twoElectronContributions() const
Definition: SQHamiltonian.hpp:348
enable_if_t< std::is_same< Z, GeneralSpinorTag >::value, ScalarSQOneElectronOperator > calculateInactiveFockian(const OrbitalSpace orbital_space) const
Definition: SQHamiltonian.hpp:465
enable_if_t< std::is_same< Z, RestrictedSpinOrbitalTag >::value, ScalarSQOneElectronOperator > calculateInactiveFockian(const OrbitalSpace orbital_space) const
Definition: SQHamiltonian.hpp:495
Scalar calculateExpectationValue(const OneDM &D, const TwoDM &d) const
Definition: SQHamiltonian.hpp:416
enable_if_t< std::is_same< Z, RestrictedSpinOrbitalTag >::value||std::is_same< Z, GeneralSpinorTag >::value, double > calculateEdmistonRuedenbergLocalizationIndex(const OrbitalSpace orbital_space) const
Definition: SQHamiltonian.hpp:380
const ScalarSQTwoElectronOperator & twoElectron() const
Definition: SQHamiltonian.hpp:338
Self & operator+=(const ScalarSQTwoElectronOperator &sq_two_op)
Definition: SQHamiltonian.hpp:651
ScalarSQTwoElectronOperator & twoElectron()
Definition: SQHamiltonian.hpp:343
static enable_if_t< std::is_same< Z, UnrestrictedSpinorTag >::value, SQHamiltonian< ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator > > FromRestricted(const SQHamiltonian< ScalarRSQOneElectronOperator< Scalar >, ScalarRSQTwoElectronOperator< Scalar > > &r_hamiltonian)
Definition: SQHamiltonian.hpp:184
Self & operator-=(const ScalarSQTwoElectronOperator &sq_two_op)
Definition: SQHamiltonian.hpp:681
const std::vector< ScalarSQOneElectronOperator > & coreContributions() const
Definition: SQHamiltonian.hpp:328
typename OperatorTraits< ScalarSQOneElectronOperator >::OneDM OneDM
Definition: SQHamiltonian.hpp:78
Self transformed(const Transformation &T) const override
Definition: SQHamiltonian.hpp:528
_ScalarSQOneElectronOperator ScalarSQOneElectronOperator
Definition: SQHamiltonian.hpp:57
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, RestrictedSpinorTag >::value, SQHamiltonian< ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator > > FromHubbard(const HubbardHamiltonian< double > &hubbard_hamiltonian)
Definition: SQHamiltonian.hpp:167
ScalarSQOneElectronOperator & core()
Definition: SQHamiltonian.hpp:323
const ScalarSQOneElectronOperator & core() const
Definition: SQHamiltonian.hpp:318
enable_if_t< std::is_same< Z, RestrictedSpinOrbitalTag >::value||std::is_same< Z, GeneralSpinorTag >::value, SquareMatrix< Scalar > > calculateFockianMatrix(const OneDM &D, const TwoDM &d) const
Definition: SQHamiltonian.hpp:434
typename ScalarSQOneElectronOperator::Scalar Scalar
Definition: SQHamiltonian.hpp:72
std::vector< ScalarSQOneElectronOperator > & coreContributions()
Definition: SQHamiltonian.hpp:333
typename JacobiRotatableTraits< ScalarSQOneElectronOperator >::JacobiRotationType JacobiRotationType
Definition: SQHamiltonian.hpp:87
enable_if_t< std::is_same< Z, RestrictedSpinOrbitalTag >::value||std::is_same< Z, GeneralSpinorTag >::value, ScalarSQOneElectronOperator > calculateEffectiveOneElectronIntegrals() const
Definition: SQHamiltonian.hpp:402
friend Self operator-(Self lhs, const ScalarSQTwoElectronOperator &rhs)
Definition: SQHamiltonian.hpp:691
enable_if_t< std::is_same< Z, RestrictedSpinOrbitalTag >::value||std::is_same< Z, GeneralSpinorTag >::value, SquareRankFourTensor< Scalar > > calculateSuperFockianMatrix(const OneDM &D, const TwoDM &d) const
Definition: SQHamiltonian.hpp:450
friend Self operator+(const ScalarSQOneElectronOperator &lhs, Self rhs)
Definition: SQHamiltonian.hpp:620
size_t numberOfOrbitals() const
Definition: SQHamiltonian.hpp:363
friend Self operator+(Self lhs, const ScalarSQOneElectronOperator &rhs)
Definition: SQHamiltonian.hpp:611
Self & operator+=(const ScalarSQOneElectronOperator &sq_one_op)
Definition: SQHamiltonian.hpp:598
typename OperatorTraits< ScalarSQOneElectronOperator >::Transformation Transformation
Definition: SQHamiltonian.hpp:84
friend Self operator-(Self lhs, const ScalarSQOneElectronOperator &rhs)
Definition: SQHamiltonian.hpp:638
std::vector< ScalarSQTwoElectronOperator > & twoElectronContributions()
Definition: SQHamiltonian.hpp:353
Self rotated(const JacobiRotationType &jacobi_rotation) const override
Definition: SQHamiltonian.hpp:567
friend Self operator+(Self lhs, const ScalarSQTwoElectronOperator &rhs)
Definition: SQHamiltonian.hpp:664
SQHamiltonian(const std::vector< ScalarSQOneElectronOperator > &h_contributions, const std::vector< ScalarSQTwoElectronOperator > &g_contributions)
Definition: SQHamiltonian.hpp:115
_ScalarSQTwoElectronOperator ScalarSQTwoElectronOperator
Definition: SQHamiltonian.hpp:60
friend Self operator+(const ScalarSQTwoElectronOperator &lhs, Self rhs)
Definition: SQHamiltonian.hpp:673
static enable_if_t< std::is_same< Z1, double >::value &&std::is_same< Z2, RestrictedSpinOrbitalTag >::value, SQHamiltonian< ScalarSQOneElectronOperator, ScalarSQTwoElectronOperator > > FromFCIDUMP(const std::string &fcidump_filename)
Definition: SQHamiltonian.hpp:222
typename OperatorTraits< ScalarSQOneElectronOperator >::TwoDM TwoDM
Definition: SQHamiltonian.hpp:81
SQHamiltonian(const ScalarSQOneElectronOperator &h, const ScalarSQTwoElectronOperator &g)
Definition: SQHamiltonian.hpp:148
Self & operator-=(const ScalarSQOneElectronOperator &sq_one_op)
Definition: SQHamiltonian.hpp:628
Definition: SquareMatrix.hpp:39
static Self Zero(const size_t dim)
Definition: SquareMatrix.hpp:289
Definition: SquareRankFourTensor.hpp:36
static USQOneElectronOperator< Scalar, Vectorizer > FromRestricted(const RSQOneElectronOperator< Scalar, Vectorizer > &f_restricted)
Definition: USQOneElectronOperator.hpp:151
Definition: USQTwoElectronOperator.hpp:50
static USQTwoElectronOperator< Scalar, Vectorizer > FromRestricted(const RSQTwoElectronOperator< Scalar, Vectorizer > &g_restricted)
Definition: USQTwoElectronOperator.hpp:171
Definition: EvaluableLinearCombination.hpp:330
Definition: BaseOneElectronIntegralBuffer.hpp:25
typename std::enable_if< B, T >::type enable_if_t
Definition: type_traits.hpp:37
@ x
Definition: CartesianDirection.hpp:28
std::ifstream validateAndOpen(const std::string &filename, const std::string &extension)
Definition: miscellaneous.cpp:266
typename OperatorTraits< ScalarSQOneElectronOperator >::Transformation Transformation
Definition: SQHamiltonian.hpp:730
Definition: BasisTransformable.hpp:37
typename JacobiRotatableTraits< ScalarSQOneElectronOperator >::JacobiRotationType JacobiRotationType
Definition: SQHamiltonian.hpp:745
Definition: JacobiRotatable.hpp:37
typename OperatorTraits< ScalarSQOneElectronOperator >::Transformation Transformation
Definition: SQHamiltonian.hpp:709
typename OperatorTraits< ScalarSQOneElectronOperator >::OneDM OneDM
Definition: SQHamiltonian.hpp:712
typename OperatorTraits< ScalarSQOneElectronOperator >::TwoDM TwoDM
Definition: SQHamiltonian.hpp:715
Definition: OperatorTraits.hpp:28