qstack.spahm.rho.bond_selected¶
Representation for a specific bond in a molecule.
- qstack.spahm.rho.bond_selected.get_spahm_b_selected(mols, bondidx, xyzlist, readdm=None, guess='LB', xc='hf', spin=None, cutoff=5.0, printlevel=0, omods=['alpha', 'beta'], bpath='/home/runner/work/Q-stack/Q-stack/qstack/spahm/rho/basis_opt', only_m0=False, same_basis=False)[source]¶
Compute SPAHM(b) representations for specific bonds in molecules.
Generates bond-centered representations for user-specified atom pairs across a dataset of molecules, useful for targeted bond analysis.
- Parameters:
mols (list) – List of pyscf Mole objects.
bondidx (numpy ndarray) – 2D array (nmols, 2) of 0-indexed atom pairs defining bonds.
xyzlist (list) – List of XYZ filenames corresponding to mols.
readdm (str, optional) – Directory to load pre-computed density matrices. Defaults to None.
guess (str) – Guess Hamiltonian method name. Defaults to defaults.guess.
xc (str) – Exchange-correlation functional. Defaults to defaults.xc.
spin (numpy ndarray, optional) – Array of numbers of unpaired electrons per molecule. Defaults to None.
cutoff (float) – Maximum bond distance in Å. Defaults to defaults.cutoff.
printlevel (int) – Verbosity level. Defaults to 0.
omods (list) – Open-shell modes (e.g. ‘alpha’, ‘beta’). Defaults to defaults.omod.
bpath (str) – Path to bond basis set directory. Defaults to defaults.bpath.
only_m0 (bool) – Use only m=0 basis functions. Defaults to False.
same_basis (bool) – Use generic CC.bas for all pairs. Defaults to False.
- Returns:
List of (filename, representation) tuples for each specified bond.
- Return type:
list
- qstack.spahm.rho.bond_selected.main()[source]¶
Command-line interface for computing SPAHM(b) representations for specific bonds.
Reads a file listing XYZ structures and bond indices, computes representations for each specified bond, and saves them to individual files. The input file format is: XYZ_path atom1_index atom2_index (1-indexed).
- Parameters:
None – Parses command-line arguments.
- Output:
Saves bond representations to numpy files in specified directory.
Command-line use¶
This program computes the SPAHM(b) representation for a list of bonds
usage: python3 -m qstack.spahm.rho.bond_selected [-h]
[--guess {core,sad,sap,gwh,lb,huckel,lb-hfs}]
[--basis BASIS] [--xc XC]
[--ecp ECP] [--readdm READDM]
[--units {Angstrom,Bohr}]
[--omod {sum,diff,alpha,beta} [{sum,diff,alpha,beta} ...]]
[--print PRINT]
[--cutoff CUTOFF]
[--bpath BPATH] [--onlym0]
[--same_basis] --mol FILENAME
[--charge CHARGE]
[--spin SPIN] [--dir DIR]
Named Arguments¶
- --guess
Possible choices: core, sad, sap, gwh, lb, huckel, lb-hfs
the initial guess Hamiltonian to be used
Default:
'LB'- --basis
basis set for computing density matrix
Default:
'minao'- --xc
DFT functional for the SAD guess
Default:
'hf'- --ecp
effective core potential to use
- --readdm
directory to read density matrices from
- --units
Possible choices: Angstrom, Bohr
the units of the input coordinates
Default:
'Angstrom'- --omod
Possible choices: sum, diff, alpha, beta
model(s) for open-shell systems (alpha, beta, sum, diff
Default:
['alpha', 'beta']printing level
Default:
0- --cutoff
bond length cutoff in Å
Default:
5.0- --bpath
directory with basis sets
Default:
'/home/runner/work/Q-stack/Q-stack/qstack/spahm/rho/basis_opt'- --onlym0
use only functions with m=0
Default:
False- --same_basis
if to use generic CC.bas basis file for all atom pairs (Default: uses pair-specific basis, if exists)
Default:
False- --mol
path to a list of molecular structures in xyz format and indices of bonds in question
- --charge
file with a list of charges
- --spin
file with a list of numbers of unpaired electrons
- --dir
directory to save the output in
Default:
'./'
Note
If you built those docs yourself and the command-line section is empty, please make sure you have installed the right components of qstack.