Skip to content

ExtensityAI/demo-molecular-dynamics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryotron LAMMPS Demo — With Dramatic Laser Sweep Event

This demo is a self‑contained LAMMPS input that mimics a cryotron‑like device using classical molecular dynamics. It now includes a visually striking “laser” melt–quench sweep that draws a permanent track across the device to make patterns easy to see in a viewer like OVITO.

Important: This is an educational surrogate. There is no superconductivity physics in classical MD; instead we use temperature thresholds and group temperatures as proxies for “superconducting vs. normal”. Use this to explore geometry, heat pulses, and structural disorder patterns only.

What’s included

  • in.cryotron — Main input script with parametric geometry and the laser sweep event.
  • dump.cryotron — Atom trajectory dump (written during the run) for visualization.
  • cryotron_final.data — Final configuration written at the end.
  • cryotron.data — A prior data file (not required to run).
  • log.lammps — Run log (created on execution).
  • Optional: Nb.eam.fs — If you switch to an EAM potential for Nb.

Prerequisites

  • LAMMPS 7 Aug 2019 or newer recommended (tested with “LAMMPS (22 Jul 2025)”).
  • A viewer: OVITO (Basic or Pro) highly recommended. VMD or ParaView also work.
  • CPU-only is fine; run time is short (a few minutes on a laptop).

Quick start

# From this folder
lmp_serial -in in.cryotron
# or
lmp -in in.cryotron

Outputs:

  • Watch console thermo; on success you’ll get dump.cryotron and cryotron_final.data.
  • Load dump.cryotron in OVITO to see the moving hot spot and the quenched track.

Scene overview (for non‑experts)

  • We build two thin orthogonal strips of atoms on a bcc lattice (niobium‑like spacing):
    • A vertical “gate” strip.
    • A horizontal “control” strip that intersects it.
  • We cool the system to a low base temperature, then:
    • Briefly heat only the gate strip above a surrogate critical temperature (Tc) to mimic switching ON.
    • Cool it back down to mimic switching OFF.
  • Finally, we sweep a moving spherical hot spot (a “laser”) across the device:
    • Wherever the hot spot passes, atoms are heated strongly then quenched quickly.
    • This leaves a visible “scar” (disordered region) you can clearly see.

Colored atom types for easy visual distinction

We use four atom types purely for coloring (the physics is unchanged because all types share the same potential parameters by default):

  • Type 1: Background (“rest” of device)
  • Type 2: Gate strip
  • Type 3: Control strip
  • Type 4: Laser scar (assigned to atoms that were inside the moving hot spot during the sweep)

Tip: In OVITO, color by “Type” to immediately see the structural regions, then switch to a physical property map (e.g., centrosymmetry or potential energy) to highlight the melted/quenched pattern.

How the simulation progresses

  1. Initialization and relaxation
  • Energy minimization to remove bad overlaps.
  • Short NVE + Langevin pre‑equilibration, then timestep reset to 0.
  1. Cooldown (Stage 1)
  • All atoms NVT‑cooled from a higher starting temperature to the base temperature.
  1. Equilibration (Stage 2)
  • All atoms held at base temperature with NVT.
  1. Control pulse (Stage 3)
  • Only the gate strip is thermostatted hot (above Tc), the rest evolves microcanonically (NVE).
  1. Gate cool‑down (Stage 4)
  • Only the gate is cooled back to base temperature; the rest stays NVE.
  1. Dramatic event — moving laser sweep (Stage 5)
  • A dynamic spherical region moves across X with center (lx, ly, lz) and radius laser_R.
  • Atoms inside the region are heated strongly to T_blast, then the region is quenched to T_low.
  • During the hot sweep the atoms currently in the region are “painted” as Type 4 at a regular interval, leaving a colored track you can’t miss in the viewer.

Key parameters (edit in in.cryotron)

Geometry and timing

  • box_x, box_y, box_z: Simulation box size (Å)
  • gate_width, ctrl_width: Strip widths (Å)
  • dt: Timestep (ps). Default 0.0005 ps.
  • T_low, T_high, Tc: Base, pulse, and surrogate critical temperatures (K)
  • Thermostat damping: Tdamp = dt * 100 (general), and faster hot/quench dampings for the laser stage.

Laser event

  • T_blast: Peak laser temperature (K), e.g. 800.
  • laser_R: Laser sphere radius (Å), e.g. 6.
  • laser_speed: Sweep speed in X (Å/ps).
  • x0,y0,z0: Start position of the laser center (Å).
  • Derived in‑script:
    • lx = x0 + laser_speed * time, ly = y0, lz = z0 (updated each step).
    • sweep_steps = ceil(((box_x - x0 + laser_R) / laser_speed) / dt)
    • quench_steps = ceil(sweep_steps / 2)
    • markinterval = 50 (how often we “paint” Type 4 during the sweep)

Coloring (types)

  • Types are assigned automatically:
    • Gate → Type 2
    • Control → Type 3
    • Rest → Type 1
    • Laser‑pass → Type 4 (via a run‑every command while the laser moves)

Outputs you can plot/inspect

Thermo (printed to console/log)

  • temp: system temperature
  • c_Tgate, c_Tctrl, c_Tlaser: group temperatures for gate, control, and laser group
  • v_gate_state: 1 when c_Tgate < Tc (proxy for “superconducting”), else 0
  • pe, ke, etotal, press: standard MD observables

Dump file (dump.cryotron)

  • Columns: id type x y z c_KE c_PE c_CENT vx vy vz
  • Per‑atom fields:
    • c_KE: kinetic energy per atom
    • c_PE: potential energy per atom
    • c_CENT: centrosymmetry (8 neighbors for bcc); larger values indicate defects/disorder

Visualizing in OVITO (step‑by‑step)

  1. Open dump.cryotron in OVITO.
  2. Modifier: “Color coding” → Property: Type → set a clear palette:
    • Type 1: grey, Type 2: blue, Type 3: green, Type 4: red (laser scar)
  3. Optional overlays:
    • Add another “Color coding” on c_CENT (Centrosymmetry) to highlight the melted/quenched track (use a perceptual colormap; clamp high values so hot pixels don’t dominate). Or color by c_PE to see high‑energy scar.
    • Use “Slice” or “Clipping” to see cross‑sections if needed.
  4. Animation:
    • Play the trajectory to watch the moving hot spot (laser) and how it leaves the red Type‑4 track.
    • Export as video/GIF if desired.

How to interpret what you see

  • Temperature proxy for switching: When the gate temperature c_Tgate drops below Tc, v_gate_state = 1 (think “superconducting” ON). When above, it’s 0 (OFF). This is a simplified, thermal proxy – not real superconductivity.
  • Laser scar: The red Type‑4 atoms mark where the hot spot passed. High c_CENT and elevated c_PE there indicate local disorder/defects from melt–quench.
  • Regions:
    • Blue (Type 2) = gate strip; Green (Type 3) = control strip; Grey (Type 1) = rest; Red (Type 4) = laser track.
  • Expected sequence: cool → equilibrate → gate heats (OFF) → gate cools (ON) → laser sweep paints a track.

Switching to a material potential (optional)

Set variable use_eam equal 1 in in.cryotron and add a compatible file like Nb.eam.fs into this folder. The script already maps 4 atom types to Nb for EAM:

pair_style  eam/fs
pair_coeff  * * Nb.eam.fs Nb Nb Nb Nb

Notes:

  • EAM parameters for Nb differ from Lennard‑Jones. Expect different stiffness and energies.
  • The laser T_blast may need adjustment for realistic melting in EAM.

Reproducibility and performance

  • Random seeds are fixed in velocity and fix langevin commands.
  • Default timestep is 0.5 fs (0.0005 ps) for stability with LJ params.
  • Total steps (default settings): roughly 355,000 including pre‑equilibration. The MD step counter after reset_timestep will end around 353,000.

Troubleshooting

  • “Illegal compute centro/atom”: For bcc you must specify 8 neighbors. The script uses compute CENT all centro/atom 8.
  • “Potential file not found”: If use_eam=1, ensure Nb.eam.fs is in the run directory.
  • Instabilities (blow‑ups): Reduce T_blast, increase Tdamp_hot, or increase laser_R slightly. Ensure timestep dt is small enough.
  • Not seeing the track: Make sure you color by Type first; Type 4 (red) marks the scar. Also consider slowing the sweep by reducing laser_speed or increasing markinterval granularity.

License and attribution

This is a minimal educational example. Use freely for demos and exploration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages