Skip to main content

The dpdata plugin for QDPi.

Project description

dpdata_qdpi

dpdata plugin for QDπ.

Features

  • qdpi driver

Installation

If you have installed DeePMD-kit,

pip install dpdata_qdpi

Otherwise, add gpu or cpu to install DeePMD-kit:

pip install dpdata_qdpi[gpu]
# or for the CPU version of TensorFlow
pip install dpdata_qdpi[cpu]

At this time, you need to install either AMBERTools SQM (sqm) or DFTB+ (dftb+).

conda install ambertools -c conda-forge
# OR
conda install dftbplus dftbplus-python -c conda-forge

Usage

Download the QDπ model from RutgersLBSR/qdpi.

from dpdata_qdpi import QDPiDriver

qdpi = QDPiDriver(
    model="qdpi-1.0.pb",
    charge=0,
    backend="sqm",
)

backend can be either sqm, dftb+, or dftb+api.

Assume you have an XYZ file ch4.xyz

5

C          0.92334        0.06202        0.01660
H          2.01554        0.06202        0.01660
H          0.55927        1.09164        0.03247
H          0.55927       -0.46653        0.90033
H          0.55927       -0.43903       -0.88301

Load the structure:

from dpdata import System

ch4 = System("ch4.xyz")

Perform single point calculation using the QDπ model:

p = ch4.predict(driver=qdpi)
print("Energies:", p["energies"][0])
print("Forces:", p["forces"][0])
Energies: -1102.0472189112793
Forces: [[-4.92853860e-05  3.71129259e-04 -1.00154387e-04]
 [ 2.07637527e-02 -1.98691092e-06 -7.85158242e-07]
 [-6.81949398e-03  1.93688568e-02  3.32209598e-04]
 [-6.96972976e-03 -1.01335356e-02  1.69318148e-02]
 [-6.92524354e-03 -9.60446352e-03 -1.71630849e-02]]

Or do an optimization:

from dpdata.plugins.ase import ASEMinimizer

lbfgs = ASEMinimizer(
    driver=qdpi,
)
p = ch4.minimize(minimizer=lbfgs)
print("Coordinates:", p["coords"][0])
print("Energies:", p["energies"][0])
print("Forces:", p["forces"][0])
Coordinates: [[ 0.92333966  0.06202338  0.01659862]
 [ 2.0161223   0.06202041  0.0165999 ]
 [ 0.55907714  1.0921887   0.03247964]
 [ 0.559075   -0.46681303  0.9008036 ]
 [ 0.5590758  -0.43929946 -0.88349175]]
Energies: -1102.0472
Forces: [[-1.0836746e-04  9.8321143e-05 -2.5905898e-05]
 [ 6.7257555e-05  8.3519126e-06 -2.5666191e-06]
 [ 4.4526685e-05 -5.3852447e-05  1.7676884e-05]
 [-9.4877823e-06 -1.9283394e-05  2.8249622e-05]
 [ 6.0710017e-06 -3.3537217e-05 -1.7453991e-05]]

Read dpdata's documentation for more usage of dpdata.

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

dpdata_qdpi-0.0.2.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

dpdata_qdpi-0.0.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file dpdata_qdpi-0.0.2.tar.gz.

File metadata

  • Download URL: dpdata_qdpi-0.0.2.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dpdata_qdpi-0.0.2.tar.gz
Algorithm Hash digest
SHA256 41e98e117af5e31fb558d09f2eb54aaab8dfce7f17bf6b5964419c3a11f530ab
MD5 8cbf280291c087d3894d764f6a3307f1
BLAKE2b-256 fd63e24ffa150be15bfbeaeca22d1dbcfd91f354d196401a956f97ae7b9a7ac1

See more details on using hashes here.

File details

Details for the file dpdata_qdpi-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dpdata_qdpi-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for dpdata_qdpi-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee448939d27a5fe7dcc1781fc00e48073d38cbbc6042661058504678545515dc
MD5 0cba556125320fd4ee4695a74c1a0b46
BLAKE2b-256 cb36d5944c5199304f18349957c311c6d2cc3779a36586fcb64c028aa3e0eba1

See more details on using hashes here.

Supported by

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