![]() |
(git:b77b4be)
|
Cayley transformation methods. More...
Functions/Subroutines | |
subroutine, public | ct_step_execute (cts_env) |
Performs Cayley transformation. | |
subroutine, public | analytic_line_search (a, b, c, d, minima, nmins) |
Finds real roots of a cubic equation
Step 0: Check the true order of the equation. Cubic, quadratic, linear? Step 1: Calculate p and q p = ( 3*c/a - (b/a)**2 ) / 3 q = ( 2*(b/a)**3 - 9*b*c/a/a + 27*d/a ) / 27 Step 2: Calculate discriminant D D = (p/3)**3 + (q/2)**2 Step 3: Depending on the sign of D, we follow different strategy. If D<0, three distinct real roots. If D=0, three real roots of which at least two are equal. If D>0, one real and two complex roots. Step 3a: For D>0 and D=0, Calculate u and v u = cubic_root(-q/2 + sqrt(D)) v = cubic_root(-q/2 - sqrt(D)) Find the three transformed roots y1 = u + v y2 = -(u+v)/2 + i (u-v)*sqrt(3)/2 y3 = -(u+v)/2 - i (u-v)*sqrt(3)/2 Step 3b Alternately, for D<0, a trigonometric formulation is more convenient y1 = 2 * sqrt(|p|/3) * cos(phi/3) y2 = -2 * sqrt(|p|/3) * cos((phi+pi)/3) y3 = -2 * sqrt(|p|/3) * cos((phi-pi)/3) where phi = acos(-q/2/sqrt(|p|**3/27)) pi = 3.141592654... Step 4 Find the real roots x = y - b/a/3 Step 5 Check the derivative and return only those real roots for which the derivative is positive. | |
subroutine, public | diagonalize_diagonal_blocks (matrix, c, e) |
Diagonalizes diagonal blocks of a symmetric dbcsr matrix and returs its eigenvectors. | |
Cayley transformation methods.
subroutine, public ct_methods::ct_step_execute | ( | type(ct_step_env_type) | cts_env | ) |
Performs Cayley transformation.
cts_env | ... |
Definition at line 62 of file ct_methods.F.
subroutine, public ct_methods::analytic_line_search | ( | real(kind=dp), intent(in) | a, |
real(kind=dp), intent(in) | b, | ||
real(kind=dp), intent(in) | c, | ||
real(kind=dp), intent(in) | d, | ||
real(kind=dp), dimension(3), intent(out) | minima, | ||
integer, intent(out) | nmins | ||
) |
Finds real roots of a cubic equation
a*x**3 + b*x**2 + c*x + d = 0 and returns only those roots for which the derivative is positive
Step 0: Check the true order of the equation. Cubic, quadratic, linear? Step 1: Calculate p and q p = ( 3*c/a - (b/a)**2 ) / 3 q = ( 2*(b/a)**3 - 9*b*c/a/a + 27*d/a ) / 27 Step 2: Calculate discriminant D D = (p/3)**3 + (q/2)**2 Step 3: Depending on the sign of D, we follow different strategy. If D<0, three distinct real roots. If D=0, three real roots of which at least two are equal. If D>0, one real and two complex roots. Step 3a: For D>0 and D=0, Calculate u and v u = cubic_root(-q/2 + sqrt(D)) v = cubic_root(-q/2 - sqrt(D)) Find the three transformed roots y1 = u + v y2 = -(u+v)/2 + i (u-v)*sqrt(3)/2 y3 = -(u+v)/2 - i (u-v)*sqrt(3)/2 Step 3b Alternately, for D<0, a trigonometric formulation is more convenient y1 = 2 * sqrt(|p|/3) * cos(phi/3) y2 = -2 * sqrt(|p|/3) * cos((phi+pi)/3) y3 = -2 * sqrt(|p|/3) * cos((phi-pi)/3) where phi = acos(-q/2/sqrt(|p|**3/27)) pi = 3.141592654... Step 4 Find the real roots x = y - b/a/3 Step 5 Check the derivative and return only those real roots for which the derivative is positive.
a | ... |
b | ... |
c | ... |
d | ... |
minima | ... |
nmins | ... |
Definition at line 1374 of file ct_methods.F.
subroutine, public ct_methods::diagonalize_diagonal_blocks | ( | type(dbcsr_type), intent(in) | matrix, |
type(dbcsr_type), intent(out) | c, | ||
type(dbcsr_type), intent(out), optional | e | ||
) |
Diagonalizes diagonal blocks of a symmetric dbcsr matrix and returs its eigenvectors.
matrix | ... |
c | ... |
e | ... |
Definition at line 1497 of file ct_methods.F.