Hot answers tagged

15 votes
Accepted

How can I use a GUI on a supercomputer?

I prefer to just download the data from the remote disks and then do the plots on my own local machine, which has all of my favorite tools for post-processing my data. I understand that this can be ...
user avatar
  • 28.8k
14 votes

How to start a Machine Learning project for chemical properties prediction?

Admittedly, there are tons of materials on the chemistry + machine learning topics. Let me give one: An introductory text I find useful is Machine Learning in Chemistry from Janet and Kulik in ACS in ...
user avatar
  • 1,648
13 votes

How can I use a GUI on a supercomputer?

It would probably be easier to use some software such as WinSCP. It allows you to select the location on your remote system and synchronise with the local system by matching either the time stamp or ...
user avatar
  • 2,516
10 votes

Is there a way to do array broadcasting faster, or without using loops?

What you're trying to do can actually be done very quickly, without any loops, and can even be ported to make valuable use of a GPU. Here's a quick example that you can test yourself in octave-online: ...
user avatar
  • 28.8k
10 votes

Is there a way to do array broadcasting faster, or without using loops?

Assuming that your sample code is really what you are looking for (which I doubt judging by the full code example you had posted originally), the answer by @vtan707 would work, but is very awkward ...
user avatar
  • 556
7 votes

Is there a way to do array broadcasting faster, or without using loops?

Just adding some timings for @Antimon's answer. Using numpy.outer is definitely the way to go IMO. ...
user avatar
  • 171
7 votes

Is there a way to do array broadcasting faster, or without using loops?

You can use dot multiplication to achieve this: ...
user avatar
  • 28.8k
7 votes

How to make a python code that can read a .xyz file and find the distance between atoms?

Maybe this comes a bit late. There are some tools which can do this. But I was also interested in doing such a calculation using python. I first started with an iterative process which was terribly ...
user avatar
  • 71
7 votes

Numerically integrating the Hartree potential

Based on your clarifications starting here, I see that you are starting with the simple case in which $n(r^\prime) = 1$. In this case we have the integral: $$\tag{1} \int \frac{1}{|r-r^\prime|}\textrm{...
user avatar
  • 28.8k
7 votes
Accepted

How to read QE's wfc*.dat files with python

With python, you can open a binary file using the 'rb' option in your open statement. Then using ...
user avatar
  • 86
6 votes

How to input 3D coordinates from xyz file and connectivity from SMILES in rdkit?

Your best bet is to keep the molecule (e.g., as a .mol or .sdf file) around and then simply update the coordinates from the <...
user avatar
6 votes
Accepted

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

I know this was long ago, but for those that find the same problem in the future, the sisl python package might be useful. It has a generic ...
user avatar
6 votes
Accepted

How is the atom selection going wrong when creating the collective variable?

I can't tell why you're getting that specific difference, but most likely it's related to the fact that the CV is using global variables. It's possible that something changed in those globals. OPS CVs ...
user avatar
  • 1,887
6 votes

Is there a more efficient hard sphere packing algorithm?

Using the Lubachevsky-Stillinger algorithm is the best choice. You get up to 64% space filling for a random monodisperse sphere packing. Another classical study is the algorithm by Jodrey and Tory (...
user avatar
  • 161
6 votes
Accepted

How to solve this Phonopy-related problem?

This is basic bash-script which will be quite useful, just start with scratch ...
user avatar
  • 3,239
6 votes
Accepted

Convert SMILES format to Amino Acid masses using RDKit - Cyclopeptides

I'm not sure if it's improper to answer my own question, but I think I've cracked it. For each peptide bond match identified by GetSubstructMatches the index [1] is ...
user avatar
  • 111
5 votes

How can I use a GUI on a supercomputer?

To address your specific question: No, you don't always have to download everything locally. VASP creates a lot of different output files and sometimes (most of the times?) you only need some of those....
user avatar
  • 373
5 votes

Node features matrix with Networkx

You can get a list of lists of the node features like this: g = mol_to_nx(Chem.MolFromSmiles('CCC')) [list(g.nodes[n].values()) for n in range(g.number_of_nodes())] ...
user avatar
  • 733
5 votes

How to make a python code that can read a .xyz file and find the distance between atoms?

...
user avatar
5 votes

How to plot a Gaussian cube file with python/matplotlib?

The Python package mayavi uses VTK for 3D visualization and offers thus several poptions for plotting volumetric data. ase has an interface to mayavi and facilitates IO of electronic structure grid ...
user avatar
  • 316
5 votes

How to edit the first line of XYZ file?

You could do this by just modifying the first line of the file. But here are some more general purpose utilities you could use (note it requires the re module) <...
user avatar
  • 7,784
5 votes

How to transform fractional coordinates into cartesian?

If I understand correctly your question, you have the fractional coordinates of the atoms in the unit cell, and (I'm assuming) that you also have the unitcell (or supercell) vectors. In this case the ...
user avatar
  • 513
4 votes

How to input 3D coordinates from xyz file and connectivity from SMILES in rdkit?

The representation of a molecular structure as SMILES string is a (very) reduced one, often with only implicit hydrogen atoms. Recreating a 3D molecular structure with either OpenBabel or RDKit not ...
user avatar
  • 1,459
4 votes

How to find Young's Modulus using stress strain curve using Python?

Unfortunately, due to my reputation, I cannot comment yet. However, to the surprise of Tyberius, I would like to note that the function young_modulus does not return the Young's modulus, but the ...
user avatar
  • 51
4 votes
Accepted

BoltzTraP script works with which python version?

To summarize the discussion from the comments/chat, the errors you are seeing are likely due trying to run BoltzTraP using Python3.9 when it is a Python2 program. I imagine some of these errors can be ...
4 votes

How to compute the synthetic accessibility score in Python?

Ertl and Schuffenhauer, who developed the synthetic accessibility score, provide an implementation packaged with RDKit called sascorer.py. This is provided in the Contrib folder of the RDKit repo; ...
user avatar
  • 14.1k
3 votes
Accepted

How to compute the overlap matrix in Python

Here is an updated version of your code that I believe now works. I had to add in a few of the values that were computed elsewhere in your code, but otherwise it is mostly the same. ...
user avatar
  • 14.1k
3 votes

How to generate the high symmetry paths for band structure calculations?

Here are a couple of extra links that might be helpful in your (now 5months old) quest: [1], [2]. It would be helpful for all of us if you could put up that green chekmarck on the answers you found ...
user avatar
  • 1,256
3 votes
Accepted

How to read data from an input and form two-electrons integral?

I'm not sure how your current code is supposed to work. Focusing just on the first half: ...
user avatar
  • 14.1k
3 votes

How to edit the first line of XYZ file?

It should be easy to achieve what you want with a bash script. For a file named test.xyz, it can be achieved with: ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible