SlideShare a Scribd company logo
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
A block-step version of KS regularization 
at Steller N-body Dynamics, Sexten 
Keigo Nitadori 
Co-Design Team, Exascale Computing Project 
RIKEN Advanced Institute for Computational Sciencd 
September 10, 2014
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Acknowledgement 
My sincerest thanks go to Sverre Aarseth and IoA for inviting 
me 7 times, 07, 08, 09, 10, 11, 12, and 13, in which the most 
important and creative collaboration on the development of 
NBODY6/GPU was done.
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Abstract 
I talk about a new future implemented in NBODY6/GPU: 
A block-step version of KS regularized binary. 
I To eliminate serial bottleneck 
I Very accurate with fully conservational Hermite integrator 
Amazingly, it is already working! 
Public code is available as nbody6b and nbody7b
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Topics 
1. Brief introduction of Kustaanheimo–Stiefel (KS) 
regularization (with Hamilton’s quaternion numbers) 
2. A very accurate variant of Hermite integrator for harmonic 
oscillators (and regularized binaries) 
3. Block stepping in real time t
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
3 steps of regularization 
1. Time transformation. dt = krkd, (hereafter, [˙] = d 
dt [ ], 
d [ ] = krk[˙]) 
and [ ]0 = d 
I r() is already a harmonic oscillator (+bias ). 
I But equation of motion r00 = f (r; r0) is numerically 
dangerous. 
2. Write the equation of motion in conserved quantities. 
ex. r00 = f (E;e; r) in Sparing–Burdeet–Heggie 
regularization. 
I Perturbation to E and e are integrated independently. 
3. Coordinate transformation from r to u. Finally, it becomes 
a harmonic oscillator, u00 = 12 
hu. 
I h is an energy integral and available as h(u;u0), but should 
be integrated independently.
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Levi-Civita transformation in a complex plane 
1.5 
1 
0.5 
0 
-0.5 
-1 
-1.5 
harmonic 
Kepler 
F1 
F2 
-1.5 -1 -0.5 0 0.5 1 1.5 
Ellipse of harmonic oscillator: 
u = A cos  + iB sin  (1) 
Ellipse of Kepler motion: 
r =u2 
= 
A2  B2 
2 + 
A2 + B2 
2 
cos 2 + i2AB sin 2 
=a(e + cos ) + ia 
p 
1  e2 sin  
with 
 = 2; a = 
A2 + B2 
2 
; e = 
A2  B2 
A2 + B2 
(2)
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Hamilton’s quaternion 
I The complex numbers algebra can be applied to the 
two-dimensional geometry 
I We can add, subtract, multiply, and divide 2D vectors 
I What about on 3D vectors? 
I According to a letter Hamilton wrote later to his son 
Archibald: 
Every morning in the early part of October 1843, on my coming 
down to breakfast, your brother William Edward and yourself 
used to ask me: Well, Papa, can you multiply triples? Whereto 
I was always obliged to reply, with a sad shake of the head, No, 
I can only add and subtract them. 
I Finally, he discovered that quadruple numbers can be applied to 
the arithmetics of 3D vectors
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
cont. 
Introduce a new imaginary unit j that anti-commutes with i, 
e.g. ij = ji, and let k = ij. Then, 
i2 = j2 = k2 = ijk = 1 
or 
ij = ji = k; jk = kj = i; ki = ik = j 
defines the (non-commutative) quaternion algebra. 
A quaternion is 
H 3 q = s + ix + jy + kz (s;x;y; z 2 R) 
s is referred to as scalar and ix + jy + kz vector.
Broom Bridge
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Usage of quaternion 
A unit quaternion rotates a vector. 
rrot = r ¯; (3) 
with a unit quaternion  and a vector r = ix + jy + kz. 
Example: 
ek=2(ix + jy + kz)ek=2 =ek (ix + jy) + kz 
=ek (x + ky)i + kz (4) 
 
iek=2 = ek=2i; jek=2 = ek=2j; kek=2 = ek=2k 
 
 = ek=2 
 
= cos  
2 + k sin  
2 
 
rotated a vector about the z-axis 
by an angle .
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Let’s rotate the orbit 
Let Kepler orbit on the xy-plane 
x + iy = u2; (5) 
with LC coordinate u = u0 + iu1. By multiplying j from right, 
we move the orbit on the yz-plane, 
(x + iy)j = jx + ky = u2j = uj¯u: (6) 
With arbitrary rotational quaternions  and
, 
(jx + ky)¯ = (uju¯ )¯ = (u
¯)(
j
¯)(
u¯¯ ) (7) 
Now we can write 
r = q ¯q; (8) 
with a three-dimensional orbit r, a quaternion q = u
¯, and 
a unit vector  =
j
¯ (is either i, j, or k).
A block-step version 
of KS regularization 
Keigo Nitadori 
KS regularization 
Hermite integrator 
KS block-step 
Summary 
Comparison of LC and KS 
LC KS 
12 
12 
algebra complex, C quaternion, 12 
12H 
phys. coord. r = x + iy r = ix + jy + kz 
reg. coord. u = u0 + iu1 u = u0 + iu1 + ju2 + ku3 
transformation r = u2 r = u u 
¯eq. of motion u00 = hu + juj2fu u00 = hu  kuk2fu 
I f is a perturbation vector 
I Original 2  2 real matrix formulation is possible for LC 
I Original 4  4 real matrix or 2  2 complex matrix (Pauli 
matrices) formulation is possible for KS

More Related Content

PDF
Hermite integrators and Riordan arrays
PDF
Convergence methods for approximated reciprocal and reciprocal-square-root
PDF
Solving the energy problem of helium final report
PDF
Solovay Kitaev theorem
PDF
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
PDF
Trilinear embedding for divergence-form operators
PDF
Using blurred images to assess damage in bridge structures?
PDF
Quantitative norm convergence of some ergodic averages
Hermite integrators and Riordan arrays
Convergence methods for approximated reciprocal and reciprocal-square-root
Solving the energy problem of helium final report
Solovay Kitaev theorem
Fast and efficient exact synthesis of single qubit unitaries generated by cli...
Trilinear embedding for divergence-form operators
Using blurred images to assess damage in bridge structures?
Quantitative norm convergence of some ergodic averages

What's hot (20)

PDF
On maximal and variational Fourier restriction
PPTX
Minimum spanning tree algorithms by ibrahim_alfayoumi
PPTX
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
PDF
Minimum spanning tree
PDF
A Note on the Derivation of the Variational Inference Updates for DILN
PDF
MLP輪読スパース8章 トレースノルム正則化
PDF
Norm-variation of bilinear averages
PDF
Phase diagram at finite T & Mu in strong coupling limit of lattice QCD
PDF
dhirota_hone_corrected
PDF
Monopole zurich
PDF
Johnson's algorithm
PPT
Gamma function
PPT
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
PPT
Matrices ii
PPTX
Prims & kruskal algorithms
PDF
Response Surface in Tensor Train format for Uncertainty Quantification
PPTX
Fdtd ppt for mine
PDF
(Neamen)solution manual for semiconductor physics and devices 3ed
PDF
Bellman ford
PPTX
Prims and kruskal algorithms
On maximal and variational Fourier restriction
Minimum spanning tree algorithms by ibrahim_alfayoumi
Toward an Improved Computational Strategy for Vibration-Proof Structures Equi...
Minimum spanning tree
A Note on the Derivation of the Variational Inference Updates for DILN
MLP輪読スパース8章 トレースノルム正則化
Norm-variation of bilinear averages
Phase diagram at finite T & Mu in strong coupling limit of lattice QCD
dhirota_hone_corrected
Monopole zurich
Johnson's algorithm
Gamma function
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Matrices ii
Prims & kruskal algorithms
Response Surface in Tensor Train format for Uncertainty Quantification
Fdtd ppt for mine
(Neamen)solution manual for semiconductor physics and devices 3ed
Bellman ford
Prims and kruskal algorithms
Ad

Similar to A block-step version of KS regularization (13)

PDF
Mit2 092 f09_lec21
PDF
20110326202335912
PDF
Mit2 092 f09_lec23
PDF
Digital signal processing (2nd ed) (mitra) solution manual
PDF
A Low Memory Solver For Integral Equations Of Chandrasekhar Type In The Radia...
PDF
Talk at SciCADE2013 about "Accelerated Multiple Precision ODE solver base on ...
PDF
Mathematical_Methods_for_Physicists_CHOW.pdf
PPT
Calculus of variations
PDF
The role of kalman filter in improving the accuracy of gps kinematic technique
PPTX
Ensemble Data Assimilation on a Non-Conservative Adaptive Mesh
PDF
Optimizing the parameters of wavelets for pattern matching using ga
PDF
Optimizing the parameters of wavelets for pattern matching using ga no restri...
PDF
QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...
Mit2 092 f09_lec21
20110326202335912
Mit2 092 f09_lec23
Digital signal processing (2nd ed) (mitra) solution manual
A Low Memory Solver For Integral Equations Of Chandrasekhar Type In The Radia...
Talk at SciCADE2013 about "Accelerated Multiple Precision ODE solver base on ...
Mathematical_Methods_for_Physicists_CHOW.pdf
Calculus of variations
The role of kalman filter in improving the accuracy of gps kinematic technique
Ensemble Data Assimilation on a Non-Conservative Adaptive Mesh
Optimizing the parameters of wavelets for pattern matching using ga
Optimizing the parameters of wavelets for pattern matching using ga no restri...
QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...
Ad

More from Keigo Nitadori (6)

PDF
Hermite integrators and 2-parameter subgroup of Riordan group
PDF
上三角 Pascal 行列による多項式のシフト
PDF
Higher order derivatives for N -body simulations
PDF
FMMの実装と導出
PDF
Snake eats leapfrog (in Japanese)
PDF
Rh typing
Hermite integrators and 2-parameter subgroup of Riordan group
上三角 Pascal 行列による多項式のシフト
Higher order derivatives for N -body simulations
FMMの実装と導出
Snake eats leapfrog (in Japanese)
Rh typing

Recently uploaded (20)

PPTX
Biomechanics of the Hip - Basic Science.pptx
PPTX
BODY FLUIDS AND CIRCULATION class 11 .pptx
PPTX
Introduction to Cardiovascular system_structure and functions-1
PDF
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
PPT
Heredity-grade-9 Heredity-grade-9. Heredity-grade-9.
PPTX
Application of enzymes in medicine (2).pptx
PPTX
The Minerals for Earth and Life Science SHS.pptx
PDF
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
PPT
6.1 High Risk New Born. Padetric health ppt
PDF
Sciences of Europe No 170 (2025)
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PDF
. Radiology Case Scenariosssssssssssssss
PPTX
Science Quipper for lesson in grade 8 Matatag Curriculum
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
PDF
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
PPTX
Hypertension_Training_materials_English_2024[1] (1).pptx
PDF
Placing the Near-Earth Object Impact Probability in Context
PPTX
Seminar Hypertension and Kidney diseases.pptx
PDF
The Land of Punt — A research by Dhani Irwanto
PPTX
CORDINATION COMPOUND AND ITS APPLICATIONS
Biomechanics of the Hip - Basic Science.pptx
BODY FLUIDS AND CIRCULATION class 11 .pptx
Introduction to Cardiovascular system_structure and functions-1
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
Heredity-grade-9 Heredity-grade-9. Heredity-grade-9.
Application of enzymes in medicine (2).pptx
The Minerals for Earth and Life Science SHS.pptx
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
6.1 High Risk New Born. Padetric health ppt
Sciences of Europe No 170 (2025)
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
. Radiology Case Scenariosssssssssssssss
Science Quipper for lesson in grade 8 Matatag Curriculum
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
Hypertension_Training_materials_English_2024[1] (1).pptx
Placing the Near-Earth Object Impact Probability in Context
Seminar Hypertension and Kidney diseases.pptx
The Land of Punt — A research by Dhani Irwanto
CORDINATION COMPOUND AND ITS APPLICATIONS

A block-step version of KS regularization

  • 1. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary A block-step version of KS regularization at Steller N-body Dynamics, Sexten Keigo Nitadori Co-Design Team, Exascale Computing Project RIKEN Advanced Institute for Computational Sciencd September 10, 2014
  • 2. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Acknowledgement My sincerest thanks go to Sverre Aarseth and IoA for inviting me 7 times, 07, 08, 09, 10, 11, 12, and 13, in which the most important and creative collaboration on the development of NBODY6/GPU was done.
  • 3. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Abstract I talk about a new future implemented in NBODY6/GPU: A block-step version of KS regularized binary. I To eliminate serial bottleneck I Very accurate with fully conservational Hermite integrator Amazingly, it is already working! Public code is available as nbody6b and nbody7b
  • 4. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Topics 1. Brief introduction of Kustaanheimo–Stiefel (KS) regularization (with Hamilton’s quaternion numbers) 2. A very accurate variant of Hermite integrator for harmonic oscillators (and regularized binaries) 3. Block stepping in real time t
  • 5. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary 3 steps of regularization 1. Time transformation. dt = krkd, (hereafter, [˙] = d dt [ ], d [ ] = krk[˙]) and [ ]0 = d I r() is already a harmonic oscillator (+bias ). I But equation of motion r00 = f (r; r0) is numerically dangerous. 2. Write the equation of motion in conserved quantities. ex. r00 = f (E;e; r) in Sparing–Burdeet–Heggie regularization. I Perturbation to E and e are integrated independently. 3. Coordinate transformation from r to u. Finally, it becomes a harmonic oscillator, u00 = 12 hu. I h is an energy integral and available as h(u;u0), but should be integrated independently.
  • 6. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Levi-Civita transformation in a complex plane 1.5 1 0.5 0 -0.5 -1 -1.5 harmonic Kepler F1 F2 -1.5 -1 -0.5 0 0.5 1 1.5 Ellipse of harmonic oscillator: u = A cos + iB sin (1) Ellipse of Kepler motion: r =u2 = A2 B2 2 + A2 + B2 2 cos 2 + i2AB sin 2 =a(e + cos ) + ia p 1 e2 sin with = 2; a = A2 + B2 2 ; e = A2 B2 A2 + B2 (2)
  • 7. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Hamilton’s quaternion I The complex numbers algebra can be applied to the two-dimensional geometry I We can add, subtract, multiply, and divide 2D vectors I What about on 3D vectors? I According to a letter Hamilton wrote later to his son Archibald: Every morning in the early part of October 1843, on my coming down to breakfast, your brother William Edward and yourself used to ask me: Well, Papa, can you multiply triples? Whereto I was always obliged to reply, with a sad shake of the head, No, I can only add and subtract them. I Finally, he discovered that quadruple numbers can be applied to the arithmetics of 3D vectors
  • 8. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary cont. Introduce a new imaginary unit j that anti-commutes with i, e.g. ij = ji, and let k = ij. Then, i2 = j2 = k2 = ijk = 1 or ij = ji = k; jk = kj = i; ki = ik = j defines the (non-commutative) quaternion algebra. A quaternion is H 3 q = s + ix + jy + kz (s;x;y; z 2 R) s is referred to as scalar and ix + jy + kz vector.
  • 10. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Usage of quaternion A unit quaternion rotates a vector. rrot = r ¯; (3) with a unit quaternion and a vector r = ix + jy + kz. Example: ek=2(ix + jy + kz)ek=2 =ek (ix + jy) + kz =ek (x + ky)i + kz (4) iek=2 = ek=2i; jek=2 = ek=2j; kek=2 = ek=2k = ek=2 = cos 2 + k sin 2 rotated a vector about the z-axis by an angle .
  • 11. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Let’s rotate the orbit Let Kepler orbit on the xy-plane x + iy = u2; (5) with LC coordinate u = u0 + iu1. By multiplying j from right, we move the orbit on the yz-plane, (x + iy)j = jx + ky = u2j = uj¯u: (6) With arbitrary rotational quaternions and
  • 12. , (jx + ky)¯ = (uju¯ )¯ = (u
  • 13. ¯)(
  • 14. j
  • 15. ¯)(
  • 16. u¯¯ ) (7) Now we can write r = q ¯q; (8) with a three-dimensional orbit r, a quaternion q = u
  • 17. ¯, and a unit vector =
  • 18. j
  • 19. ¯ (is either i, j, or k).
  • 20. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Comparison of LC and KS LC KS 12 12 algebra complex, C quaternion, 12 12H phys. coord. r = x + iy r = ix + jy + kz reg. coord. u = u0 + iu1 u = u0 + iu1 + ju2 + ku3 transformation r = u2 r = u u ¯eq. of motion u00 = hu + juj2fu u00 = hu kuk2fu I f is a perturbation vector I Original 2 2 real matrix formulation is possible for LC I Original 4 4 real matrix or 2 2 complex matrix (Pauli matrices) formulation is possible for KS
  • 21. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary A very accurate Hermite integrator (Accidentally) it turn out that the following symmetric corrector form ucorr =uold + 2 (u0 corr + u0 old) 2 12 (u00 new u00 old); u0 corr =u0 old + 2 (u00 new + u00 old) 2 12 (u000 new u000 old); (9) after P(EC)n convergence 5 of 6 orbital elements (except for the phase) conserve in machine accuracy. If you use another form for the position ucorr =uold + 2 (u0 corr + u0 old) 2 10 (u00 new u00 old) + 3 120 (u000 new + u000 old); (10) this property is lost.
  • 22. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Why it works Consider a harmonic oscillator ¨x = !x, and let vi = ˙xi and fi = ¨xi. An analytical solution for one step t writes, !x1 v1 ! = cos!t sin!t sin!t cos!t ! !x0 v0 ! : (11) It is equivalent to v1 v0 x1 x0 ! = tan(!t=2) !t=2 ! t 2 f1 + f0 v1 + v0 ! : (12) A second order integrator approximates this as v1 v0 x1 x0 ! = t 2 f1 + f0 v1 + v0 ! : (13) The dierence is only a small factor on the stepsize t.
  • 23. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Fourth- and sixth-order version The 4th-order Hermite integrator is equivalent to v1 v0 x1 x0 ! = *.. , 1 1 13 !t 2 2 +// - t 2 f1 + f0 v1 + v0 ! ; (14) and a 6th-order one v1 v0 x1 x0 ! = *.. , 1 1 15 !t 2 2 1 25 !t 2 2 +// - t 2 f1 + f0 v1 + v0 ! : (15) The factor to t is approaching to tan(!t=2) !t=2 ! , of exact solution. Phase error shared among 4 waves of KS ) 5 of 6 orbital elements conserve
  • 24. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Phase correction If one likes to conserve also the phase, emphasize the step-size t. x1 =x0 + c2t 2 (v1 + v0); x1 =x0 + c4t 2 (v1 + v0) t2 12 (f1 f0); x1 =x0 + c6t 2 (v1 + v0) t2 10 (f1 f0) + c6t3 120 (˙f1 + ˙f0); (16) (so on the velocity), with c2 = tan ; c4 = tan 1 1 3 2 ! ; c6 = tan 1 25 2 1 1 15 2 ; (17) and = !t=2. Now the results agree with the analitic trigonometric functions in machine accuracy.
  • 25. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Block stepping I Usually, fixed , 30 step/orbit is enough for weakly perturbed binary. I Then, real step t = Z + dt d d = Z + krkd, becomes a varying real (non-quantized) number. I This prevents parallelization, we hope t restricted to 2n (n 2 Z) (McMillan, 1986; Makino 1992).
  • 26. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Truncation procedure From given natural step nat, we compute a truncated step bs ( nat) for which the corresponding step tbs = 2n obeys the block-step criterion. nat ! integrate tnat ! truncate tbs ! solve bs (18) We integrate tnat = X6 n=1 thni (nat)n n! ; thni = dn dn t ! : (19) After truncation tnat ! tbs, we solve bs from tbs + X6 n=1 thni (bs)n n! = 0; (20) by using of Newton–Raphson iterations (unique solution exists).
  • 27. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Derivatives of physical time t I After a 4th-order Hermite integration, up to 3rd derivative of force (5th derivative of coordinate) is available I Up to 6th derivative of time is available t0 =u u; t00 =2(u u0); t000 =2(u u00 + u0 u0); th4i =2(u u000) + 6(u0 u00); th5i =2(u uh4i) + 8(u0 u000) + 6(u00 u00); th6i =2(u uh5i) + 10(u0 uh4i) + 20(u00 u000): (21) I tnext is explicitly available at the end of this step I Predictor only, no corrector is applied for t
  • 28. A block-step version of KS regularization Keigo Nitadori KS regularization Hermite integrator KS block-step Summary Summary I The block-step version of KS is working in Sverre’s code I Some Hermite integrators turned out to integrate harmonic oscillators very accurately with P(EC)n iterations I Regularization is not acrobatics, nor a black magic (at least for two-body).