EPWpy.Abinit.EPWpy_Abinit#

Functions

QE2Abi(QE_class)

Classes

PyAbinit(QE[, type_input, system, code, env])

High-level interface to the ABINIT simulation package.

class EPWpy.Abinit.EPWpy_Abinit.PyAbinit(QE, type_input=None, system='si', code='.', env='mpirun')[source]#

Bases: SetDir, SetAbinit

High-level interface to the ABINIT simulation package.

The PyAbinit class provides automated setup, input generation, and file transfer utilities for ABINIT calculations, with optional interoperability with Quantum ESPRESSO (QE) workflows.

It inherits from: - SetDir → manages directory creation and organization - SetAbinit → provides parameter defaults and methods to define ABINIT input files

The class can be initialized with a PyQE object to enable transfer of structural and pseudopotential data between QE and ABINIT runs.

system#

Name of the material or system (used for directory naming).

Type:

str

code#

Path to the ABINIT executable or script directory (default: current directory).

Type:

str

home#

Current working directory when initialized.

Type:

str

env#

Parallel execution environment command (e.g., "mpirun", "srun").

Type:

str

QE#

A PyQE instance providing data and pseudopotentials for ABINIT preparation.

Type:

PyQE

verbosity#

Controls the verbosity of logging (default: 1).

Type:

int

abinit_params#

Dictionary storing input parameters for ABINIT.

Type:

dict

transfer_file#

List of files to be copied or linked to the ABINIT run directory.

Type:

list

run_serial#

If True, runs ABINIT calculations in serial mode.

Type:

bool

abi(input_abi=None, name='abi')[source]#

Prepare and write an ABINIT input file.

This method serves as the main interface for constructing ABINIT input files. It takes a dictionary of ABINIT keywords and parameters, initializes the working environment, and writes the formatted input file to disk.

Parameters:
  • input_abi (dict, optional) --

    Dictionary containing ABINIT input keywords and values. Each key should correspond to a valid ABINIT variable. Example:

    {"ecut": 50, "ngkpt": [6,6,6], "nstep": 100}

  • name (str, optional) -- Name of the ABINIT input file to write (default: "abi").

Notes

  • ABINIT supports multi-step workflows in a single input file, so care must be taken when defining input_abi to avoid conflicts between different calculation stages.

  • The function internally calls:
    1. set_work() → sets the current working directory.

    2. set_abi() → updates ABINIT parameters.

    3. WriteAbinitFiles() → handles file generation.

    4. set_home() → restores the base working directory.

Example

>>> from epwpy import PyAbinit
>>> ab = PyAbinit(qe, {"ecut": 40, "ngkpt": [6,6,6]}, system="si")
>>> ab.abi({"ecut": 50, "nstep": 50}, name="scf")
# Generates 'scf.in' for ABINIT
get_pseudo(type_input)[source]#

Gets the pseudos for abinit

prepare(procs=1, type_run='abinit', name=None, infile=None, transfer_file=None)[source]#

This function prepares Abinit files

run(procs, type_run='abinit', infile=None, name=None, parallelization=None, flow_parallelization=None, flavor='cplx')[source]#
EPWpy.Abinit.EPWpy_Abinit.QE2Abi(QE_class)[source]#