Skip to main content

A package for density potential functional theory

Project description

PyDPFT demo

A package for Density Potential Functional Theory introduced by Julian Schwinger and Berge Englert.

A project developed by Ding Ruiqi from National University of Singapore Physics Department for his bachelor thesis

Author: Ding Ruiqi

Date: 6 April 2020

Thesis: https://tesla-cat.github.io/about/Bachelor-Thesis.pdf

Presentation: https://github.com/tesla-cat/PyDPFT/Thesis/PPT

PyPI: https://pypi.org/project/PyDPFT/

Github: https://github.com/tesla-cat/PyDPFT

Run this notebook in Google Colab: https://colab.research.google.com/drive/1bC64gVM2WMk85MH2clTqDnBbaLhLCwTr

Highlights:

  • multi-GPU acceleration
  • optimized using Tensor operation (instead of for-loop)
  • implemented from 1D to 3D with auto detection

import

!pip install PyDPFT
from PyDPFT import PyDPFT
from PyDPFT.plot import plot
Collecting PyDPFT
  Downloading https://files.pythonhosted.org/packages/b9/f4/c9989112b6c1beafbd7c592ebe07864dcae9d8d93f5878af1207187d3331/PyDPFT-0.0.7-py3-none-any.whl
Installing collected packages: PyDPFT
Successfully installed PyDPFT-0.0.7

1D Hartree interaction

config = {
    'space':{'x':[-5,5,100]},
    'loop':{'Imax':1000,'precision':1e-6,'mix':0.05},
    'const':{'epsilon':1e-3},
    'rho':{'N':32},
    'Vint':{'name':'Hartree','coef':1},
}

dpft = PyDPFT(config)
Vext = 1e3*dpft.x ** 2
Vx,Vint,rho,N = dpft(Vext)
plot(dpft,Vx,Vint,rho)
PyDPFT: Written by Ding Ruiqi from NUS for his bachelor thesis
PyDPFT: Detected dim = 1
PyDPFT: Using 1 GPUs !
PyDPFT: Starting the self consistent loop
PyDPFT: Converged after 223 iterations in 2.0902912616729736 seconds!

png

2D Dipole-dipole interaction in momentum (p) space

config = {
    'space':{'x':[-5,5,50],'y':[-5,5,50]},
    'loop':{'Imax':1000,'precision':1e-6,'mix':0.05},
    'const':{'epsilon':1e-2,'mu':[0.7, 0.7]},
    'rho':{'N':32},
    'Vint':{'name':'Dipole-p','coef':.1},
}

dpft = PyDPFT(config)
Vext = dpft.xx**2 + dpft.yy**2
Vx,Vint,rho,N = dpft(Vext)
plot(dpft,Vx,Vint,rho)
PyDPFT: Written by Ding Ruiqi from NUS for his bachelor thesis
PyDPFT: Detected dim = 2
PyDPFT: Using 1 GPUs !
PyDPFT: Starting the self consistent loop
PyDPFT: Converged after 219 iterations in 11.653722524642944 seconds!

png

3D Dipole-dipole interaction in position (x) space

config = {
    'space':{'x':[-5,5,20],'y':[-5,5,20],'z':[-5,5,20]},
    'loop':{'Imax':1000,'precision':1e-6,'mix':0.05},
    'const':{'epsilon':1e-2,'mu':[0.7, 0.7, 0]},
    'rho':{'N':32},
    'Vint':{'name':'Dipole-x','coef':5},
}

dpft = PyDPFT(config)
Vext = dpft.xx**2 + dpft.yy**2 + dpft.zz**2
Vx,Vint,rho,N = dpft(Vext)
plot(dpft,Vx,Vint,rho)
PyDPFT: Written by Ding Ruiqi from NUS for his bachelor thesis
PyDPFT: Detected dim = 3
PyDPFT: Using 1 GPUs !
PyDPFT: Starting the self consistent loop
PyDPFT: Converged after 142 iterations in 4.736774921417236 seconds!

png

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

PyDPFT-1.0.6.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

PyDPFT-1.0.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file PyDPFT-1.0.6.tar.gz.

File metadata

  • Download URL: PyDPFT-1.0.6.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for PyDPFT-1.0.6.tar.gz
Algorithm Hash digest
SHA256 208575e60e91bf7569793547e6c3efba78dce247aa5af1116620f79ab0236e46
MD5 7cae58ab98f0df2d2e1e8207c601958c
BLAKE2b-256 ca05f45397df61820af7eaebb8ce5cf86cd9e0f91e24c0d8e36b4c207552f681

See more details on using hashes here.

File details

Details for the file PyDPFT-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: PyDPFT-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for PyDPFT-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 28f63e5c97e1a12b1c8cdd2cb16fc1dc383b3e85d960315f87d81b3f9468f3ce
MD5 665c47323c115f9b4d24372227833bdd
BLAKE2b-256 b7852ca703be82a915b7431b38aca23b482322d76fb2a17a18716e57cec0815a

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