Topological Material Analysis 0.5
Analyse the structures of materials using tools from TDA
Loading...
Searching...
No Matches
diffusion_utils Namespace Reference

Functions

 row_reduce_matrix (A, GF)
 solve_linear_system_with_boundary (B, v, A, A_red, V, GF)
 solve_linear_system (B, v)
 cut_path_from_bottom (path, h, grid, axis=-1)
 cut_path_from_top (path, h, grid, axis=-1)
 get_cmap (n, name='hsv')
 get_box_from_cell (cell_file)
 out_to_atoms (inputfile, backbone_atoms, flow_atoms)
 DEPRECATED?
 clean_Li (Li, m, M)
 make_geodesics (grid, r, M, m, axes, dim, D_=None, D_force_graph_=None, verbose=False)
 find_geod (idx0, idx1, geodesics, pts, D, maxiter=np.inf)
 dist_periodic_boundaries (grid_, M, m, axes, dim=3)
 dist_from_pts_periodic_boundaries (pts_, grid_, M, m, axes, dim=3)
 append_tr (ITRIS, B, edge_idxs, ia, ib, ic)
 check_tr (p0, p1, p2, res_grid, grid, cubic_to_res, ITRIS, B, edge_idxs)
 r_squared (px, py, pz, balls_centres, balls_radii)
 aux_fn (px, py, pz, xc, yc, zc, r, eps, p=4)
 grad_r2 (pt, balls_centres, balls_radii, p=2, eps=1)
 sample_path (idx, N, res_grid, z_1, maxiter=100000)
 smooth_path (path, geod, res_grid, D)
 close_paths (p_0, p_1, grid, geod, D)
 homological_simplification_of_path_pts (idx0, idx1, path, grid, geod, V, rank, GF, D, N, edge_idxs, r_graph)
 homological_simplification_of_path (path, grid, geod, V, rank, GF, D, N, edge_idxs, r_graph)
 close_paths_A_0_A_1 (p_0, p_1, D, A_0, A_1, res_to_A_0, res_to_A_1, A_0_to_res, A_1_to_res, geod_A_0, geod_A_1)
 join_points_boundary_conditions (p_, q_, M, m, axes, dim, n=20)
 close_paths_boundary_conditions (p_0, p_1, res_grid, geod, M, m, D, axes, dim)
 close_deadlocks (p_0, p_1, res_grid, geod, res_to_A_0, A_0_to_res, geod_A_0, A_0)
 simplify_path (path_)
 path_to_vec (path, D, N_1, edge_idxs, r_graph, verbose=False)
 equivalence (A, v_path, rank)
 project_path (path_coords, grid)
 project_path_periodic (path_coords, grid, M, m, axes, dim=3, D_=None)
 project_timeseries_array (A, grid, M, m, axes, dim=3)
 cluster_deadlocks (PATHS, res_grid, geod, res_to_A_0, geod_A_0, A_0)
 save_paths (LIST, name, folder_path)
 compute_all (LIST)
 compute_penalties (LIST)
 compute_direction (LIST)
 compute_repulsion (LIST)
 find_geod_wrap (LIST)
 rank_mod_p (LIST)

Function Documentation

◆ append_tr()

diffusion_utils.append_tr ( ITRIS,
B,
edge_idxs,
ia,
ib,
ic )
N.B. ia<ib<ic

◆ aux_fn()

diffusion_utils.aux_fn ( px,
py,
pz,
xc,
yc,
zc,
r,
eps,
p = 4 )

◆ check_tr()

diffusion_utils.check_tr ( p0,
p1,
p2,
res_grid,
grid,
cubic_to_res,
ITRIS,
B,
edge_idxs )

◆ clean_Li()

diffusion_utils.clean_Li ( Li,
m,
M )
Remove Lithium Atoms Outside the Box

◆ close_deadlocks()

diffusion_utils.close_deadlocks ( p_0,
p_1,
res_grid,
geod,
res_to_A_0,
A_0_to_res,
geod_A_0,
A_0 )

◆ close_paths()

diffusion_utils.close_paths ( p_0,
p_1,
grid,
geod,
D )

◆ close_paths_A_0_A_1()

diffusion_utils.close_paths_A_0_A_1 ( p_0,
p_1,
D,
A_0,
A_1,
res_to_A_0,
res_to_A_1,
A_0_to_res,
A_1_to_res,
geod_A_0,
geod_A_1 )

◆ close_paths_boundary_conditions()

diffusion_utils.close_paths_boundary_conditions ( p_0,
p_1,
res_grid,
geod,
M,
m,
D,
axes,
dim )

◆ cluster_deadlocks()

diffusion_utils.cluster_deadlocks ( PATHS,
res_grid,
geod,
res_to_A_0,
geod_A_0,
A_0 )

◆ compute_all()

diffusion_utils.compute_all ( LIST)

◆ compute_direction()

diffusion_utils.compute_direction ( LIST)

◆ compute_penalties()

diffusion_utils.compute_penalties ( LIST)

◆ compute_repulsion()

diffusion_utils.compute_repulsion ( LIST)

◆ cut_path_from_bottom()

diffusion_utils.cut_path_from_bottom ( path,
h,
grid,
axis = -1 )

◆ cut_path_from_top()

diffusion_utils.cut_path_from_top ( path,
h,
grid,
axis = -1 )

◆ dist_from_pts_periodic_boundaries()

diffusion_utils.dist_from_pts_periodic_boundaries ( pts_,
grid_,
M,
m,
axes,
dim = 3 )
pts -> punti da proiettare
grid -> array of pts (npts,dim)
M -> array with upper bounds of the box (dim,)
m -> array with lower bound of the box (dim,)
axes -> array with the axes in which the boundary condition is applied
dim -> dimension of the dataset

◆ dist_periodic_boundaries()

diffusion_utils.dist_periodic_boundaries ( grid_,
M,
m,
axes,
dim = 3 )
Makes a 

grid -> array of pts (npts,dim)
M -> array with upper bounds of the box (dim,)
m -> array with lower bound of the box (dim,)
axes -> array with the axes in which the boundary condition is applied
dim -> dimension of the dataset

◆ equivalence()

diffusion_utils.equivalence ( A,
v_path,
rank )
Broken!

◆ find_geod()

diffusion_utils.find_geod ( idx0,
idx1,
geodesics,
pts,
D,
maxiter = np.inf )

◆ find_geod_wrap()

diffusion_utils.find_geod_wrap ( LIST)

◆ get_box_from_cell()

diffusion_utils.get_box_from_cell ( cell_file)

◆ get_cmap()

diffusion_utils.get_cmap ( n,
name = 'hsv' )
Returns a function that maps each index in 0, 1, ..., n-1 to a distinct 
RGB color; the keyword argument name must be a standard mpl colormap name.

◆ grad_r2()

diffusion_utils.grad_r2 ( pt,
balls_centres,
balls_radii,
p = 2,
eps = 1 )

◆ homological_simplification_of_path()

diffusion_utils.homological_simplification_of_path ( path,
grid,
geod,
V,
rank,
GF,
D,
N,
edge_idxs,
r_graph )

◆ homological_simplification_of_path_pts()

diffusion_utils.homological_simplification_of_path_pts ( idx0,
idx1,
path,
grid,
geod,
V,
rank,
GF,
D,
N,
edge_idxs,
r_graph )
idx0,idx1 (p0,p1) -> are indexes to sample from the path
q0,q1 -> are the indexes sampled from the paths and refer to pts in the grid

◆ join_points_boundary_conditions()

diffusion_utils.join_points_boundary_conditions ( p_,
q_,
M,
m,
axes,
dim,
n = 20 )

◆ make_geodesics()

diffusion_utils.make_geodesics ( grid,
r,
M,
m,
axes,
dim,
D_ = None,
D_force_graph_ = None,
verbose = False )

◆ out_to_atoms()

diffusion_utils.out_to_atoms ( inputfile,
backbone_atoms,
flow_atoms )

DEPRECATED?

def read_data(path, backbone_atoms, flow_atoms): """ Read an xyz file and extract the molecule's geometry.

Read the .xyz file and returns atoms coordinates by type, cardinalities and box boundaries

◆ path_to_vec()

diffusion_utils.path_to_vec ( path,
D,
N_1,
edge_idxs,
r_graph,
verbose = False )

◆ project_path()

diffusion_utils.project_path ( path_coords,
grid )

◆ project_path_periodic()

diffusion_utils.project_path_periodic ( path_coords,
grid,
M,
m,
axes,
dim = 3,
D_ = None )
path_coords -> coordinates of the points of the path
grid -> array of pts to project the path on (npts,dim)
M -> array with upper bounds of the box (dim,)
m -> array with lower bound of the box (dim,)
axes -> array with the axes in which the boundary condition is applied
dim -> dimension of the dataset
D_ -> distance matrix if already computed

◆ project_timeseries_array()

diffusion_utils.project_timeseries_array ( A,
grid,
M,
m,
axes,
dim = 3 )

◆ r_squared()

diffusion_utils.r_squared ( px,
py,
pz,
balls_centres,
balls_radii )

◆ rank_mod_p()

diffusion_utils.rank_mod_p ( LIST)

◆ row_reduce_matrix()

diffusion_utils.row_reduce_matrix ( A,
GF )

◆ sample_path()

diffusion_utils.sample_path ( idx,
N,
res_grid,
z_1,
maxiter = 100000 )

◆ save_paths()

diffusion_utils.save_paths ( LIST,
name,
folder_path )

◆ simplify_path()

diffusion_utils.simplify_path ( path_)

◆ smooth_path()

diffusion_utils.smooth_path ( path,
geod,
res_grid,
D )

◆ solve_linear_system()

diffusion_utils.solve_linear_system ( B,
v )
Finds a solution - if it exists - of B*x = v

B is row-reduced form

◆ solve_linear_system_with_boundary()

diffusion_utils.solve_linear_system_with_boundary ( B,
v,
A,
A_red,
V,
GF )
Finds a solution - if it exists - of B*x = v + A*mu

B is row-reduced form
A generates the boundary subspace
A_red is A[rank(B):,:] in row reduced form via the matrix V
tmp tells if the solution is exact