Psi4 Engine¶
psi4
¶
Psi4 quantum mechanics engine backend.
Wraps the Psi4 Python API for QM calculations: energy, Hessian, geometry optimization, and vibrational frequencies.
Requires: conda install psi4 -c conda-forge
Psi4Engine
¶
Psi4Engine(method: str = 'b3lyp', basis: str = '6-31+G(d)', memory: str = '2 GB', n_threads: int = 4, charge: int = 0, multiplicity: int = 1)
Bases: QMEngine
Quantum mechanics engine using Psi4.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
DFT functional or method (default: "b3lyp") |
'b3lyp'
|
basis
|
str
|
Basis set (default: "6-31+G(d)") |
'6-31+G(d)'
|
memory
|
str
|
Memory allocation (default: "2 GB") |
'2 GB'
|
n_threads
|
int
|
Number of threads (default: 4) |
4
|
charge
|
int
|
Molecular charge (default: 0) |
0
|
multiplicity
|
int
|
Spin multiplicity (default: 1) |
1
|
Initialize the Psi4 engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
DFT functional or method (e.g. |
'b3lyp'
|
basis
|
str
|
Basis set (e.g. |
'6-31+G(d)'
|
memory
|
str
|
Memory allocation string (e.g. |
'2 GB'
|
n_threads
|
int
|
Number of threads for parallel computation. |
4
|
charge
|
int
|
Molecular charge. |
0
|
multiplicity
|
int
|
Spin multiplicity. |
1
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If Psi4 is not installed. |
Source code in q2mm/backends/qm/psi4.py
name
property
¶
Human-readable engine name.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Engine name including method and basis set. |
is_available
¶
Check if Psi4 is installed.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
|
energy
¶
Calculate single-point energy in Hartrees.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
str | tuple
|
XYZ file path or |
required |
method
|
str
|
Override the default QM method. |
None
|
basis
|
str
|
Override the default basis set. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Electronic energy in Hartrees. |
Source code in q2mm/backends/qm/psi4.py
hessian
¶
Calculate Hessian matrix (second derivatives of energy).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
str | tuple
|
XYZ file path or |
required |
method
|
str
|
Override the default QM method. |
None
|
basis
|
str
|
Override the default basis set. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Shape |
Source code in q2mm/backends/qm/psi4.py
optimize
¶
Optimize geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
str | tuple
|
XYZ file path or |
required |
method
|
str
|
Override the default QM method. |
None
|
basis
|
str
|
Override the default basis set. |
None
|
opt_type
|
str
|
|
'min'
|
Returns:
| Type | Description |
|---|---|
tuple
|
tuple[float, list[str], np.ndarray]: |
Source code in q2mm/backends/qm/psi4.py
frequencies
¶
Calculate vibrational frequencies in cm⁻¹.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
str | tuple
|
XYZ file path or |
required |
method
|
str
|
Override the default QM method. |
None
|
basis
|
str
|
Override the default basis set. |
None
|
Returns:
| Type | Description |
|---|---|
list[float]
|
list[float]: Vibrational frequencies in cm⁻¹. |
Source code in q2mm/backends/qm/psi4.py
close
¶
__enter__
¶
__enter__() -> Psi4Engine