Questions tagged [python]

For questions about materials modeling scripts written in the Python programming language. Questions should focus on interfacing with existing packages and aspects related to modeling, not general debugging.

Filter by
Sorted by
Tagged with
26
votes
3answers
2k views

How to "get my feet wet" in Density Functional Theory by simulating a water molecule using Python

I just saw I am a beginner in Density Functional Theory. What are some resources that could help me to learn the basics? and it reminded me that few years ago I'd asked How can I calculate the charge ...
20
votes
0answers
272 views

What are the tools available for point defects calculations?

As far as I know, there are mainly PyCDT, PyDEF, pylada and some part of pymatgen. As a new user to those tools, which one would be a good choice? It would be appreciated if you could explain one of ...
34
votes
13answers
2k views

What is a good programming language for matter modeling?

What is a good programming language for matter (e.g. molecular or materials) modeling? Since this is a broad field, I don't expect there to be only one answer.
12
votes
1answer
150 views

What is the best program to manipulate numerical DFT wavefunctions to calculate custom matrix elements?

For pedagogical reasons, I am looking for ways to calculate quantum-mechanical quantities such as $\langle m | \dot{m}\rangle, \langle m | \dot{n}\rangle, \langle m | \ddot{n}\rangle$ using ...
11
votes
1answer
131 views

How to get order constitution data for single equilibrium calculation in Thermo-Calc's TC Python module?

I know that it is possible to get order constitution data for phases when using Thermo-Calc's GUI (e.g. to get "BCC_B2 DISORD" instead of just "BCC_B2") for a single equilibrium ...
10
votes
2answers
754 views

RDkit: While converting a *.sdf file to fingerprint, I'm facing several errors

suppl = Chem.SDMolSupplier('1.sdf') for mol in suppl: if mol is None: continue # print(mol.GetNumAtoms()) fps = [Chem.RDKFingerprint(x) for x in supply] I am ...
27
votes
4answers
4k views

How to write my own density functional theory (DFT) code in Python?

I am a DFT user and at some point in the future, I would like to write my own DFT code in Python to help gain a deeper understanding of DFT. As mentioned in a previous answer people have written their ...
30
votes
2answers
691 views

How is Julia used in matter modeling?

What are the main uses and applications of Julia in matter modeling? Python for example is used in many codes, not to mention workflow automation and data processing. Are there any available codes or ...
12
votes
3answers
577 views

How to create a 3D band structure from DFT band structure calculation?

How can I create such a 3D plot using matplotlib? Like the one in Figure (a) below: I want to create it using DFT bandstructure calculation result
6
votes
0answers
95 views

How to calculate radial distribution functions for MD trajectories without PBC, directly from coordinates with python?

I have been running MD simulations on water droplets with an ion in them. I am trying to implement a python program that could calculate the radial distribution function from ion to oxygen (or ion to ...
10
votes
1answer
360 views

How should I generate a radial distribution function (RDF) for an MD trajectory with python?

I am attempting to analyse the radial distribution function (oxygen to oxygen) for a ~400ps simulation on a droplet of water (MD done with NAMD). I am using the python library MDAnalysis to do this. ...
6
votes
1answer
61 views

How to obtain electron charge density per unit volume about a water molecule using SlowQuant?

@Nike Dattani's answer to How to “get my feet wet” in Density Functional Theory by simulating a water molecule using Python recommends SlowQuant. I've used the install instructions for Linux on my ...
11
votes
1answer
164 views

How to use wavefunctions/density to determine which orbitals lead to edge states?

I have a large matrix for a 1D zigzag edge model of an otherwise $3\times 3$ tight-binding Hamiltonian (3 basis functions, each corresponding to an atomic orbital), involving the variable $k_x$. The ...
9
votes
1answer
105 views

Normalization condition in evaluating the radial distribution function for a hard-spheres system

I am trying to simulate a 3D hard-spheres in a box system in Python. The idea behind this is that I have to create a system in a 1x1x1 box with periodic boundary conditions and with $N = 500$ ...
8
votes
0answers
60 views

Bloch wave function extraction for the specific k-points and specific band from QE calculation [closed]

I would like to use QE to obtain u_K(r), which is the Bloch wave function of spin-up maximum valance band at K point. If I define the K point in the input file and do an SCF calculation by QE ...
4
votes
1answer
106 views

How to process electron-density data from a CHGCAR for better handling?

We all know that Vesta helps us visualize the electron clouds present in the CHGCAR data, but I am looking for a better way to process the electron-density data we get in a CHGCAR file for compact ...