For electronic structure calculations
Project description
Poraquê
Poraquê is a compact, readable density-functional theory (DFT) code for electronic-structure calculations. It implements both Kohn-Sham (KS-DFT) and orbital-free (OF-DFT) methods behind a single calculator, and integrates natively with the Atomic Simulation Environment (ASE) so that structures, workflows, and analysis tools from the wider ecosystem work out of the box.
Features
- Unified calculator. One ASE calculator,
poraque.ase.Poraque, selects the method dynamically withmode='ks'(Kohn-Sham) ormode='of'(orbital-free). - Plane-wave / real-space basis. Fields and orbitals live on a uniform
real-space grid whose discrete Fourier transform spans a plane-wave basis.
The kinetic operator is applied exactly in reciprocal space
(
½ |G + k|²); local potentials are applied diagonally in real space. The basis completeness is set by the grid density, controllable directly (grid_shape) or through a plane-wave cutoff (ecut). - Pseudopotentials. A modular
poraque.pseudopotentialspackage provides a transparent core–valence split, built-in analytic local pseudopotentials, and a reader for a small standard pseudopotential file format (pseudopotentials='auto'or a per-element mapping). - Periodic systems & k-points. Full periodic boundary conditions with
Brillouin-zone sampling via Monkhorst–Pack grids built on
ase.dft.kpoints(kpts=(n1, n2, n3)), folded by time-reversal symmetry. - Energies and forces reported in ASE units (eV, eV/Å), plus frozen-density embedding (FDE) drivers for subsystem calculations.
Installation
Poraquê targets Python ≥ 3.10. For development, clone the repository and install in editable mode:
git clone https://github.com/seixas-research/poraque.git
cd poraque
pip install -e .
This pulls in the runtime dependencies (NumPy, SciPy, ASE, pandas, matplotlib). Run the test suite with:
pytest
Quick start
The calculator is a drop-in ASE Calculator: attach it to an Atoms object and
ask for energies or forces.
1. Gas-phase molecule — an H₂ molecule (orbital-free DFT)
from ase import Atoms
from poraque.ase import Poraque
from poraque.core import SolverSettings
# H2 molecule in a non-periodic box (Ångström).
h2 = Atoms(
"H2",
positions=[[2.0, 2.5, 2.5], [3.0, 2.5, 2.5]],
cell=[5.0, 5.0, 5.0],
pbc=False,
)
h2.calc = Poraque(
mode="of", # orbital-free DFT
grid_shape=(24, 24, 24), # real-space / plane-wave grid
external_kwargs={"a": 0.8}, # softening of the nuclear potential
settings=SolverSettings(max_iter=80, mixing=0.1),
)
print(f"Total energy: {h2.get_potential_energy():.6f} eV")
print("Forces (eV/Å):")
print(h2.get_forces())
2. Bulk crystal — silicon with k-point sampling (Kohn-Sham DFT)
from ase.build import bulk
from poraque.ase import Poraque
from poraque.core import SolverSettings
# Diamond-structure silicon (2-atom primitive cell).
si = bulk("Si", "diamond", a=5.43)
si.calc = Poraque(
mode="ks", # Kohn-Sham DFT
grid_shape=(16, 16, 16),
kpts=(4, 4, 4), # Monkhorst-Pack Brillouin-zone sampling
pseudopotentials="auto", # 4 valence electrons per Si atom
settings=SolverSettings(max_iter=40, mixing=0.5, tolerance=1e-5),
)
print(f"Total energy: {si.get_potential_energy():.6f} eV")
print(f"Valence electrons: {si.calc.results['density'].integrate():.4f}")
More runnable scripts live in examples/.
Method selection at a glance
| Argument | Meaning |
|---|---|
mode |
'ks' (Kohn-Sham) or 'of' (orbital-free) |
grid_shape |
Real-space grid (Nx, Ny, Nz) |
ecut |
Plane-wave cutoff (Hartree); sizes the grid automatically |
kpts |
(n1, n2, n3) Monkhorst-Pack grid, or explicit fractional k-points |
pseudopotentials |
'auto', a {symbol: spec} mapping, or a LocalPseudopotential |
xc |
Exchange-correlation functional ('lda' by default, None to disable) |
charge |
Net charge of the system |
License
This is an open source code under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file poraque-26.6.1.tar.gz.
File metadata
- Download URL: poraque-26.6.1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
734e4c17645d7dfb75264b50fdbd5ad1cfc843f4dcc2e851847060cd9745ba5c
|
|
| MD5 |
c561f2a137f797449964e40f3f31183d
|
|
| BLAKE2b-256 |
49f1657c5f692be508e57f1d15b8d804e5d83beb04821d968e1ca40588fe478c
|
File details
Details for the file poraque-26.6.1-py3-none-any.whl.
File metadata
- Download URL: poraque-26.6.1-py3-none-any.whl
- Upload date:
- Size: 47.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c33818f41169952e94beebdb8e4b89d8f979b7f272f8de6c53bdaaf06b33aba
|
|
| MD5 |
c18f9b83bd11c14945fe0f751292135d
|
|
| BLAKE2b-256 |
834baac6ab60dd6a138ae0a6cc2fe1b2f2dba94adb38eca4800e6b78526414d2
|