Skip to main content

xespresso

Unit test

Quantum ESPRESSO Calculator for Atomic Simulation Environment (ASE).

For the introduction of ASE , please visit https://wiki.fysik.dtu.dk/ase/index.html

Features

  • Support all QE packages, including: pw, band, neb, dos, projwfc, pp ...
  • Spin-polarized calculation
  • LD(S)A+U
  • Automatic submit job
  • Automatic check a new calculation required or not
  • Automatic set up "nscf" calculation
  • Read and plot dos, pdos and layer resolved pdos
  • Plot NEB

Author

Dependencies

  • Python
  • ASE
  • numpy
  • scipy
  • matplotlib

Installation using pip

pip install --upgrade --user xespresso

Installation from source

You can get the source using git:

git clone --depth 1 https://github.com/superstar54/xespresso.git

Add xespresso to your PYTHONPATH. On windows, you can edit the system environment variables.

export PYTHONPATH="/path/to/xespresso":$PYTHONPATH
export ASE_ESPRESSO_COMMAND="/path/to/PACKAGE.x  PARALLEL  -in  PREFIX.PACKAGEi  >  PREFIX.PACKAGEo"
export ESPRESSO_PSEUDO="/path/to/pseudo"

Examples

Automatic submit job

A example of setting parameters for the queue. See example/queue.py

queue = {'nodes': 4,
         'ntasks-per-node': 20,
         'partition': 'all',
         'time': '23:10:00'}
calc = Espresso(queue = queue)

Automatic check a new calculation required or not

Before the calculation, it will first check the working directory. If the same geometry and parameters are used, try to check whether the results are available or not. Automatic check input parameters with Quantum Espresso document.

calc = Espresso(label = 'scf/fe')

Show debug information.

calc = Espresso(debug = True)

Add new species

Some atoms are special:

  • atoms with different starting_magnetization
  • atoms with different U values
  • atoms with special basis set

For example, Fe with spin state AFM. See example/spin.py

atoms.new_array('species', np.array(atoms.get_chemical_symbols(), dtype = 'U20'))
atoms.arrays['species'][1] = 'Fe1'

Setting parameters with "(i), i=1,ntyp"

Hubbard, starting_magnetization, starting_charge and so on. See example/dft+u.py

input_ntyp = {
'starting_magnetization': {'Fe1': 1.0, 'Fe2': -1.0},
'Hubbard_U': {'Fe1': 3.0, 'Fe2': 3.0},
}
input_data['input_ntyp'] = input_ntyp,

Setting parameters for "Hubbard_V(na,nb,k)"

Hubbard, starting_magnetization, starting_charge and so on. See example/dft+u.py

input_data = {
'hubbard_v': {'(1,1,1)': 4.0, '(3,3,1)': 1.0},
}

Control parallelization levels

To control the number of processors in each group: -ni, -nk, -nb, -nt, -nd) are used.

calc = Espresso(pseudopotentials = pseudopotentials,
                 package = 'pw',
                 parallel = '-nk 2 -nt 4 -nd 144',  # parallel parameters
                 }

Non self-consistent calculation

A example of nscf calculation following the above one.

# start nscf calculation
from xespresso.post.nscf import EspressoNscf
nscf = EspressoNscf(calc.directory, prefix = calc.prefix,
                occupations = 'tetrahedra',
                kpts = (2, 2, 2),
                debug = True,
                )
nscf.run()

Calculate dos and pdos

A example of calculating and plotting the pdos from the nscf calculation.

from xespresso.post.dos import EspressoDos
# dos
dos = EspressoDos(parent_directory = 'calculations/scf/co',
            prefix = calc.prefix,
            Emin = fe - 30, Emax = fe + 30, DeltaE = 0.01)
dos.run()
# pdos
from xespresso.post.projwfc import EspressoProjwfc
projwfc = EspressoProjwfc(parent_directory = 'calculations/scf/co',
            prefix = 'co',
            DeltaE = 0.01)
projwfc.run()

Calculate work function

from xespresso.post.pp import EspressoPp
pp = EspressoPp(calc.directory, prefix = calc.prefix,
                plot_num = 11,
                fileout = 'potential.cube',
                iflag = 3,
                output_format=6,
                debug = True,
                )
pp.get_work_function()

Restart from previous calculation

calc.read_results()
atoms = calc.results['atoms']
calc.run(atoms = atoms, restart = 1)

NEB calculation

See example/neb.py

from xespresso.neb import NEBEspresso
calc = NEBEspresso(
                 package = 'neb',
                 images = images,
                 climbing_images = [5],
                 path_data = path_data
                 )
calc.calculate()
calc.read_results()
calc.plot()

Workflow

Oxygen evolution reaction (OER) calculation

The workflow includes four modules:

  • OER_bulk
  • OER_pourbaix
  • OER_surface
  • OER_site

The workflow can handle:

  • Generate surface slab model from bulk structure
  • Determine the surface adsorption site
  • Determine the surface coverage(, O, OH*), Pourbaix diagram
  • Calculate the Zero-point energy
oer = OER_site(slab,
               label = 'oer/Pt-001-ontop',
               site_type = 'ontop',
               site = -1,
               height=2.0,
	           calculator = parameters,
               molecule_energies = molecule_energies,
               )
oer.run()

To do lists:

  • add qPointsSpecs and Line-of-input for phonon input file

Metadata

Release files for xespresso 1.5.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 xespresso 1.5.5
File Size Uploaded
xespresso-1.5.5.tar.gz 76.3 kB Details

Built distribution (wheel)

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

Total release size: 161.6 kB

Release files / xespresso-1.5.5.tar.gz

Download URL xespresso-1.5.5.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
52e4ab2585b7226dfa15b5d76fc88da2f84f799f6cc9a7d9b35b70a25003cd9b
BLAKE2b-256 checksum
How to use checksums
8d6cade7507f966d532b024d198e9b9f1f49246709465f179b53129dc36e2141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.13.0 pkginfo/1.6.1 requests/2.31.0 requests-toolbelt/0.10.1 tqdm/4.51.0 CPython/3.8.5

Release files / xespresso-1.5.5-py3-none-any.whl

Download URL xespresso-1.5.5-py3-none-any.whl
Size 85.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574ab09e67f739499cb88a76155ebdf457c2c26b6ca69207d28d4a60351f0b61
BLAKE2b-256 checksum
How to use checksums
7640b290d78529877952b514f383d3f761ff7dbfa780eb206107fadac94dd9e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.13.0 pkginfo/1.6.1 requests/2.31.0 requests-toolbelt/0.10.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.5.5 This release

2 release files

1.5.4

2 release files

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.3.5

1 release file

1.2.5

1 release file

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

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