ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
calcMatrixElements.hpp
1 #pragma once
2 #include "CorePolarisation.hpp"
3 #include "Coulomb/meTable.hpp"
4 #include "MBPT/StructureRad.hpp"
5 #include "qip/String.hpp"
6 #include <iostream>
7 #include <string>
8 #include <vector>
9 class DiracSpinor;
10 namespace DiracOperator {
11 class TensorOperator;
12 }
13 namespace HF {
14 class HartreeFock;
15 }
16 
17 namespace ExternalField {
18 
20 
30 struct MEdata {
31 
32  std::string a, b;
33  double w_ab;
34  double hab, dv;
35 
36  static std::string title(bool rpaQ = true) {
37  if (rpaQ)
38  return " a b w_ab t_ab RPA_ab";
39  else
40  return " a b w_ab t_ab";
41  }
42  static std::string title_noRPA() { return " a b w_ab t_ab"; }
43 
44  friend std::ostream &operator<<(std::ostream &os, const MEdata &m) {
45  os << qip::fstring(" %4s %4s %8.5f %13.6e", m.a.c_str(), m.b.c_str(),
46  m.w_ab, m.hab);
47  if (m.dv != 0.0) {
48  os << qip::fstring(" %13.6e", m.hab + m.dv);
49  }
50  return os;
51  }
52 };
53 
54 std::vector<MEdata>
55 calcMatrixElements(const std::vector<DiracSpinor> &b_orbs,
56  const std::vector<DiracSpinor> &a_orbs,
58  CorePolarisation *const dV = nullptr, double omega = 0.0,
59  bool each_freq = false, bool diagonal = true,
60  bool off_diagonal = true, bool calculate_both = false);
61 
62 inline std::vector<MEdata>
63 calcMatrixElements(const std::vector<DiracSpinor> &orbs,
65  CorePolarisation *const dV = nullptr, double omega = 0.0,
66  bool each_freq = false, bool diagonal = true,
67  bool off_diagonal = true, bool calculate_both = false) {
68  return calcMatrixElements(orbs, orbs, h, dV, omega, each_freq, diagonal,
69  off_diagonal, calculate_both);
70 }
71 
74 Coulomb::meTable<double> me_table(const std::vector<DiracSpinor> &a_orbs,
75  const std::vector<DiracSpinor> &b_orbs,
77  const CorePolarisation *dV = nullptr,
78  const MBPT::StructureRad *srn = nullptr,
79  std::optional<double> omega = {});
80 
84 me_table(const std::vector<DiracSpinor> &a_orbs,
86  const CorePolarisation *dV = nullptr,
87  const MBPT::StructureRad *srn = nullptr,
88  std::optional<double> omega = {}) {
89  return me_table(a_orbs, a_orbs, h, dV, srn, omega);
90 }
91 
92 std::unique_ptr<CorePolarisation>
93 make_rpa(const std::string &method, const DiracOperator::TensorOperator *h,
94  const HF::HartreeFock *vhf, bool print = false,
95  const std::vector<DiracSpinor> &basis = {},
96  const std::string &identity = "");
97 
98 } // namespace ExternalField
Look-up table for matrix elements. Note: does not assume any symmetry: (a,b) is stored independantly ...
Definition: meTable.hpp:17
General operator (virtual base class); operators derive from this.
Definition: TensorOperator.hpp:110
Stores radial Dirac spinor: F_nk = (f, g)
Definition: DiracSpinor.hpp:41
Virtual Core Polarisation class, for <a||dV||b>. See TDHF, DiagramRPA, etc.
Definition: CorePolarisation.hpp:35
Solves relativistic Hartree-Fock equations for core and valence. Optionally includes Breit and QED ef...
Definition: HartreeFock.hpp:70
Calculates Structure Radiation + Normalisation of states, using diagram method.
Definition: StructureRad.hpp:52
Dirac Operators: General + derived.
Definition: GenerateOperator.cpp:12
Calculates many-body corrections (RPA) to matrix elements of external field.
Definition: calcMatrixElements.cpp:14
Coulomb::meTable< double > me_table(const std::vector< DiracSpinor > &a_orbs, const std::vector< DiracSpinor > &b_orbs, const DiracOperator::TensorOperator *h, const CorePolarisation *dV, const MBPT::StructureRad *srn, std::optional< double > omega)
Fills me_table with MEs, <a||h||b> and <b||h||a>. Required to set omega for freq. dependent operators...
Definition: calcMatrixElements.cpp:111
Functions and classes for Hartree-Fock.
Definition: CI_Integrals.hpp:12
std::string fstring(const std::string format,...)
Returns a formatted std::string, with formatting printf-like commands. Note: maximum string lenth is ...
Definition: String.hpp:18
Small struct to store calculated matrix elements.
Definition: calcMatrixElements.hpp:30