Metadata-Version: 2.4
Name: qcinput
Version: 0.7.0
Summary: Generate quantum chemistry input files from molecular structures
Project-URL: Homepage, https://github.com/yushengyangchem/qcinput
Project-URL: Issues, https://github.com/yushengyangchem/qcinput/issues
Project-URL: Documentation, https://github.com/yushengyangchem/qcinput#readme
Author-email: Yusheng Yang <yushengyangchem@gmail.com>
Maintainer-email: Yusheng Yang <yushengyangchem@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: cli,gaussian,orca,quantum-chemistry
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Chemistry
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# qcinput

`qcinput` reads an `xyz` or `gjf` geometry, applies task-specific keywords from a TOML config,
It reads an `xyz` or `gjf` geometry, applies task-specific keywords from a TOML config,
and emits ORCA or Gaussian input files for `int`, `ts`, or `sp` jobs.

## Install With pip

```bash
pip install qcinput
```

For development (from source):

```bash
pip install -e .
```

## Usage

```bash
qcinput generate <path/to/structure.xyz|.gjf> [-c|--config <path/to/qcinput.toml>] [-o output.inp]
```

Compatibility shorthand (same behavior):

```bash
qcinput <path/to/structure.xyz|.gjf> [-c|--config <path/to/qcinput.toml>] [-o output.inp]
```

Show version:

```bash
qcinput --version
qcinput -V
```

First-time setup:

```bash
qcinput init-config
qcinput init-config --kind int
qcinput init-config --kind ts
qcinput init-config --kind sp
```

`init-config` always writes `int/ts/sp` task sections in one TOML file; `--kind`
only sets the initial active value of `[qcinput].kind`.

Default config path:

```text
./qcinput.toml
```

You can override this with:

```bash
QCINPUT_CONFIG=/path/to/config.toml qcinput water.xyz
```

Example:

```bash
qcinput water.xyz -c qcinput.toml -o water_opt.inp
```

For ORCA and Gaussian, `kind = "ts"` now uses a two-step TS template.
Use:

```bash
qcinput water.xyz -c qcinput.toml -o water_ts.inp
```

ORCA TS settings:

```toml
[orca.task.ts]
step1_keywords = ["Opt"]
step2_keywords = ["OptTS", "Freq"]
constraint_atoms = [[0, 1], [2, 3]]
calc_hess = true
```

`constraint_atoms` accepts either one pair (`[0, 1]`) or multiple pairs
(`[[0, 1], [2, 3], ...]`).
ORCA TS uses global `[orca].nprocs` and `[orca].maxcore` for the compound workflow.
Step-2 reads `<output_stem>_Compound_1.xyz`.

Gaussian TS settings (`Link1`):

```toml
[gaussian.task.ts]
step1_keywords = ["Opt=ModRedundant"]
constraint_atoms = [[0, 1], [2, 3]]
step2_keywords = ["Opt=(TS,CalcFC,NoEigenTest,NoFreeze)", "Freq", "Geom=AllCheck", "Guess=Read"]
```

`constraint_atoms` accepts one pair (`[0, 1]`) or multiple pairs
(`[[0, 1], [2, 3], ...]`) and will be converted to `B i j F` lines.
**Note:** TOML uses 0-indexed atoms, but Gaussian ModRedundant is 1-indexed; conversion is automatic.
Legacy `modredundant` is still supported for compatibility.
`%chk` is auto-generated as `<structure_stem>.chk` (e.g. `water.xyz -> water.chk`).
This applies to Gaussian `int`, `sp`, and `ts`.

When `qcinput.engine = "gaussian"`, default output suffix is `.gjf`.

## Config Format (TOML)

We use TOML because it is readable for humans, easy to version control, and strongly structured.

```toml
[qcinput]
engine = "orca" # or "gaussian"
kind = "int" # int | ts | sp

[molecule]
charge = 0
multiplicity = 1

[orca]
nprocs = 8
maxcore = 4000
extra_keywords = ["TightSCF", "NormalSCF"] # optional, appended at end
smd = false # optional
smd_solvent = "toluene"

[orca.task.int]
base_keywords = ["B3LYP", "def2-TZVP"]
keywords = ["Opt", "Freq"]

[gaussian]
nprocshared = 8
mem = "8GB"
extra_keywords = ["SCF=Tight"] # optional, appended at end of keywords

[gaussian.task.int]
base_keywords = ["B3LYP/def2TZVP"]
keywords = ["Opt", "Freq"]
```

## Output Snippet

```text
# Generated by qcinput v<version> (https://github.com/yushengyangchem/qcinput)
! Opt Freq B3LYP def2-TZVP
%pal
  nprocs 8
end
%maxcore 4000
* xyz 0 1
O 0.000000 0.000000 0.000000
H 0.757000 0.586000 0.000000
H -0.757000 0.586000 0.000000
*
```
