sisi4s
Loading...
Searching...
No Matches
CoulombVertexDecomposition.hpp
Go to the documentation of this file.
1#ifndef COULOMB_VERTEX_DECOMPOSITION_DEFINED
2#define COULOMB_VERTEX_DECOMPOSITION_DEFINED
3
5#include <DryTensor.hpp>
6#include <math/Complex.hpp>
8#include <util/Tensor.hpp>
9
10namespace sisi4s {
22public:
24 CoulombVertexDecomposition(std::vector<Argument> const &argumentList);
26 virtual void run();
27 virtual void dryRun();
28
32 int64_t rank;
33
34 static int64_t constexpr DEFAULT_RANK_SIZE = -1;
35
36 static double constexpr DEFAULT_RANK_FACTOR = 3.0;
37
42 double Delta;
43
55
63
76 CTF::Matrix<complex> *PiqR;
80 CTF::Matrix<complex> *PirR;
84 CTF::Matrix<complex> *LambdaGR;
85
93
94 static constexpr int64_t DEFAULT_MAX_ITERATIONS = 32;
95 static constexpr double DEFAULT_DELTA = 0.0;
96 static constexpr double DEFAULT_SWAMPING_THRESHOLD = 1.0;
97 static constexpr double DEFAULT_REGULARIZATION_FRICTION = 0.125;
98 static constexpr bool DEFAULT_REAL_FACTOR_ORBITALS = false;
99 static constexpr bool DEFAULT_NORMALIZED_FACTOR_ORBITALS = false;
100 static constexpr bool DEFAULT_WRITE_SUB_ITERATIONS = false;
101
102 static const std::string SYMMETRIC;
103 static const std::string HERMITIAN;
104 static const std::string PSEUDO_INVERSE;
105
106protected:
111 void fit(int64_t iterationsCount);
130
139 void iterateQuadraticFactor(int iterationsCount);
140
148 void computeOutgoingPi();
149
153 double getDelta();
154};
155} // namespace sisi4s
156
157#endif
#define ALGORITHM_REGISTRAR_DECLARATION(NAME)
Auxiliary macro declaring the algorithm registrar for the algorithm type of the given name....
Definition Algorithm.hpp:169
Definition Algorithm.hpp:26
Definition RegularizedAlternatingLeastSquares.hpp:10
Decomposes the Coulomb vertex into the factor orbitals and the Coulom factors . The decomposition i...
Definition CoulombVertexDecomposition.hpp:21
static constexpr bool DEFAULT_WRITE_SUB_ITERATIONS
Definition CoulombVertexDecomposition.hpp:100
static constexpr bool DEFAULT_REAL_FACTOR_ORBITALS
Definition CoulombVertexDecomposition.hpp:98
static int64_t constexpr DEFAULT_RANK_SIZE
Definition CoulombVertexDecomposition.hpp:34
static constexpr bool DEFAULT_NORMALIZED_FACTOR_ORBITALS
Definition CoulombVertexDecomposition.hpp:99
static double constexpr DEFAULT_RANK_FACTOR
Definition CoulombVertexDecomposition.hpp:36
static constexpr double DEFAULT_REGULARIZATION_FRICTION
Definition CoulombVertexDecomposition.hpp:97
CTF::Matrix< complex > * LambdaGR
The full Coulomb factors .
Definition CoulombVertexDecomposition.hpp:84
int64_t rank
The rank of the tensor rank decomposition.
Definition CoulombVertexDecomposition.hpp:32
void realizePi(Tensor< complex > &Pi)
Discards the imaginary part of the given factor orbitals.
Definition CoulombVertexDecomposition.cxx:309
Tensor< complex > * GammaGqr
The full Coulomb vertex .
Definition CoulombVertexDecomposition.hpp:67
CTF::Matrix< complex > * PiqR
The conjugated factor orbitals .
Definition CoulombVertexDecomposition.hpp:76
bool normalizedFactorOrbitals
Whether the factor orbitals are required to be normalized, i.e. .
Definition CoulombVertexDecomposition.hpp:54
static const std::string PSEUDO_INVERSE
Definition CoulombVertexDecomposition.hpp:104
void computeOutgoingPi()
Takes the incoming factor orbitals and computes the outgoing factor orbitals according to the chosen ...
Definition CoulombVertexDecomposition.cxx:379
double getDelta()
Computes and returns the difference.
Definition CoulombVertexDecomposition.cxx:396
Tensor< complex > * composedGammaGqr
The fit .
Definition CoulombVertexDecomposition.hpp:71
bool realFactorOrbitals
Whether the factor orbitals are required to be real.
Definition CoulombVertexDecomposition.hpp:48
bool writeSubIterations
Whether to write Delta after each part of one RALS iteration, where Delta is the Frobenius norm of .
Definition CoulombVertexDecomposition.hpp:62
virtual ~CoulombVertexDecomposition()
Definition CoulombVertexDecomposition.cxx:24
void iterateQuadraticFactor(int iterationsCount)
Solves the quadratically occurring factor Pi iteratively similar to the Babylonian algorithm.
Definition CoulombVertexDecomposition.cxx:318
static constexpr int64_t DEFAULT_MAX_ITERATIONS
Definition CoulombVertexDecomposition.hpp:94
static constexpr double DEFAULT_SWAMPING_THRESHOLD
Definition CoulombVertexDecomposition.hpp:96
virtual void run()
Definition CoulombVertexDecomposition.cxx:32
AlternatingLeastSquaresRegularizationEstimator * regularizationEstimator
Estimator for the regularization parameter during the alternating least squares fits....
Definition CoulombVertexDecomposition.hpp:92
void fit(int64_t iterationsCount)
Performs one iteration in fitting the factor orbitals and the Coulomb factors according to the given ...
Definition CoulombVertexDecomposition.cxx:235
CTF::Matrix< complex > * PirR
The factor orbitals .
Definition CoulombVertexDecomposition.hpp:80
void dryFit(DryTensor< complex > *GammaGqr, DryTensor< complex > *PiqR, DryTensor< complex > *PirR, DryTensor< complex > *LambdaGR, DryTensor< complex > *composedGammaGqr)
Performs a dry run of one iteration in fitting the factor orbitals and the Coulomb factors according ...
Definition CoulombVertexDecomposition.cxx:260
static const std::string SYMMETRIC
Definition CoulombVertexDecomposition.hpp:102
static const std::string HERMITIAN
Definition CoulombVertexDecomposition.hpp:103
double Delta
The Frobenius norm of the difference between and its decomposition.
Definition CoulombVertexDecomposition.hpp:42
void normalizePi(Tensor< complex > &Pi)
Normalizes the given factor orbitals, such that .
Definition CoulombVertexDecomposition.cxx:295
static constexpr double DEFAULT_DELTA
Definition CoulombVertexDecomposition.hpp:95
virtual void dryRun()
The dryRun estimates resource consumption, especially memory and processor time.
Definition CoulombVertexDecomposition.cxx:157
Definition DryTensor.hpp:36
Definition Algorithm.hpp:10
CTF::Tensor< F > Tensor
Definition Tensor.hpp:9
constexpr F Pi()
Definition MathFunctions.hpp:13