Skip to content

emmerichmtm/phaseTransitionExpKernelsUnitLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Gradient-flow data generation for the kernel family exp(-|x-y|^q)

This package contains Python code to generate the point-flow data used for the portrait plot matrices.

What it computes

For ordered points on the unit interval, it studies the energy

E(x_1,...,x_k) = sum_{i<j} exp(-|x_j-x_i|^q).

The script computes a projected gradient-descent flow:

  • starting from a uniform configuration shifted slightly into the interior
  • taking small steps in the negative gradient direction
  • clipping and sorting points back into the unit interval
  • using simple backtracking if a step increases the energy

Included panel set

The helper generate_all_panels() builds the 2-column × 4-row portrait collection:

  • k=9, q=0.1
  • k=9, q=1
  • k=9, q=q_odd
  • k=9, q=2
  • k=10, q=0.1
  • k=10, q=1
  • k=10, q=q_10
  • k=10, q=2

where:

  • q_odd = log(1/(-log((1+e^-1)/2))) / log(2)
  • q_10 = 1.238523533

Requirements

Install NumPy:

pip install numpy

Usage

Run the script directly:

python gradient_flow_data_generation.py

It will:

  • generate all panels
  • print a small summary for the k=9, q=q_odd case
  • write one CSV-like file called k9_qcrit_flow_data.csv

Main functions

  • energy(x, q)
    Computes the discrete energy.

  • gradient(x, q)
    Computes the gradient with respect to the point positions.

  • gradient_flow(k, q, n_steps=400, dt=0.0025, margin=0.03)
    Generates one flow path.

  • generate_all_panels()
    Generates the full 2×4 portrait data set.

  • to_csv_like_table(flow)
    Exports one flow as plain CSV-like text.

  • tikz_coordinates(flow, y_scale=1.0)
    Converts a flow into point trajectories suitable for TikZ.

  • print_tikz_trajectory_block(flow, y_scale=1.0)
    Prints TikZ coordinate blocks for trajectory plotting.

Notes

  • Endpoints are not fixed in this version.
  • The initial condition is an equally spaced configuration inside [margin, 1-margin].
  • Very small gaps are snapped to exact collisions for cleaner downstream plotting.

Files

  • gradient_flow_data_generation.py
  • README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages