Questions tagged [python]

Questions about or related to Matter Modeling with Python or Python's relationship to Matter Modeling.

Filter by
Sorted by
Tagged with
4 votes
0 answers
45 views
+50

Solvation_analysis subpackage for MDAnalysis multi-atom solute

I have a simulation trajectory from DFTB+ for 1 NaNO3 in 32 H2O molecules. The trajectory is in xyz format and I converted a frame of xyz to pdb using openbabel to serve as topology input. I am ...
bhopshang's user avatar
  • 233
2 votes
0 answers
22 views

Obtaining RDF from provided structure factor

I have a test structure factor dataset from water O-O pairs and I am trying to get the $g_{OO}(r)$. ...
mykd's user avatar
  • 2,282
2 votes
1 answer
42 views

Velocity autocorrelation function for molecular dynamics trajectory

I have a 1 ns long molecular dynamics trajectory of 884 molecules of water, and I am trying to compute the velocity autocorrelation function using MDAnalysis to analyze the GROMACS output files. I ...
horlust's user avatar
  • 51
2 votes
1 answer
34 views

How to resolve ModuleNotFoundError: No module named 'pymatgen.analysis.defects'?

Background My goal is to use PyCDT: Python Charged Defect Toolkit (paper, github, pypi). I installed the code by doing: pip3 install pycdt I am not using any ...
Abdul Muhaymin's user avatar
6 votes
1 answer
170 views

Speed of atom from kinetic energy of molecule

What is the velocity of each hydrogen atom in an H2 molecule, given a kinetic energy of hydrogen molecule is 0.12 eV, when expressed in angstroms per femtosecond and assuming equal velocities for both ...
Rubi Agrawal's user avatar
2 votes
1 answer
44 views

How to make initial trajectory for incident A2 molecule on any surface?

I want to write code to simulate the impingement of any molecule on a surface at different (r, theta, and phi) angles in XYZ format.
Rubi Agrawal's user avatar
3 votes
1 answer
88 views

How may I verify that my A matrix for TDA (Tamm-Dancoff Approximation of TD-DFT) from PySCF is correct?

This is a follow-up to a series of questions that I have asked here: Is a D-Wave quantum computer able to do TD-DFT calculations? (answer was "yes, but it might not be efficient") Inquiry ...
Hadeel Moustafa's user avatar
5 votes
1 answer
159 views

How to convert MoO3 bulk structure to MoO3 (010) plane surface via VESTA software?

Convert MoO3 bulk structure to MoO3 (010) plane surface via VESTA
Rubi Agrawal's user avatar
5 votes
1 answer
52 views

A matrix form used in the Quantum Annealer Eigensolver (QAE)

In the paper "Computing molecular excited states on a D‑Wave quantum annealer", PySCF is employed to compute the TDA matrix. Then a few of the lowest eigenvalues and eigenvectors of a TDA ...
Hadeel Moustafa's user avatar
5 votes
2 answers
72 views

ASE: How to plot the irreducible Brillouin zone and this bandpath from a bandpath object

I am using ASE (Atomic Simulation Environment) for theoretical chemistry and I see an option to plot the irreducible Brillouin zone and this bandpath but I can't figure out how. I'm not a programmer. ...
Samaray's user avatar
  • 61
4 votes
1 answer
198 views

Random velocity generation

How to generate random velocities in the geometry coordinates of a surface (POSCAR file) using the Boltzmann distribution law with Atomic Simulation Environment (ASE) or other codes for Molecular ...
Rubi Agrawal's user avatar
2 votes
1 answer
45 views

Non-Equivalent T-Sites from a cif file

I am trying to find symmetrically inequivalent T-atoms in a crystal structure (zeolite). Does anyone happen to know any package that can help with that? I see that pymatgen does have options for ...
Saha_1994's user avatar
  • 969
5 votes
1 answer
93 views

Plot MSD (mean square displacement) versus time for a polymer chain

Cross-posted on Computational Science SE. The following are the movements of the center of mass of a polymer chain over time in a monte carlo simulation. ...
user366312's user avatar
  • 2,392
3 votes
1 answer
114 views

Print full stress tensor in ASE to calculate Green Kubo viscosity

I would like to print out the off diagonal components of the full stress tensor in ASE. The goal is then to calculate the Green Kubo viscosity. One should use the ensemble average of the off diagonal ...
Marco Di Gennaro's user avatar
3 votes
0 answers
108 views

Read and run lammps water model in ASE

I want to read a lammps data file in ASE, for instance the TIP3P or the SPC model. The lammps examples provide the input script and the data file, which work perfectly. ASE is not able to read the <...
Marco Di Gennaro's user avatar
3 votes
0 answers
66 views

Using GPyTorch for GPR together with the SOAP-Kernel

My goal is to use a Gaussian Process Regression (GPR) model with the GPyTorch library with the SOAP (smooth overlap of atomic positions) descriptor that can be obtained with the DScribe library. I ...
C_Swann22's user avatar
  • 573
4 votes
1 answer
121 views

What is the best way to save a psi4 molecule object in Python?

what is the best way to save and load a psi4 molecule? I tried pickle/dill but they both failed. I see a feature to save as xyz, but I'm not seeing a function to load as xyz and I'm not sure if save ...
Frank's user avatar
  • 195
5 votes
1 answer
137 views

Evaluating analytic gradients for overlap integrals

I have been working on a toy HF code for some time. From this reference I am trying to work out an analytic expression for the first derivatives of overlap integrals. The original expression for ...
Hemanth Haridas's user avatar
8 votes
0 answers
103 views

How does the line search in geometry optimisations work?

I am trying to write a Newton-Raphson geometry optimisation script in python (Current version of my code) using the energy, gradient and Hessian from Gaussian 16. In order to reach a minimum, I would ...
evd's user avatar
  • 81
5 votes
1 answer
148 views

Contents of a CHGCAR file and how to read it appropriately in Python? [duplicate]

Rephrasing the above, what is the content of the data in the CHGCAR file? Is the data part shown below representative of the electron-charge density or is it the actual charge in the system and I have ...
Pranoy Ray's user avatar
  • 1,611
4 votes
1 answer
85 views

How to get displacements along VASP NEB trajectory?

I am performing an NEB calculation with VASP and VTST. I would like to visualize the atoms along the path and to calculate their displacements. When I have a single relaxation's XDATCAR, I can unwrap ...
kpoint's user avatar
  • 139
3 votes
1 answer
131 views

Verifying periodicity of crystalline orbital modulus in PySCF

I'm trying to verify that the modulus of the crystalline atomic/molecular orbitals computed by PySCF satisfy the correct periodicity condition for the supercell. I'm considering a hydrogen chain ...
phonon's user avatar
  • 61
4 votes
0 answers
68 views

Issue with py4vasp and Jupyter Lab Integration on Windows 10?

I am currently working on a project involving py4vasp for crystal structure analysis. I have successfully installed py4vasp, Jupyter Lab, and Jupyter Notebook in a Conda environment. When I attempt to ...
Trivaani Yadav's user avatar
10 votes
3 answers
612 views

Tool to extract rings from zeolite structures

I am trying to reproduce the work done in this paper https://doi.org/10.1021/acscatal.7b00588. In this direction, I have been successful in optimizing the unit cells of the zeolites. For further steps,...
ansonthms's user avatar
  • 921
3 votes
1 answer
143 views

Transform Supercell to Unitcell

I’ve supercells of around 10,000 Metal–organic frameworks (MOF) structures in CIF format. I’m looking to convert them to unit cells. But I’m not able to find packages (or any other libraries like ...
hari's user avatar
  • 83
3 votes
1 answer
124 views

Python code for combining two surfaces to form an interface

I have two surfaces named POSCAR1 and POSCAR2. I want to stack the surface of POSCAR2 on POSCAR1 to form an interface and also to match their lattice constants. I tried a solution here by adding it ...
Nana Kofi Boakye's user avatar
2 votes
0 answers
181 views

How to fit Smooth Overlap of Atomic Positions (SOAP) into Kernel Ridge Regression (KRR)?

I have a dataset of 64 chemical structures and their calculated energies, which I want to predict using machine learning. I need to use SOAP as a descriptor so that each structure would be an ...
jessss's user avatar
  • 21
6 votes
1 answer
321 views

Persistent errors in single equilibrium calculations (Thermo-Calc)

When running single point equilibrium calculations on an array of compositions I come across some compositions (for specific examples see below) that return the error ...
sgp45's user avatar
  • 602
6 votes
1 answer
93 views

How to address 'saveGraphic: Method not found' error in automating the generation of figures in avogadro using Python?

My question is a follow-up question to this question posted by Hemanth Haridas. I ran the example .py script in Geoff Hutchison's answer for the above mentioned question to generate .png files from ....
Aimun Jawed's user avatar
4 votes
2 answers
109 views

How to Create a 2D Structure of Boron (Brophene) using ASE?

Unlike Graphene and MoS2, For borophene, I didn't find any inbuilt function in ASE. I have tried to make it, but i failed. So If anyone could help me, it will be great help. Since brophene has ...
Akshit Dhillon's user avatar
6 votes
2 answers
115 views

Is there any Python library for returning the atoms of a periodic material within a cube?

Is there any Python package that allows to cut defined by the points (0, 0, 0) and (x, y, z)? That is, it should return all the atoms of the unit cell and periodic images inside the shaded region. (...
ado sar's user avatar
  • 211
3 votes
1 answer
137 views

How to change color of bands in PyProcar?

I am using Pyprocar to plot my band structure. However I cannot change color even modified the 'color' parameter. I tried to change color of their examples referred to Fe band structure but did not ...
Tieyuan Bian's user avatar
5 votes
1 answer
334 views

Python library to obtain atomic orbitals of atoms in the lowest energy state

I want to code an UHF code. Hence for each atom I need the lowest energy electronic configuration. Is there a python package/library that already does it?
mle's user avatar
  • 989
3 votes
1 answer
513 views

How to find the smallest distance between 2 residues in Pymol?

I am very new to Pymol and was trying to figure out how I can find the largest distance between 2 residues. Using just the basic distance function I get multiple distances which is not very useful in ...
Faheem Azeemi's user avatar
3 votes
1 answer
121 views

How to generate the remaining sites in a cubic lattice from a given POSCAR/cif in Python?

For example, I intend to generate the remaining sites of the Cr cubic lattice but the POSCAR file provides limited info on the number of atoms present as shown below. Is there a way to implement this ...
Pranoy Ray's user avatar
  • 1,611
6 votes
1 answer
233 views

Why am I getting "AttributeError" when running this Python function?

I installed chemcoord (link to documentation) on MacOS in a fresh Python 3.7 virtual environment. When I tried to run the first line of code from the tutorial: <...
John's user avatar
  • 268
4 votes
1 answer
195 views

Smooth overlap of atomic positions (SOAP) output for Gaussian Process regression in sklearn

I want to use the smooth overlap of atomic positions (SOAP) as a descriptor to represent the atomic environment of a specific atom to predict chemical shifts. I have generated averaged SOAPs for ...
C_Swann22's user avatar
  • 573
4 votes
2 answers
185 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 : ...
mle's user avatar
  • 989
4 votes
0 answers
84 views

Predict if a group will be acceptor/donor of H bonds [closed]

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 ...
Gianmarco Luchetti 's user avatar
5 votes
1 answer
679 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 ...
ASA's user avatar
  • 53
2 votes
1 answer
473 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 ...
WibblyWobbly's user avatar
3 votes
2 answers
276 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 ...
mle's user avatar
  • 989
4 votes
1 answer
199 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 ...
kesavan's user avatar
  • 43
4 votes
2 answers
294 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 ...
Wychh's user avatar
  • 2,147
6 votes
3 answers
310 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 ...
Njw96's user avatar
  • 191
3 votes
1 answer
87 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 ...
Hemanth Haridas's user avatar
4 votes
1 answer
528 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: ...
Wychh's user avatar
  • 2,147
3 votes
0 answers
83 views

OpenMM engine options in openpathsampling (OPS) python library [closed]

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 ...
Kui's user avatar
  • 31
5 votes
1 answer
652 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 ...
Njw96's user avatar
  • 191
7 votes
2 answers
707 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): ...
Rose Vanilla's user avatar

1
2 3 4 5