LandauGinzburg
Loading...
Searching...
No Matches
field_potential.hpp
Go to the documentation of this file.
1
7#ifndef FIELD_POTENTIAL_INCLUDED
8#define FIELD_POTENTIAL_INCLUDED
9
10#include "field_class.hpp"
11
18namespace MatrixComp {
24 extern MatrixXcd ResizeMatrix (const MatrixXcd &m,
25 const int rw, const int cl);
31 extern MatrixXcd DeleteZeroLine (const MatrixXcd &m);
37 extern double DiffLU (const MatrixXcd &m,
38 const PartialPivLU<MatrixXcd> &lu);
44 extern int SignDet (const MatrixXcd &m, const int debug = 0);
45};
46
47
48
60class Potential :public Field {
61// protected:
69 void setpotential(const MatrixXcd &m);
77 void setpotential(const MatrixXcd &m, const int num_field);
78
84 MatrixXcd jacobian() const;
85
91 MatrixXcd unifield_tilde_type() const;
96 MatrixXcd unifield_jacobian() const;
101 MatrixXcd dualfield_jacobian() const;
106 MatrixXcd triplefield_jacobian1() const;
111 MatrixXcd triplefield_jacobian2() const;
116 MatrixXcd multifield_jacobian() const;
117
118public:
121 explicit Potential() {};
130 explicit Potential(const int n1, const int n2,
132 : Field(n1, n2) {
133 int num_p = int(num_f*(num_f+1)/2); setconf(num_p, n3); };
141 explicit Potential(const MatrixXcd &m) {
142 setpotential(m);
143 };
151 explicit Potential(const MatrixXcd &m, const int num_field) {
152 setpotential(m, num_field);
153 };
156 virtual ~Potential() {};
157
162 virtual bool operator==(const Potential &p) {return (Li==p.Li) && (num_f == p.num_f);};
167 virtual bool operator!=(const Potential &p) {return !(*this==p);};
168
180 int sign_det(const int debug = 0) const;
187 int sign_det4multifield (const int debug = 0) const;
192 virtual void show() const;
193};
194
195
196
214class PotentialNR: public Potential {
216 MatrixXcd field2;
218 MatrixXcd field3;
219
220public:
223 explicit PotentialNR() {};
233 explicit PotentialNR(const int n1, const int n2,
235 : Potential(n1, n2, n3) {
236 int N = (Li+1)*(Li+1);
237 field2 = MatrixXcd::Zero(N, num_f);
238 field3 = MatrixXcd::Zero(N, num_f);
239 };
248 explicit PotentialNR(const int num_field,
249 const MatrixXcd &m1,
250 const MatrixXcd &m2, const MatrixXcd &m3)
252 int N = m1.rows();
253 try {
254 if (m2.rows()!=N || m3.rows()!=N
255 || m2.cols()!=num_f || m3.cols()!=num_f) throw 1;
256 field2 = m2; field3 = m3;
257 } catch (const int i) {
260 }
261 };
265
270 bool operator==(const PotentialNR &p) {return (Li==p.Li) && (num_f == p.num_f);};
275 bool operator!=(const PotentialNR &p) {return !(*this==p);};
276
284 VectorXd nr_pvec() const;
292 MatrixXd nr_mat() const;
293
301 VectorXcd nrerr_pvec() const;
302
307 void show() const;
308};
309
310#endif
Generate normal distributions; Compute convolutions.
void setconf(const int num_col, const Distribution n, const double mean=0.0, const double dev=1.0)
int Li
Physical box size, N_0=N_1.
int num_f
Number of superfields.
Compute Jacobian and its sign determinant.
Potential()
Constructor of Potential.
virtual bool operator==(const Potential &p)
Is identical (Li, num_f) ?
virtual void show() const
Output Li, field.
int sign_det(const int debug=0) const
Sign determinant with a fast algorithm (num_f < 4)
int sign_det4multifield(const int debug=0) const
Sign determinant for mutli-superfield.
virtual bool operator!=(const Potential &p)
Not identical (Li, num_f) ?
Potential(const MatrixXcd &m)
Set Li and field from MatrixXcd, but num_f such as num_f(num_f+1)/2==field.cols()
Potential(const int n1, const int n2, const Distribution n3=Distribution::Zero_conf)
Set Li, num_f, and field.
Potential(const MatrixXcd &m, const int num_field)
Set Li and field from MatrixXcd, but num_f=num_field
virtual ~Potential()
Destructor of Potential.
Compute Matrix and Vector for NR method.
bool operator==(const PotentialNR &p)
Is identical (Li, num_f) ?
VectorXd nr_pvec() const
Compute Vector for NR method (Real type)
PotentialNR(const int num_field, const MatrixXcd &m1, const MatrixXcd &m2, const MatrixXcd &m3)
Set Li, num_f, and field-field2-field3.
MatrixXd nr_mat() const
Compute Matrix for NR method (Real type)
PotentialNR()
Constructor of PotentialNR.
PotentialNR(const int n1, const int n2, const Distribution n3=Distribution::Zero_conf)
Set Li, num_f, and field-field2-field3 with zeros.
void show() const
Output Li, field, field2, field3.
VectorXcd nrerr_pvec() const
Compute Vector for NR error estimate (complex type)
~PotentialNR()
Destructor of PotentialNR.
bool operator!=(const PotentialNR &p)
Not identical (Li, num_f) ?
Definition of the class Field.
Distribution
Types of normal distributions.
Mainly functions to compute Jacobian for uni-superfield.
MatrixXcd DeleteZeroLine(const MatrixXcd &m)
Delete a row and a column with p=0, q=0.
double DiffLU(const MatrixXcd &m, const PartialPivLU< MatrixXcd > &lu)
Difference between a matrix and its LU decomposition.
int SignDet(const MatrixXcd &m, const int debug=0)
Sign of determinant with LU Decomposition.
MatrixXcd ResizeMatrix(const MatrixXcd &m, const int rw, const int cl)
Output m as MatrixXcd(rw, cl) with zeros.