Skip to main content

Ninia

A small Python wrapper for setting up Quantum Espresso input files. More functionality may be added later.

Currently, there is only assumed support for hexagonal close packed (HCP) crystal structures. Support for other structures may be tested but should not be expected.

Note: The calc.create_bash() function (described later) assumes a Torque/PBS structure and sets up script to run in parallel using MPI. It also assumes an already built Quantum Espresso package and that pw.x can be run from the command-line.

For tips on how to install Quantum Espresso on an HPC cluster, go to Espresso Installation.


Behind the Name

Ninia - Coffee Snake

Ninia is a genus of snakes, also known as coffee snakes, that are native to parts of Central and South America. The choice of name is a play on Python and Quantum Espresso.


Example usage:

# Import necessary modules:
from ase.build import molecule, add_adsorbate, hcp0001
from ase.visualize import view

# Set up geometry using ASE:
surface = hcp0001('Ru', size=(4, 2, 4), a=2.7059, c=4.2815)
ad = molecule('NH2')
ad.rotate(180, 'x')
add_adsorbate(surface, ad, 2.0, 'hcp')

view(surface, viewer='x3d')  # Specific viewer for use in Jupyter

This will display a view of the geometry we have created. More information about ASE (Atomic Simulation Environment) can be found at their homepage: https://wiki.fysik.dtu.dk/ase/

Then you can start using ninia to convert this geometry into an input file:

from ninia import relax
calc = relax.Relax(prefix='Ru_test', functional='beef')
calc.set_directories(outputdir='/home/ajs0201/workQE/output',
                     pseudodir='/home/ajs0201/workQE/pseudo')
# Ninia assumes the current script directory as the input directory
# if none is given.
calc.load_geometry(surface)
calc.set_parameters(mixing_beta=0.15)

calc.create_input()
calc.create_job(hours=20)
# This will create both an input (.i) file and bash (.sh) for the geometry above

If you do not specify the prefix and functional during the initialization step, the program will give warnings. Additionally, the pseudopotential directory must be set before the calc.load_geometry() step.

In the calc.set_directories() step, you can set the following directories:

  • The directory to place input and bash files (inputdir)
  • The directory to place output files created by Quantum Espresso (outputdir)
  • The directory that contains pseudopotentials relevant to the calculation (pseudodir)

Note: The output directory, post calculation, will contain wave function files (.wfc) and save directories (.save/). This does not include output files (.out), which will be place in the input directory, unless explicitly changed.

In the calc.set_parameters() step, you can set the following parameters [default]:

  • Plane wave cutoff energy (ecutwfc) [30.0]
  • Plane wave cutoff density (ecutrho) [4*ecutwfc]
  • Convergence threshold (conv_thr) [1e-8]
  • Electron mixing beta (mixing_beta) [0.7]
  • Number of k-points (k_points) [[4, 4, 4, 0, 0, 0]]
  • Functional (functional) [beef]

In the calc.create_job() step, you can set the following parameters [default]:

  • Job type [pbs.sh] (other option slurm.sh)
  • Partition/queue [general]
  • Memory used by calculation in GB (memory) [50]
  • Number of CPUs used by calculation (cpus) [8]
  • Walltime allowed for execution in hours (hours) [30]

Release files for ninia 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ninia 0.1.5
File Size Uploaded
ninia-0.1.5.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ninia 0.1.5
File Interpreter ABI Platform
ninia-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / ninia-0.1.5.tar.gz

Download URL ninia-0.1.5.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9721f339dba9577aca0da233d1c96b2ef3d7e56748dda75239fabee97b73419a
BLAKE2b-256 checksum
How to use checksums
3f8a21830ce0ed239790219446a8d3c42420df463540fd46ffe8e24e4cd1a4d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / ninia-0.1.5-py3-none-any.whl

Download URL ninia-0.1.5-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cce6a98293b0cf2ca67089a6838cba1e477af1d13637df3a9803e1208164754f
BLAKE2b-256 checksum
How to use checksums
e453374062d8a79743a2b28d07afe94c5075870fd538d8b7102f8336fef8bdca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.94

2 release files

0.0.93

2 release files

0.0.92

2 release files

0.0.91

2 release files

0.0.90

2 release files

0.0.89

2 release files

0.0.88

2 release files

0.0.87

2 release files

0.0.85

2 release files

0.0.79

2 release files

0.0.78

2 release files

0.0.77

2 release files

0.0.76

2 release files

0.0.75

2 release files

0.0.74

2 release files

0.0.73

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page