Skip to content

Local Polarization Workflow

CLI for local h-BN-reference dipole and polarization.

Command: get-hbn-reference-local-polarization

Calculate Al-centered local dipole and polarization.

Each Al uses three nearest coplanar N images in the fixed hBN reference. Partition weights share each N contribution among its Al neighborhoods, preserving the global dipole. --local-charge-method neutral-center instead keeps the Al charge and assigns -q_Al/3 to each neighbor contribution, enforcing local neutrality. Al-centered values are the default; cell output sums pairs of Al neighborhoods. The layer output is an alias for Al-centered output, not a disjoint AlN pair. Large local, cell, and layer CSVs require --export-local-csv. Equal volume shares the selected frame volume among Al centers; deformation uses normalized local affine-deformation weights. The default slab volume is bbox, measured after reference-based unwrapping. --volume-method local-hull instead uses each Al and its three N images as an independent tetrahedral hull. Coplanar neighborhoods have zero volume and undefined polarization.

AlN_hbn_oriented.cif contains the selected small reference cell before replication. AlN_hbn_replicated_aligned.xyz contains the aligned reference supercell. The local Extended XYZ records local_neighborhood_id on Al centers (-1 on N) and one set of Al-centered local properties, even when cell CSVs are selected. Reference-cell bookkeeping remains in the separate reference mapping artifacts.

Examples


  reaxkit get-hbn-reference-local-polarization --replication 19 19 10 --periodic xy --charge-source reaxff --volume-method hull --write-extxyz

  reaxkit get-hbn-reference-local-polarization --replication 19 19 10 --charge-source formal --formal-charge Al=3 N=-3 --local-volume-method deformation --plot-2d --plot-plane xz --plot-component c

Arguments

Scientific choices

Flag Required Default Help Choices
--reference No PosixPath('/home/runner/work/reaxkit/reaxkit/src/reaxkit/analysis/ferroelectrics/hbn_reference/AlN_hbn.cif') Select the nonpolar reference CIF. Default: bundled AlN_hbn.cif. Example: --reference AlN_hbn.cif, which reads that nonpolar reference structure.
--replication Yes Repeat the oriented reference explicitly. Example: --replication 19 19 10 repeats an orthogonalized AlN_hbn cell by those counts.
--charge-source No auto Choose ReaxFF or formal charges. Example: --charge-source formal --formal-charge Al=3 N=-3, uses the configured species charges; auto uses fort.7 when available. auto, reaxff, formal
--formal-charge No ['Al=3.0', 'N=-3.0'] Assign species formal charges in e. Defaults: Al=3 N=-3; provide values for additional trajectory species. Example: --formal-charge Al=3 N=-3, which assigns aluminum and nitrogen their specified charges in e.
--reference-species No ['B=Al'] Map substitutions onto reference sites. Default: B=Al. Example: --reference-species B=Al, which maps boron substitutions onto aluminum reference sites.
--c-axis No 0.0, 0.0, 1.0 Set the Cartesian longitudinal direction. Default: 0 0 1. Example: --c-axis 0 0 1, which uses the Cartesian z direction as the longitudinal axis.
--periodic No xyz Choose periodic directions used for matching and displacement. Example: --periodic xy, which applies periodic matching in x and y only. none, x, y, z, xy, xz, yz, xyz
--cell-lengths No Override trajectory cell lengths in angstrom for every frame. Example: --cell-lengths 30 30 60, which uses those cell lengths in angstrom for every frame.
--cell-angles No 90.0, 90.0, 90.0 Set angles for --cell-lengths in degrees. Example: --cell-angles 90 90 90, which uses an orthogonal cell with the supplied lengths.
--frames No Select zero-based source frames, for example --frames 0:101:10. Example: --frames 0:20:2, which includes source frames 0, 2, ..., 18.
--every No 1 Stride selected frames. Example: --every 5, which keeps every fifth selected frame.
--reference-frame No 0 Choose the frame used to size, assign, and write the reference lattice. Example: --reference-frame 0, which uses the initial frame to establish the reference assignment.
--orthogonalize-reference, --no-orthogonalize-reference No Apply ReaxKit's hexagonal-to-orthogonal transform before replication. Use --no-orthogonalize-reference to retain the CIF cell. If omitted, the cell angles select the better representation automatically. Example: --orthogonalize-reference, which converts the hexagonal reference cell before replication.
--angle-tolerance No 1.0 Set the cell-angle comparison tolerance in degrees. Example: --angle-tolerance 1, which allows a one-degree cell-angle mismatch.
--max-reference-strain No 0.15 Scale a replicated reference axis to the trajectory box only when the relative length change is at most this value. Larger gaps are treated as vacuum. Default: 0.15. Example: --max-reference-strain 0.15, which allows at most 15 percent reference-axis scaling.
--volume-method No bbox Volume convention: bbox (default) or hull measures the slab; cell includes the full box. local-hull uses a separate unnormalized hull around each Al and its three N images. Example: --volume-method local-hull. bbox, hull, cell, local-hull
--max-alignment-candidates No 8 Limit periodic origin candidates considered during initial atom assignment. Example: --max-alignment-candidates 8, which tests at most eight periodic-origin candidates.
--local-grouping No al Select Al-centered values (default), sums over reference cells, or layer (alias for Al-centered values). Example: --local-grouping al. al, cell, layer
--local-volume-method No equal Choose equal shares (default), normalized deformation weights, or independent neighborhood hull volumes. Example: --local-volume-method hull; equivalent to --volume-method local-hull. equal, deformation, hull
--deformation-neighbors No 12 Set the maximum neighboring reference cells used by local affine fits. Default: 12. Example: --deformation-neighbors 12, which uses at most twelve neighboring reference cells in each affine fit.
--local-charge-method No partition Partition actual atomic contributions to preserve the total (default), or keep each Al charge and compensate it equally on three N images. Example: --local-charge-method neutral-center. partition, neutral-center
--geometric-zero-tolerance No 1e-06 Zero threshold in angstrom for Al-minus-neighbor-mean displacement. Default: 1e-6. Example: --geometric-zero-tolerance 0.001.

Input and file selection

Flag Required Default Help Choices
--engine No Select the input adapter. Example: --engine reaxff, bypasses engine auto-detection. reaxff, ams, lammps
--input No . Set the path used for engine detection. Example: --input ./run, inspects ./run.
--run-dir No . Set the fallback simulation directory. Example: --run-dir ./run, resolves default files there.
--fort7 No fort.7 Select the ReaxFF charge file. Example: --fort7 ./run/fort.7, streams charges from that file.
--fort78 No fort.78 Select the applied-field file. Example: --fort78 ./run/fort.78, reads field samples from that file.
--xmolout No xmolout Select the coordinate trajectory. Example: --xmolout ./run/xmolout, reads atom names and positions there.
--summary No Select optional simulation metadata. Example: --summary ./run/summary.txt, reads timing and cell metadata there.

Outputs and plots

Flag Required Default Help Choices
--output-dir No Choose the output directory for CSV and XYZ artifacts. Example: --output-dir analysis/charges, which writes generated artifacts beneath that directory.
--write-displacements No False Write the per-atom displacement table. Disabled by default because the table can be very large. Example: --write-displacements, which writes the optional per-atom displacement table.
--export-local-csv No False Write the large local, cell, and layer polarization CSVs (off by default). Example: --export-local-csv, adds all three detailed tables while summaries and requested Extended XYZ output are retained by default.
--plot-2d No False Write per-frame 2D maps after aggregating along the omitted coordinate. Example: --plot-2d, which writes projected spatial heatmaps.
--plot-3d No False Write per-frame 3D cell-center scatter plots. Example: --plot-3d, which writes three-dimensional center scatter plots.
--plot-plane No xy Choose the displayed plane for --plot-2d. Default: xy. Example: --plot-plane xy, which displays x and y while aggregating along z. xy, xz, yz
--plot-component No c Choose the dipole or polarization component used as plot color. Default: c. Example: --plot-component z, which colors plots by the z component. x, y, z, c
--plot-quantity No polarization Plot local polarization (default) or local dipole. Example: --plot-quantity dipole, which colors plots by local dipole instead of polarization. polarization, dipole
--plot-bins No 40, 40 Set the two in-plane bin counts for --plot-2d. Default: 40 40. Example: --plot-bins 40 40, which uses 40 bins along each displayed axis.
--global-scaling, --no-global-scaling No False Use shared symmetric color limits across frames. Example: --global-scaling, which uses shared symmetric color limits across frames.
--figure-dpi No 180 Set PNG resolution. Default: 180. Example: --figure-dpi 300, which writes PNG plots at 300 dots per inch.
--write-extxyz No False Write an OVITO-compatible trajectory with local vector properties. Example: --write-extxyz, which exports local vector properties for OVITO.
--extxyz-precision No 8 Set significant digits in Extended XYZ output. Default: 8. Example: --extxyz-precision 8, which writes eight significant digits in Extended XYZ properties.
--plot-style No default Plot appearance: default preserves existing styling; publication uses clear fonts and an accessible palette; publication-bold uses larger bold text and heavier lines. Example: --plot-style publication-bold, which improves readability when figures are reduced in a manuscript. default, publication, publication-bold
--color-style No default Color treatment: default preserves existing colors; light-fill uses lighter bar and marker interiors with the original outlines and lines. Example: --color-style light-fill, which adds contrast between fills and borders. default, light-fill
--detail-format No Optional detail format (default: Parquet; legacy: CSV). Example: --detail-format csv, which writes requested detail tables as CSV. parquet, csv

Execution

Flag Required Default Help Choices
--execution No auto Execution backend; unsupported backends fall back to serial with a logged reason. Example: --execution serial, which processes work sequentially. auto, serial, threads, processes
--workers No 0 Frame workers: auto or N (default: auto). Example: --workers 4, which requests four frame workers.
--chunk-size No 0 Maximum in-flight frames: auto or N. Example: --chunk-size 8, which limits concurrent frame processing to eight frames.

Storage and cache

Flag Required Default Help Choices
--run-id No Run identifier for run-scoped layout. Example: --run-id run_91ac0e, which reuses that run identifier.
--project-root No reaxkit_workspace Project root that contains inputs/, data/, analysis/, etc. Example: --project-root ./workspace, which stores run artifacts there.
--analysis-id No Optional analysis artifact id; defaults to run id. Example: --analysis-id comparison-a, which names the analysis artifact explicitly.
--input-cache, --no-input-cache No True Reuse parsed input frames across commands (default: enabled; use --no-input-cache to force source reads for reproducibility checks or benchmarks). Example: --no-input-cache, which reloads frames from their source files.
--frame-cache-max-gb No 10.0 Maximum workspace frame-cache size in GiB (default: 10; use 0 for unlimited). Example: --frame-cache-max-gb 20, which caps cached frames at 20 GiB.
--output-profile No standard Select the shared artifact policy. Standard writes declared default outputs; minimal keeps core tables; full and legacy include optional details. Default: standard. Example: --output-profile full, which includes declared optional detail tables. minimal, standard, full, legacy
--profile No False Record deterministic function calls and timings for all Python threads (requires --diagnostics and reaxkit[profiling]).
--profile-clock No wall Profiler timer: elapsed wall time (default) or thread CPU time. Requires --profile to record. wall, cpu
--diagnostics, --no-diagnostics No False Enable a per-command report, console log, resource samples, and periodic Python stacks under logs/diagnostics (disabled by default).
--diagnostic-interval-seconds No 60.0 Python stack sampling interval (default: 60 seconds). Example: --diagnostic-interval-seconds 30.
--checkpoint, --no-checkpoint No Enable durable result batches for audited commands. Example: --no-checkpoint, disables recovery storage.
--resume No Resume a compatible result checkpoint; repeat the original scientific options. Example: --resume ./checkpoint, skips committed calculations.
--checkpoint-buffer-mb No 32 Result buffer in MiB, plus one oversized frame. Example: --checkpoint-buffer-mb 32, bounds pending result payloads to approximately 32 MiB.
--checkpoint-interval-seconds No 30 Flush at the next completed frame after this interval. Example: --checkpoint-interval-seconds 30, commits roughly every 30 seconds.

Diagnostics and compatibility

Flag Required Default Help Choices
-h, --help No show this help message and exit
--help-all, --all-flags No Show every option, grouped by purpose. Example: --help-all, which includes advanced flags in the help output.

Common Runtime and Presentation Arguments

These are shared workflow-level CLI flags added before command-specific options, covering runtime context (engine/input/storage) and output presentation/export behavior.

Each command table above includes its shared and inherited options.