Skip to main content

A Python package for tight-binding model calculations for altermagnets

Project description

PyAMTB

A Python package for tight-binding model calculations for altermagnets.

Introduction

PyAMTB (Python Altermagnet Tight Binding) is built on top of the PythTB package, providing specialized tight-binding model calculations for altermagnets. It extends PythTB's capabilities by adding direct support for POSCAR structure files and altermagnet-specific features.

Features

  • Tight-binding model calculations for altermagnets
  • Support for various lattice structures
  • Band structure calculations
  • Easy configuration through TOML files
  • Command-line interface for quick calculations

Installation

From PyPI

pip install pyamtb

From source

git clone https://github.com/ooteki-teo/pyamtb.git
cd pyamtb
pip install -e .

Usage

Command Line Interface

The package provides a command-line interface for easy calculations:

# Show help and available commands
pyamtb --help

# Calculate distances between atoms
pyamtb distance --poscar POSCAR --element1 Mn --element2 N

# create a template.toml file
pyamtb template 

# Calculate band structure using configuration file
pyamtb calculate --config config.toml --poscar POSCAR

Configuration

The package uses TOML files for configuration. Here's an example configuration file (config.toml):

# Basic parameters
dimk = 3                    # Dimension of k-space (1, 2, or 3)
dimr = 3                    # Dimension of real space
nspin = 2                   # Number of spin components (1 or 2)
a0 = 1.0                    # Lattice constant scaling factor

# Band structure calculation
k_path = ["G", "X", "M", "G"]  # k-point path
num_k_points = 100             # Number of k-points
k_labels = ["Γ", "X", "M", "Γ"]  # k-point labels

# Hopping parameters
t0 = 1.0                      # Reference hopping strength
t0_distance = 2.0             # Reference distance
lambda_ = 1.0                 # Decay parameter
max_neighbors = 2             # Maximum number of neighbors to consider
max_distance = 10.0           # Maximum hopping distance
mindist = 0.1                 # Minimum hopping distance

# Onsite energy and magnetism
onsite_energy = [0.0, 0.0]    # Onsite energy for each atom
magnetic_moment = 1.0         # Magnetic moment
magnetic_order = "++--"       # Magnetic order pattern

# Output settings
output_filename = "band_structure"
output_format = "png"
savedir = "."

# Debug options
is_print_tb_model = false
is_print_tb_model_hop = false
is_check_flat_bands = true
adjust_degenerate_bands = true
energy_threshold = 0.001

Python API

You can also use the package in your Python code:

from pyamtb import Parameters, calculate_band_structure, create_pythtb_model

# Load parameters from TOML file
params = Parameters("config.toml")

# Create tight-binding model
model = create_pythtb_model("POSCAR", params)

# Calculate band structure
calculate_band_structure(model, params)

Development

Running Tests

pip install -e ".[dev]"
pytest

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use this package in your research, please cite:

@software{pyamtb,
  author = {Dinghui Wang, Junting Zhang, Yu Xie},
  title = {PyAMTB: A Python package for tight-binding model calculations},
  year = {2024},
  url = {https://github.com/ooteki-teo/pyamtb.git}
}

Project details


Download files

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

Source Distribution

pyamtb-0.1.3.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

pyamtb-0.1.3-py2.py3-none-any.whl (22.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyamtb-0.1.3.tar.gz.

File metadata

  • Download URL: pyamtb-0.1.3.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pyamtb-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7a63035dc173b51642c30c73e9c6342823699833496c312dc556784cc5095c88
MD5 c06ee54f95c0bfc15e8737a4d452905c
BLAKE2b-256 8250edc6b38022b277342faa99b1bb99b0efed60dc79cc425d68dc77c9c72cf2

See more details on using hashes here.

File details

Details for the file pyamtb-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pyamtb-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pyamtb-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1cdad1ec0ad6f24d982e1d367f5acea614712e166bab6730dcd4155b602536f9
MD5 724396fdd58a0044c5d3bf231d6626e8
BLAKE2b-256 74443d6e9f552b066d1f891d40a207a37b05c8ffc99ef2daced7a698e92c3796

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page