Questions tagged [python]
Questions about or related to Matter Modeling with Python or Python's relationship to Matter Modeling.
172
questions
3
votes
2
answers
86
views
Dirac exchange energy and X_alpha LDA methods
I want to make a DFT code (by myself) that works in the RKS LDA H2 configuration. This post is a continuation of here.
Now by adding the Vosko, Wilk, Nusair correlation I have much better results :
...
4
votes
0
answers
48
views
Predict if a group will be acceptor/donor of H bonds
Context:
I am a student of cheminformatics, and I am trying to solve a problem in predicting whether atom can be an acceptor/donor of hydrogen bonds, using Python programming language and RDKit ...
5
votes
0
answers
79
views
What is wrong with my results for H2? I used RKS, LDA (only exchange) and SCF (Roothaan-hall) with STO-3G [closed]
This post is a follow-up from here. The code and the plots can be found in the same folder as the script I executed here.
Now I have implemented the Becke partitionning. And I have the following ...
4
votes
1
answer
62
views
Atomic Simulation Environment (ASE) Modelling. Adding additional layer
Beginners here, to ASE. I've create a 2x2x2 supercell of TiO2 from unit cell (.cif file obtained from LegacyMaterialsProject ) using ASE. The script code is attached as follows. The outcome is shown ...
2
votes
1
answer
80
views
Openmm setup MD with intitial positions
Trying to complete simulation.context.setPositions(molecule.positions) (molecule from sdf file)
The code below runs nicely (so can be used if you are beginner like ...
3
votes
2
answers
88
views
Becke partitioning : Computing integrals with Lebedev and Gauss-Chebyshev quadrature
Preface:
This question is a follow up post from a previous question on MMSE: Usual way of computing exchange-correlation potential on a simple case H2 (RHF, LDA).
The radial variable substitution and ...
4
votes
1
answer
112
views
How to compute the density of the spherical polymer using radius as a bin from the lammps trajectory?
I am working on condensate studies and I did form a globular condensate of the polymer system using lammps. I wanted to find out the number density of condensate with respect to the radius as bins to ...
3
votes
1
answer
52
views
Ionic relaxation with ASE (Atomic Simulation Environment)
I want to do an ionic relaxation of just the ions inside my unit cell (not the cell dimensions), with Quantum Espresso through ASE. However, I have only been able to find structure optimization ...
6
votes
3
answers
101
views
Cannot draw resonance structure (kekule forms) of a molecule in RDKit
I am having trouble getting the SMILES strings and drawings of the different resonance structutes of a molecule with RDKit. I found an old example online doing this but it doesn't seem to work with ...
3
votes
1
answer
59
views
Molecular integrals in spherical harmonics?
I have been trying to write a basic HF code that can compute the MOs and total energy of a molecule. I followed the following reference for overlap and kinetic integrals. During a conversation with a ...
4
votes
1
answer
73
views
How to build a unit cell in ASE?
As a basic example, I want to build a defect MgO unit cell within ASE. From VASP the input is simple:
...
3
votes
0
answers
63
views
OpenMM engine options in openpathsampling (OPS) python library
Context:
I'm new to OpenMM and transition path sampling (TPS). I tried to set up a two-state TPS with the openpathsampling python library using the flexible length ...
5
votes
1
answer
78
views
Valence correction by adding formal charge in RDKit
I am modeling molecules as graphs, with nodes as atom types and edges as bond types (single, double, triple). I do not model formal charges or hydrogens explicitly (only heavy atoms). When trying to ...
7
votes
2
answers
279
views
How to generate the SMILES for .cif files correctly and how do I generate .pkl or .pickle file out of these SMILES
I used openbabel to convert the .cif files to .smi. Here are parts of the .smi corresponding to two .cif files (I have many .cif files):
...
4
votes
1
answer
70
views
Pymatgen structure to rdkit molecule
Context
I am trying to convert a pymatgen bonded structure, such as one generated by CrystalNN to an rdkit molecule.
So I obtain the pymatgen bonded structure with ...
9
votes
1
answer
149
views
Usual way of computing exchange-correlation potential on a simple case H2 (RKS, LDA)
The python code is here.
I tried to do a DFT calculation for H2 Restricted Hartree-Fock with Local Density Approximation. The optimization is a scf-loop with Lagrange-multiplier only. I use the same ...
7
votes
1
answer
91
views
Start a CI calculation from HF/DFT chkfile in PySCF
I am trying to perform a CISD calculation in PySCF using the starting orbitals from an old DFT result.
The DFT result was saved on a chkfile, mf.hdf5. The code that ...
8
votes
1
answer
241
views
What is the best way to compute the DFT total energy and atomic forces for given atomic positions?
I am new to DFT calculation and I want to compute DFT total energy and atomic forces of an atomic configuration, given the atomic positions and lattice vectors.
I have an extended xyz with DFT energy ...
4
votes
1
answer
68
views
Which applications can convert multiple CIF files to multiple XYZ files all at once
I have tried a bunch of apps such as Mercury, OpenLabel but they cannot convert CIF files to XYZ files in bulk. I am also thinking of doing it in Python but just want to know if there's an app for ...
4
votes
1
answer
55
views
How to query 2D materials on materials project?
I would like to use the materials project API to search materials with some properties but to restrict my search only to two-dimensional materials.
How to do it?
Web-pages for materials contain the '...
3
votes
1
answer
53
views
Psi4 Takes too Long to Save Computation Results to Python Notebook
I was using psi4 to run vibrational frequency analysis with small molecules (in a jupyter notebook) and it works just fine with molecules like methanol and water but once I move up to ethanol or ...
10
votes
2
answers
151
views
How a beginner should start his studies in ML for chemistry application?
Background
I am a chemistry undergrad that wants to learn Machine Learning (ML) for application in my field(Chemistry). However, I have never studied programming or anything related to code in my life....
5
votes
1
answer
54
views
Undefined stereochemistry in rdkit from mol2
I am about to generate topology from a rdkit mol object with a conformer for a molecule in mol2 format, but receive the error this mol object has 'UndefinedStereochemistry'. As I am from computer ...
7
votes
1
answer
306
views
How to create a molecular graph from smiles representation
I am trying to create a molecular graph from SMILES representation of molecules on pytorch using rdkit. The following molecule of caffeine is to be modelled.
Here we see the molecule with bond lengths ...
6
votes
1
answer
181
views
Band Structure from EIGENVAL in VASP
So I am trying to plot the band structure from the EIGENVAL file produced by VASP. I wrote this Python code:
...
5
votes
1
answer
106
views
How to plot HOMO-LUMO diagram using python?
I'm trying to create a HOMO-LUMO diagram for a presentation, similar to the below figure from ResearchGate. I would like to learn how to do this with Python if possible, since I know this language (...
5
votes
1
answer
121
views
Reading DCD files using Python without using third party packages?
I am trying to read a Nanoscale Molecular Dynamics (NAMD), Dihedral Coordinates (DCD) file using Python. Following the code given at here to read DCD files using Fortran, I have written the following ...
1
vote
0
answers
36
views
ASE: Receiving error on implimenting ase cellpar_to_cell method
I am getting the following error while implementing ase cell method. I am not able to understand where is it going wrong, although I think it has to do something with the values I am getting for cell.
...
4
votes
0
answers
52
views
PySCF calcuation of 'one-index' electrostatic (Hartree) potential
I'm trying to calculate the electrostatic (Hartree) potential corresponding to a single (auxiliary) GTO:
$$v_i({\bf r_1}) = \int d{\bf r}_2~ \frac{\phi_i ({\bf r}_2)}{r_{12}}$$
[Please note that $\...
6
votes
3
answers
351
views
Using OpenBabel's gen3d in a Python notebook
I want to preface this by saying I am really new to computational chemistry and this kind of programming in general, but I am having real trouble figuring out how to use OpenBabel's ...
5
votes
1
answer
173
views
Constrained optimisation on a hypersphere
I am currently trying to implement a GS2 (Gonzalez-Schlegel second order) IRC algorithm in a python code. I am following the original paper ref(1).
The main problem is in the constrained optimisation ...
3
votes
1
answer
122
views
Layer detection in a crystal structure
Context
I have two images from a Monte Carlo Basin Hopping where silicon (in yellow) is getting replaced by germanium (in blue). Both have 32 germanium atoms at Si/Ge = 2.5; only the Ge distribution ...
5
votes
1
answer
132
views
How can I build the wheels necessary for a quick installation of PySCFad on a "compute node"?
The following is the procedure I have been following:
Install PySCFad
...
5
votes
1
answer
182
views
Which Python packages, APIs or online databases may be used for a Python script to find bond dissociation energy between two arbitrary atoms?
Let us say that I wish to create a function that may do the following:
>>> find_bond_energy(atom1="C", atom2="O", order=3)
1072 kJ/mol
...
5
votes
1
answer
127
views
Unexpected atoms while working with XYZ files in rdkit
I am processing some XYZ files using the rdkit library in python. I came across some strange/unexpected behaviour.
Consider a sample XYZ file of methanol with ...
5
votes
0
answers
123
views
Quantum ESPRESSO won't work in ASE
I am trying to use Quantum ESPRESSO in ASE, but I keep getting the following error. When I run pw.x directly from the terminal, it works, so Quantum ESPRESSO ...
7
votes
3
answers
2k
views
Running an ORCA calculation from Python
I'm a master's student and recently I started doing computational chemistry calculations using ORCA program.
This program works by command line and I saw that the majority of computational chemistry ...
7
votes
2
answers
209
views
Generate structure using atomic coordinates
I am trying to write a Python/C++ code that reads in a *.xyz file and varies the interatomic distances, angles etc. between distinct atoms in a molecule. In other words, a complete new structure with ...
4
votes
2
answers
539
views
Python script for Metropolis Monte Carlo (global optimisation)
I have written a python script to do global optimisation on interatomic potential (IP) using Metropolis Monte Carlo.
I have attached the part of the script which is the Metropolis MC part.
I have ...
5
votes
1
answer
70
views
How to calculate phase regions using CALPHAD for higher order systems (>3 elements)?
I primarily use Thermo-Calc so I will use that to describe my problem but I am interested to hear general CALPHAD insight as well.
Using Thermo-Calc I can quickly get an idea of the phase regions ...
3
votes
0
answers
62
views
Why is my CISD restart failing in PySCF?
A case that works
In my answer to Restarting an FCI calculation in PySCF, I provided a folder full of input and output files that demonstrates saving (as a numpy ...
3
votes
1
answer
99
views
Is PySCF able to print checkpoint files during a CISD calculation?
The problem
I've described how to restart a CISD calculation in my answer to the question: Restarting an FCI calculation in PySCF, but this requires all iterations of the CISD calculation to finish, ...
8
votes
2
answers
202
views
High school student that wants to do DFT calculations
I originally asked this on Physics.SE but was suggested to ask here instead.
I'm a high school student interested in material simulation. I want to do a project involving density functional theory to ...
4
votes
1
answer
82
views
Given cell edge lengths and dihedral angles, calculate lattice vectors?
I am given a list of edges: [a, b, c] and dihedral angles: [alpha, beta, gamma]. Can we determine the lattice vector directions of this unit cell?
e.g Edge lengths: ...
3
votes
1
answer
85
views
How to determine the lattice vector direction and magnitude in ASE
I am using the ASE library to compute the distance matrix with minimum image convention. In that, I have got the positions of all atoms in the cell.
Now I wish to calculate the distance between each ...
3
votes
1
answer
150
views
PyProcar band-structure plot error
I am getting the following error when trying to plot band-structure using PyProcar. I posted a comment in author's github page as well (see at the bottom). In the meantime, I wonder if anyone could ...
1
vote
1
answer
139
views
PySCF: How to do CCSD calculations from an FCIDUMP file in HDF5 format?
Recently my question: Why does CCSD work, but not CCSD(T), after reading an FCIDUMP in PySCF? lead to a bug fix that allows users to do CCSD(T) calculations from an FCIDUMP file in PySCF. That was ...
3
votes
1
answer
111
views
Error in running Python file using ASE library
I am trying to run a Python script using ASE library, I have installed ASE using this page and run my Python script using this library on my terminal. I have made a virtual env named 'MLC_env' and ...
2
votes
1
answer
128
views
Why does CCSD work, but not CCSD(T), after reading an FCIDUMP in PySCF?
CCSD(T) works after an RHF calculation:
Input:
...
7
votes
3
answers
968
views
Print chemical formula from list of atoms in Python?
Lets consider the following code which uses the Mole object:
...