Skip to main content

ZStar

PyPI Python License

ZStar is a Python workflow toolkit for polarization, Born effective charge (BEC), phonon, infrared, Raman, and dielectric-response calculations with ABACUS, PyATB, and Phonopy.

Highlights

  • Forward or central finite-difference BECs.
  • Symmetry reduction, full-cell reconstruction, and acoustic-sum-rule correction.
  • Serial and resumable 0.no-move -> displacements execution.
  • Reuse of the converged reference charge density.
  • A one-time insulating-state gate using a normal band path by default.
  • Shell, Slurm, and Torque/PBS driver generation.
  • Legacy and direct-static-response PyATB compatibility.
  • Hybrid 2D BECs: Berry-phase in-plane response plus cube-integrated out-of-plane dipole.
  • IR, Raman, static/frequency-dependent dielectric, and MD + BEC response.

Installation

pip install -U zstar
zstar --version

Python 3.9 or newer is required. ABACUS, PyATB, and Phonopy are external programs used only by the corresponding workflows.

Serial BEC Workflow

# Generate 0.no-move and displacement folders
zstar gen --stru STRU --pyatb --method forward --force

# Run one resumable serial chain
zstar workflow run --root . --dim 3 \
  --abacus-command "mpirun -np 1 abacus" \
  --pyatb-command "mpirun -np 1 pyatb"

# Inspect progress
zstar workflow status

# Construct symmetry-consistent BEC tensors
zstar deal --dim 3 --method forward --pyatb

For a 2D slab, use --dim 2 in generation, execution, and post-processing. Full x/y/z displacements are required because the out-of-plane BEC row is obtained from the real-space slab dipole. The slab normal must currently align with Cartesian z.

Audit one reference/displaced charge-density pair directly:

zstar polar2d --reference-cube reference.cube \
  --displaced-cube atom_zplus.cube \
  --displacement 0.01 --outdir slab_dipole_check

The default insulating gate runs only for 0.no-move and uses:

pyatb_input --band

The path gate is a lightweight fail-fast check and cannot exclude an off-path metallic pocket. Use --gap-mode mp when a stricter MP-grid check is desired.

Generate one environment-specific driver:

zstar workflow script --backend shell
zstar workflow script --backend slurm --queue compute --cpus-per-task 28
zstar workflow script --backend torque --queue batch --cpus-per-task 28

Shell/Torque default to mpirun -np N; Slurm defaults to srun --ntasks=N. Use --dry-run for an environment and state-output smoke test without launching an electronic-structure calculation.

Phonon, IR, and Dielectric Response

# INPUT must contain: cal_force 1
zstar ph --stru STRU --dim "2 2 2"
# Run all disp-* force calculations.
zstar postph
zstar irrep --file irreps.yaml --mode db

# Copy BORN and Z-BORN-symm.out from the BEC workflow.
zstar calc --qpoints qpoints.yaml --born Z-BORN-symm.out --dielectric BORN
zstar freq --qpoints qpoints.yaml --born Z-BORN-symm.out --dielectric BORN
zstar ir --qpoints qpoints.yaml --born Z-BORN-symm.out --dielectric BORN

For --dim 2, dielectric/IR response is reported as sheet polarizability unless an effective --thickness is supplied.

Raman Workflow

zstar raman prepare --stru STRU --qpoints qpoints.yaml \
  --modes "4-12" --copy INPUT-scf --copy KPT

zstar raman run --raman-dir raman --reference 0.no-move \
  --qpoints qpoints.yaml --dim 3

The Raman runner reuses the reference insulating gate and charge density, records every plus/minus stage, collects central-difference dielectric derivatives, and writes a Placzek spectrum.

MD + BEC Dielectric Response

ZStar accepts either fixed BEC tensors or one tensor array per trajectory frame. Frame-dependent tensors may be generated by ZStar, forced to fixed values, or predicted by an external model.

zstar md --dump dump.lammpstrj \
  --bec-dir bec_frames --bec-pattern "frame_{step}.npy" \
  --electronic-dielectric BORN \
  --temperature 300 --type-map "1:Hf,2:Zr,3:O" \
  --outdir md_dielectric

The output separates ionic susceptibility, epsilon_infinity, and

epsilon_total = epsilon_infinity + chi_ionic

Main Outputs

File Meaning
Z-BORN-reduced.out Raw explicitly calculated representative tensors.
Z-BORN-symm.out Full-cell symmetry-reconstructed and neutral BEC tensors.
BORN Electronic dielectric tensor plus Phonopy-order BECs.
ir_spectrum/ Mode charges, IR spectrum, and dielectric/sheet response.
raman_spectrum/ Raman activities, tensors, and broadened spectrum.
md_dielectric/ Ionic, electronic, and total MD dielectric tensors.

Logo on PyPI

This description intentionally contains no repository-relative logo. PyPI cannot render an image stored only in a private GitHub repository. A logo must use a stable, publicly accessible HTTPS URL; relative images remain suitable for the private GitHub README itself.

License

ZStar is distributed under GPL-3.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zstar-0.1.1.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zstar-0.1.1-py3-none-any.whl (150.9 kB view details)

Uploaded Python 3

File details

Details for the file zstar-0.1.1.tar.gz.

File metadata

  • Download URL: zstar-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for zstar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 803bc87a5a67e10e484d08972510dc37d244da57398967d4d1586303d30b9237
MD5 c730ea87dc02d7c1a104f4dd7243da36
BLAKE2b-256 c35a8336ba469f7f1e482720c66fd4e49c14b612997dfd782ef5278ebbce7bb3

See more details on using hashes here.

File details

Details for the file zstar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zstar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 150.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for zstar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68b09cd34a6edd61d7ab8cfe5f56bd1d7b946c5266c679b283ddf97fd9f0a765
MD5 4be6413cdaabcc9bc7c8535039880c0d
BLAKE2b-256 5486a5186a16b0c06df81edf8ff10f232ad278e573273674077b6a01988efcf9

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.3

1 file

0.0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page