Loading...
Searching...
No Matches
Lanczos.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "Eigen.h"
14#include "EonLogger.h"
15
16#include "LowestEigenmode.h"
17#include "Matter.h"
18#include "Parameters.h"
19
20#include <memory>
21
22namespace eonc {
23
24// Lanczos method to find the lowest curvature mode.
25// Default Krylov space = all free atoms ([Lanczos] phva_atoms = All).
26// Optional mobile list (or phva_atoms) is the PHVA active set: free/fixed is
27// the optimizer mask and is not redefined.
28class Lanczos : public LowestEigenmode {
29
30public:
31 Lanczos(std::shared_ptr<Matter> matter, const Parameters &params,
32 std::shared_ptr<Potential> pot);
33 ~Lanczos() = default;
34 void compute(std::shared_ptr<Matter> matter,
35 AtomMatrix initialDirection) override;
38 void compute(std::shared_ptr<Matter> matter, AtomMatrix initialDirection,
39 const VectorXi &mobileAtoms);
40 double getEigenvalue() override;
41 AtomMatrix getEigenvector() override;
44 void evaluateWithProbe(const std::shared_ptr<Matter> &centre,
45 const AtomMatrix &direction) override;
46
47private:
48 // Displaced image evaluated together with its centre by
49 // evaluateWithProbe(); the first product of compute() takes it.
50 std::unique_ptr<Matter> probe_;
52 double lowestEw{0.0};
54};
55
56} // namespace eonc
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
~Lanczos()=default
Lanczos(std::shared_ptr< Matter > matter, const Parameters &params, std::shared_ptr< Potential > pot)
Definition Lanczos.cpp:37
void evaluateWithProbe(const std::shared_ptr< Matter > &centre, const AtomMatrix &direction) override
The probe is the first Krylov product's displaced image, for the one-sided product only.
Definition Lanczos.cpp:75
AtomMatrix lowestEv
Definition Lanczos.h:51
double lowestEw
Definition Lanczos.h:52
AtomMatrix getEigenvector() override
Definition Lanczos.cpp:253
double getEigenvalue() override
Definition Lanczos.cpp:251
void compute(std::shared_ptr< Matter > matter, AtomMatrix initialDirection) override
Definition Lanczos.cpp:45
std::unique_ptr< Matter > probe_
Definition Lanczos.h:50
eonc::log::Scoped log
Definition Lanczos.h:53
const Parameters & params
std::shared_ptr< Potential > pot
LowestEigenmode(std::shared_ptr< Potential > potPassed, const Parameters &parameters)
RAII resource manager for the ARTn C library with global synchronization.
RAII helper for class-scoped logging.
Definition EonLogger.h:238