Metadata-Version: 2.4
Name: mttsa
Version: 0.1.0
Summary: Magnetic Transport-related Tensor Symmetry Analyzer (MTTSA)
Author-email: Peng Jiang <pjiang@jsnu.edu.cn>
License-Expression: MIT
Project-URL: Homepage, https://github.com/PengJiang08/mttsa
Project-URL: Repository, https://github.com/PengJiang08/mttsa
Project-URL: Issues, https://github.com/PengJiang08/mttsa/issues
Keywords: magnetism,symmetry,transport,tensor,spglib,wannier
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: sympy>=1.10
Requires-Dist: spglib>=2.0
Dynamic: license-file

# MTTSA

**M**agnetic **T**ransport-related **T**ensor **S**ymmetry **A**nalyzer — determine magnetic space/point
groups from a magnetic POSCAR and list symmetry-allowed transport tensor components.

## Install (recommended)

```bash
pip install mttsa
```

This installs a **pre-built wheel** from PyPI (no local compilation). Requires Python ≥ 3.9.

```bash
mttsa path/to/structure.vasp
mttsa --version
```

### Dependencies

Installed automatically: `numpy`, `sympy`, `spglib`.

If `spglib` fails via pip (common on some platforms), use conda first:

```bash
conda install -c conda-forge spglib numpy sympy
pip install mttsa
```

### Slow or blocked PyPI access

Use a mirror, for example:

```bash
pip install mttsa -i https://pypi.tuna.tsinghua.edu.cn/simple \
  --trusted-host pypi.tuna.tsinghua.edu.cn
```

If you see `SSLCertVerificationError` (e.g. campus network proxy), try the mirror
above or install from a downloaded wheel file (see *Offline install* below).

## Development install (from source)

```bash
git clone https://github.com/PengJiang08/mttsa.git
cd mttsa
conda create -n mttsa python=3.11 -y
conda activate mttsa
conda install -c conda-forge numpy sympy spglib setuptools wheel -y
pip install -e . --no-build-isolation
```

`--no-build-isolation` avoids downloading build tools when the network blocks PyPI.

## Offline install

Download `mttsa-*.whl` from PyPI (or GitHub Releases), then:

```bash
pip install /path/to/mttsa-0.1.0-py3-none-any.whl
```

Ensure `numpy`, `sympy`, and `spglib` are already installed in the same environment.

## Usage

```bash
mttsa path/to/structure.vasp
mttsa path/to/structure.vasp --symprec 1e-3
mttsa path/to/structure.vasp 1e-3       # positional symprec (legacy)
mttsa path/to/structure.vasp --no-write # print only, no report files
mttsa -h
mttsa --version
```

Equivalent:

```bash
python -m mttsa path/to/structure.vasp
```

A sample POSCAR is in `examples/MnBi2Te4/MnBi2Te4.vasp` (monolayer MnBi2Te4).
After `pip install mttsa`, it is also under `share/mttsa/examples/MnBi2Te4/` in
your Python environment prefix.

Outputs next to the input file:

- `<name>_mttsa_report.txt` — text report
- `<name>_mttsa_report.html` — HTML with MathJax formulas
- `<name>_mttsa_report.json` — machine-readable summary

Programmatic API:

```python
from mttsa import run
data = run("structure.vasp")
```

## Magnetic POSCAR format

Standard VASP header; each atom line has **seven** fields:

```
x_frac  y_frac  z_frac  Occupancy  Mx  My  Mz
```

`(Mx, My, Mz)` are magnetic moments in the **Cartesian spin basis**. Selective
dynamics is not supported in this 7-column format.

## Catalogued response tensors

Berry curvature, AHC, linear and nonlinear spin Hall (SHC), second-order conductivity
(BCD / QMD / IMD channels), CISP, intrinsic NSHE, and SHG (even/odd channels). The
report lists allowed/forbidden components under the identified magnetic point group,
with independent components and symmetry relations.

## For maintainers (PyPI upload)

Before each release:

```bash
python scripts/check_release.py
twine check dist/*
twine upload dist/*
```

Bump `version` in `pyproject.toml` and `src/mttsa/__init__.py` together.

## License

MIT — see `LICENSE`.
