Metadata-Version: 2.4
Name: qe_to_tcad
Version: 0.2.8
Summary: Automated Quantum ESPRESSO to TCAD bridge for optical and dielectric properties
Author: Lauryne
License-Expression: MIT
Project-URL: Homepage, https://quantum-arise-acad.github.io/site_tcad/
Project-URL: Documentation, https://quantum-arise-acad.github.io/site_tcad/
Project-URL: Docs source, https://github.com/Quantum-ARISE-Acad/site_tcad
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.7
Requires-Dist: pymatgen>=2023.0
Requires-Dist: mp-api>=0.40
Requires-Dist: matplotlib>=3.5
Requires-Dist: plotext>=5.2
Requires-Dist: rich>=12.0
Requires-Dist: requests>=2.25
Requires-Dist: python-dotenv>=0.19
Provides-Extra: tcad
Requires-Dist: devsim>=2.8.0; extra == "tcad"
Dynamic: license-file

# qe-to-tcad

Automated bridge from **Quantum ESPRESSO** to **TCAD**-ready material data
(optical / dielectric properties and simple 1D device checks).

Public docs: [quantum-arise-acad.github.io/site_tcad](https://quantum-arise-acad.github.io/site_tcad/)

## What you get

| Command | Role |
|---------|------|
| `qe-bridge` | Fetch structure, run DFT workflow, write JSON for TCAD |
| `qe-plot` | Dielectric dispersion figures (when epsilon data exists) |
| `qe-tcad` | 1D diode / transistor / sensor validation (DEVSIM) |

## Install (PyPI)

```bash
pip install --upgrade 'qe-to-tcad[tcad]'

qe-bridge --help
qe-plot --help
qe-tcad --help
```

Requirements for the Python package:

- Python 3.10+
- Quantum ESPRESSO (`pw.x`, optionally `epsilon.x`) and MPI on the host
- Materials Project API key (`MP_API_KEY`, 32 characters)

```bash
export MP_API_KEY="your_32_char_key"
export QE_PW="/path/to/pw.x"   # if pw.x is not in PATH
```

Optional `.env` in the run directory:

```bash
MP_API_KEY=your_32_char_key
QE_PW=/usr/bin/pw.x
MPI_NPROC=4
```

## Quick start (PyPI)

```bash
mkdir -p ~/qe_runs && cd ~/qe_runs
qe-bridge SiGe
qe-plot SiGe
qe-tcad SiGe diode
qe-tcad SiGe transistor
```

Dielectric / optical Phase 4 (`epsilon.x`) is optional and expensive:

```bash
qe-bridge SiGe                 # default --epsilon ask
qe-bridge SiGe --epsilon empiric
qe-bridge SiGe --epsilon compute
qe-bridge SiGe --epsilon mp
```

- **ask** (default): Materials Project ε₀ if available; otherwise prompt; `N` → empirical table  
- **empiric** / **mp**: skip `epsilon.x` when possible  
- **compute**: force `epsilon.x`

The JSON under `parsed_data/` always includes `dielectric_constant` and `dielectric_source`.

## Docker (all-in-one)

Image: `lauryneelv/qe-to-tcad:0.2.7` (also `:latest`)  
Includes Quantum ESPRESSO, DEVSIM, and the three commands.

```bash
export MP_API_KEY="your_32_char_key"
mkdir -p ~/qe_runs && cd ~/qe_runs

# Prefer an explicit --epsilon mode in Docker (no TTY → no Y/N prompt).
docker run --rm -e MP_API_KEY -v "$PWD:/data" -w /data \
  lauryneelv/qe-to-tcad:0.2.7 SiGe --epsilon empiric

docker run --rm -v "$PWD:/data" -w /data \
  --entrypoint qe-plot lauryneelv/qe-to-tcad:0.2.7 SiGe

docker run --rm -v "$PWD:/data" -w /data \
  --entrypoint qe-tcad lauryneelv/qe-to-tcad:0.2.7 SiGe diode
```

Notes:

- If you use `sudo docker`, pass the key in the command: `-e MP_API_KEY="your_32_char_key"` (sudo drops a prior `export`).
- Without `-it`, `--epsilon ask` skips the prompt and uses empiric when MP has no ε₀. Use `--epsilon compute` / `empiric` / `mp`, or add `-it` for the interactive prompt.
- On Apple Silicon Macs, add `--platform linux/amd64` if the image has no arm64 build yet.

## Typical outputs (run directory)

```text
parsed_data/          # TCAD JSON
epsilon_out/          # epsilon.x data (if computed)
plots/                # dielectric figures
tcad_outputs/         # diode / transistor validation PNGs
```

## License

MIT — see [LICENSE](LICENSE).
