Skip to content

ethanlake/squeezing-codes

Repository files navigation

squeezing-codes

code relating to the analysis of squeezing codes [1].

usage

setting things up:

run Pkg.activate(".") and Pkg.Instantiate() in the project folder.

simulation_driver.jl: Run a single simulation with custom parameters.

examples:

julia --project=. simulation_driver.jl --mode=dw_growth --Lprl=100 --rule=R --p=0.05
julia --project=. simulation_driver.jl --mode=dw_history --Lprl=50 --T_evolve=200
julia --project=. simulation_driver.jl --mode=dw_roughness --Lprl=20 --n_trials=10

Main Parameters:

  • mode: Simulation mode
    • "dw_growth" computes growth of interface roughness in time
    • "dw_roughness" computes late-time height fluctuations of interface
    • "dw_history" visualizes the growth of an interface
    • "history" visualizes the normal 2d dynamics
  • rule: Rule name - "R", "F", or "M" (default: "R")
  • Lprl: System size parallel to domain wall
  • Lperp: System size perpendicular to domain wall
  • p: Noise strength (default: 0.0)
  • rotate: If true, rotate the system by 90 degrees (default: false)
  • r: If true, reverse spins in initial configuration (default: false)
  • save: If true, save data to file in data/ folder with pre-defined name (default: true for dw_growth and dw_roughness, false else)

Other Parameters:

  • T_evolve: Number of time steps to evolve
  • n_trials: Number of trials to average over (for dw_growth and dw_roughness modes)
  • border: Border thickness for active region padding (default: 4)
  • use_max_height: If true, defines height field using maximum height of flipped spin rather than sum (default: false)
  • final_state: If true, saves only the final state as an image
  • pretty: If true, makes animations with minimal visual clutter
  • out_adj: Optional string to append to filename before .jld2 extension
  • reset_center: If true, resets domain wall center when it drifts too far (default: true)

All parameters can be set via command-line arguments using --param=value syntax. Defaults are defined in the script; to run the script in the REPL, modify these values and run include("simulation_driver.jl).

run_batch.jl: Run parameter sweeps, either sequentially or as SLURM job arrays.

# Run all jobs sequentially (for testing)
julia --project=. run_batch.jl

# Submit as SLURM job array (see run_batch_slurm.sh)
sbatch run_batch_slurm.sh

Edit the parameter vectors in run_batch.jl to define the parameter sweep.

plotter.py: Plot simulation results from JLD2 files.

# Plot automatically from data/ directory
python3 plotter.py

# Plot specific files
python3 plotter.py data/R_dw_growth_Lprl50.jld2

# options: 
-instexp  # Plot instantaneous exponent
-allhists # Plot individual trial histories

testing that things work:

visualization:

  1. julia --project=. simulation_driver.jl --mode=dw_history --Lprl=150 --Lperp=100 --T_evolve=300 --rule=R --p=.1
  2. julia --project=. simulation_driver.jl --mode=dw_history --Lprl=150 --Lperp=100 --T_evolve=300 --rule=M --rotate=true
  3. julia --project=. simulation_driver.jl --mode=dw_history --Lprl=150 --Lperp=100 --T_evolve=300 --rule=F --rotate=true --r=true
  4. julia --project=. simulation_driver.jl --mode=history --Lprl=150 --Lperp=150 --rule=M --r=true

domain growth:

  1. julia --project=. simulation_driver.jl --mode=dw_growth --Lprl=75 --rule=R --n_trials=25
  2. python3 plotter.py data/R_dw_growth_Lprl75_n_trials25.jld2

domain roughness:

  1. julia --project=. simulation_driver.jl --mode=dw_roughness --Lprl=20 --rule=F --n_trials=25
  2. python3 plotter.py data/F_dw_roughness_Lprl20_n_trials25.jld2 (just plots a single data point; designed to be run with multiple files at different system sizes)

references

  1. The original paper on squeezing codes

About

code for analyzing squeezing codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published