Skip to main content

tb3: an open-source software package for accurate and efficient electronic structure calculations using tight-binding (TB), including three-body interactions. https://pages.nist.gov/ThreeBodyTB.jl

Project description

![alt text](https://github.com/usnistgov/tb3py/actions/workflows/main.yml/badge.svg) # TB3PY

by Kevin F. Garrity and Kamal Choudhary

This is a python wrapper for the [ThreeBodyTB.jl](http://github.com/usnistgov/ThreeBodyTB.jl) Julia package, which runs two- and three-body tight-binding calculations for materials.

Using the Julia version directly is the primary method for running the code. However, this code is created to help users who might be more familiar with python using the [PyJulia](https://github.com/JuliaPy/pyjulia) interface.

## Installation

First create a conda environment: Install miniconda environment from https://conda.io/miniconda.html Based on your system requirements, you’ll get a file something like ‘Miniconda3-latest-XYZ’.

Now,

` bash Miniconda3-latest-Linux-x86_64.sh (for linux) bash Miniconda3-latest-MacOSX-x86_64.sh (for Mac) ` Download 32/64 bit python 3.6 miniconda exe and install (for windows) Now, let’s make a conda environment, say “version”, choose other name as you like:: ` conda create --name my_tb3 python=3.8 source activate my_tb3 `

Now, let’s install the package: ` git clone https://github.com/usnistgov/tb3py.git cd tb3py python setup.py develop `

Note that this can take a while and may use significant disk space. The code will, if necessary, a) download & install Julia b) download & install ThreeBodyTB.jl, and c) create a system image for fast loading.

To check if the installation went well, please try:

` pytest tb3py/tests/test_ptop.py `

For main documentation of ThreeBodyTB.jl, see [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://pages.nist.gov/ThreeBodyTB.jl/) This code is only the wrapper that downloads and installs that code.

## Examples

  • Predict total energy, electronic bandgap and bandstructure for a system using POSCAR file:

    ` python tb3py/main.py --poscar_file tb3py/examples/POSCAR `

  • Predict total energy, electronic bandgap and bandstructure for a system using cif file:

    ` python tb3py/main.py --cif_file tb3py/examples/JVASP-1002.cif `

## Performance Tips

  • Julia can take advantage multiple threads. Try setting the environment variable below as appropriate for your machine.

    ` JULIA_NUM_THREADS=8 export JULIA_NUM_THREADS `

  • Note that despite using pre-compilation where possible, some functions will run faster the second time you run them due to the jit.

  • Note that you must delete the system image if you want to update the ThreeBodyTB.jl code and re-run the installation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tb3py-2021.7.10.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tb3py-2021.7.10-py2.py3-none-any.whl (6.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file tb3py-2021.7.10.tar.gz.

File metadata

  • Download URL: tb3py-2021.7.10.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for tb3py-2021.7.10.tar.gz
Algorithm Hash digest
SHA256 b1dac44a87c5ce49be52f58fe85330652b0ecef5c051c256025d35a673149607
MD5 aac6723f201a63e96e7fa80db78ddb9b
BLAKE2b-256 8699863c6728e4d012b593c8efddb49acac1eca3faf2a48764a5811cdc9f028a

See more details on using hashes here.

File details

Details for the file tb3py-2021.7.10-py2.py3-none-any.whl.

File metadata

  • Download URL: tb3py-2021.7.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for tb3py-2021.7.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d21e21f2499b7e94766d8ff1f92dd38368d44adbfc0e1cd4639eaac70200a893
MD5 114a4c77a08bd0317f4ed677b74312fd
BLAKE2b-256 7b188ff6ed6085c2f9aa5ca3f878c5cfc4e12f2bdb8aa36aecdd159009b1a398

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page