49
Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications Jingfang Huang Department of Mathematics UNC at Chapel Hill

Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications

Jingfang Huang

Department of Mathematics

UNC at Chapel Hill

Page 2: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Fundamentals of Fast Multipole (type) Method

Fundamentals: • Low rank? Low dimensional? Simple rules? …

• Process the “low rank/ low dimensional” or

“simple” data on the tree structure? • Recursive Implementations and parallelization

Page 3: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Example: (real parallel code) RECFMM

Joint work with Bo Zhang,

Xiaobai Sun, and Nikos Pitsianis

Open

source

code

available.

Cilk Plus

runtime

used.

Page 4: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Parallelizing Recursive Algorithms: Cilk Plus Runtime Scheduler

Existing results on parallelizing hierarchy tree structure based algorithms. E.g., Cilk plus runtime scheduler. (Joint work with B. Zhang, X. Sun, N. Pitsianis.) https://www.cilkplus.org/

Page 5: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Computational Software section in CiCP

1. Computational Software: Simple FMM Libraries for Electrostatics, Slow

Viscous Flow, and Frequency-Domain Wave Propagation, by Zydrunas Gimbutas and Leslie Greengard

2. Computational Software: PVFMM: A Parallel Kernel Independent FMM for

Particle and Volume Potentials, by

Dhairya Malhotra and George Biros Associate Editors: Prof. Benzhuo Lu (Chinese Academy of Sciences) and J. Huang.

Page 6: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

L2 Low rank: Mathematical Analysis vs Numerical Approach

Page 7: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Matrix Analysis: PCA or SVD

Page 8: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

A simple Matlab code

• clear all; clc; • m=400;n=400;x=rand(n); y=rand(m)+2; • for i=1:m, • for j=1:n, • A(i,j)=1/(y(i)-x(j)); • end • end • [U,S,V]=svd(A);

• format long e; • pca=diag(S); • pca(1:15)

Page 9: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

And the results (numerical rank=9)

• 2.113086441965111e+02 • 5.114102631925020e+00 • 9.392747101949028e-02 • 1.790209461350161e-03 • 3.235709204090181e-05 • 6.168512015716861e-07 • 1.151573821662682e-08 • 1.982373081735641e-10 • 3.570020729013249e-12 • 1.596504915597923e-13 • 1.377179100162433e-13 • 1.206114412870406e-13

Page 10: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Taylor expansion:

Mathematical analysis: Low rank?

Page 11: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Note that

P=15 for single precision and p=30 for double precision.

Multipole coefficients: compressed data

Page 12: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Low Rank and Low Dimensional Representations

Separation of Variables: Low rank and low dimensional data

Page 13: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Question: Generalization?

Page 14: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Low Rank? Tree? Recursive Algorithm

Apply the fundamentals to model and algorithm design.

Today’s topic 1:

Recursive Tree Algorithms for Orthogonal Matrix

Generation and Matrix-Vector Multiplications in Rigid Body Dynamics Simulations

Page 15: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Background: Rigid body dynamics

Consider a molecular system modeled by rigid bodies, each rigid body consists of n “beads” Given the force on and location of each bead The resultant force (size 3) and torque (size 3)of the rigid body are given by

Page 16: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Matrix Language

Page 17: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Orthogonal Form

Page 18: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Problem Statement

Page 19: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Background: Brownian Dynamics with Hydrodynamic Interactions

The “bead model” 1. Molecular system is modeled by m rigid bodies, each with

given external forces and torques , j=1,…,m. 2. Each rigid body contains nj beads.

3. The bead-to-bead hydrodynamics interactions satisfy

where D is the Rotne-Prager-Yamakawa tensor (translation invariant Green’s function, particle method for the Stokes equation) Reference: JA McCammon and G Huber (UCSD)

Page 20: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Bead model in Brownian dynamics

For the given force field on each rigid body, the unknown rigid body velocity vectors satisfy: Or equivalently, Note: Need to solve this at each time marching step…

Page 21: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Numerical Difficulty

Numerical difficulty: calculation of Reminder: Question (1) (Alternative approaches: Schur complement)

Page 22: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Reformulation

Page 23: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Next Generation Brownian Dynamics Solver

We already have 1. Fast multipole method for evaluating 2. Fast direct solver based preconditioner for each rigid

body (Codes from Jianlin Xia, et. al. )

Building blocks needed: stable and efficient algorithms for evaluating A nice project for undergrad students (Fuhui Fang, UNC)

Page 24: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

So the problems:

Page 25: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Divide-and-conquer: Recursive Algorithms on the Tree Structure

Consider the divide-and-conquer strategy Observations: and

Page 26: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Divide-and-conquer: Recursive Algorithms on the Tree Structure

Page 27: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Algorithm Complexity and Storage

How to go from “Tree code” to FMM?

Page 28: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

An upward pass: Algorithm for computing Qv Info-set = multipole coefficients

Multiple->Multipole: Parent P and Children X and Y, then,

Page 29: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Translation Operator: Inertia Matrix

Parent’s inertia matrix and Children’s inertia matrices then,

Page 30: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Residue Vectors

We want to compute without explicit forming

Page 31: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

How to compute residue vector? Then,

Page 32: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Computing R from inertia matrix

R is readily available from the inertia matrix

Page 33: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Recursive Algorithm

Page 34: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Downward Pass: Algorithm for QT v

Local Expansions?

Page 35: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Recursive Algorithm

A downward pass

Page 36: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Pseudo-code

Page 37: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Numerical Results

Page 38: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Storage

Page 39: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Implicit Q v CPU time

Page 40: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Details: backward stable algorithm?

How to make sure || QT Q v – v || is small? In progress…

Page 41: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Summary of Topic 1:

Use the fundamentals

Low rank (comes from rigid body assumption) Tree structure Recursive implementation.

Efficient algorithms can be developed.

Page 42: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Topic 2:

Half-space impedance Green’s function for the Helmholtz equation

Page 43: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Layered media Green’s function

“On the efficient representation of the half-space impedance Green's function for the Helmholtz equation”, by Michael O'Neil, Leslie Greengard, Andras Pataki

Page 44: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

How to evaluate the convolution?

• Integral equation formulation

where is the Green’s function for the half-space with homogeneous impedance boundary conditions, and the resulting Fredholm 2nd kind integral equation become

Page 45: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Method of images

Using the free space Green’s function

Page 46: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Modified fast multipole method

Multipole-to-multipole: same as free space FMM, as if the images do NOT exist.

Multipole-to-local: modified translation which include all the image contributions.

Local-to-local: No change!

Error analysis: Low rank? Note that source images are always well-separated from the target box. M2L Translation operator: analytical formula is possible. Either precomputed, or by designing special functions.

Page 47: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Generalization to multiple layers?

Can we develop the corresponding approximation theory for general multi-layer Green’s function in the form of Sommerfeld integral representation? Answer: Yes! Approximation using special basis, current research.

Page 48: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Summary

(Maybe it is a good idea to) consider recursively (hierarchically) on the tree structure when designing models and algorithms Mathematical analysis may help us to find the special matrix structures.

Page 49: Low-rank Properties, Tree Structure, and Recursive ...€¦ · Low-rank Properties, Tree Structure, and Recursive Algorithms with Applications . Jingfang Huang . Department of Mathematics

Thanks!