Skip to main content

Questions tagged [programming]

Questions about programming.

Filter by
Sorted by
Tagged with
6 votes
1 answer
343 views

Explicit Examples for Unrestricted Hartree Fock Calculations

I am currently working on writing a Hartree Fock program in C++, currently using the STO-3G basis set. My program works well for the restricted case, but I am running into some issues with the ...
frobenius's user avatar
  • 313
3 votes
0 answers
36 views

Writing a plugin in LAMMPS

I am trying to write a plugin in LAMMPS that would need to compute the energy between two atoms as a function of the first atoms coordination number. From the LAMMPS GitHub repository, I found that ...
Hemanth Haridas's user avatar
7 votes
1 answer
646 views

pyscf: Why should the choice of pseudopotential determine the total energy, and not the physics?

I have limited experience with DFT, but as an exercise I have written a DFT program of an atom (from scratch using nothing more than python built in functions and numpy) by following Richard Martin's ...
Mik Mus's user avatar
  • 437
5 votes
2 answers
127 views

Explicit form of Hartree Fock analytic gradient with contracted GTOs? With or without density fitting

Does anyone know of a paper, textbook, or other resource which outlines the expression for the analytic gradient of the HF energy (restricted or otherwise) in terms of Dunning's contracted Gaussian-...
Rob L's user avatar
  • 71
6 votes
3 answers
2k views

What programming language do matter modelers generally use?

I thought Python was a reasonably popular language among matter modelers. However, I saw a comment in one of my posted questions (in which I posted a Python code) that the commenter was unfamiliar ...
user366312's user avatar
  • 2,708
7 votes
3 answers
3k 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 ...
Al1010's user avatar
  • 165
8 votes
2 answers
421 views

Python to extract data from two files, and then do a calculation with those data

There are two files named ‘OUTCAR’ and ‘POSCAR’. The ‘OUTCAR’ file consists of many lines including the following (Screenshot 1): (It is noted that, there are data for 48 ions in that OUTCAR file, ...
Bip's user avatar
  • 81
3 votes
2 answers
277 views

Is this "internal error" reproducible when compiling OpenMolcas on other Intel compilers?

The procedure I've been following to build OpenMolcas with an Intel Fortran compiler in the Compute Canada environment is as follows: ...
Nike Dattani - No Free Time's user avatar
5 votes
1 answer
5k views

How may I run a .py file in a Jupyter notebook?

In terminal, I run a python code like this way: python code.py file.txt Or it might also work as: ./code.py file.txt Where the ...
Sak's user avatar
  • 781
3 votes
2 answers
265 views

How to use the GDB debugger with OpenMolcas?

I would like to follow how some variables are changing during an OpenMolcas calculation, and adding WRITE statements has become too tedious. I've compiled with the <...
Nike Dattani - No Free Time's user avatar
1 vote
1 answer
105 views

Interstitial charge from a cube file: Need help in python coding

I have a test material- two silicon atoms in an unit cell. This particular structure shows evidence of having interstitial charge between the two atoms. I need to find out the amount of this ...
Sak's user avatar
  • 781
13 votes
3 answers
275 views

Improving my programming for computational chemistry/physics

What are some good textbooks or online resources to improve my skills in C++, C and Fortran, specifically for computational chemistry. For example, I am interested in learning about parallelisation ...
Fracton's user avatar
  • 271
7 votes
3 answers
364 views

Extracting data from a file, using python or bash. Requesting help

I have some directories, named ‘abc-000, abc-001, abc-002, …… abc-100’. The path of the directory can be, for example, \home\abc-000 and so on. Inside each directory, there is a file named ‘OUTCAR’. ...
Sak's user avatar
  • 781
6 votes
1 answer
253 views

Which functionals should I include for a simple hydrogen atom system?

I am writing my own (orbital-free, for now) 3D density functional theory code from scratch. It currently works correctly for the simple harmonic oscillator potential $V_\text{ext}(\mathbf r) = \frac12\...
dftsolo's user avatar
  • 61
6 votes
1 answer
247 views

Symmetrization of elastic constants based on rotational symmetry in Pymatgen

I am trying to write a small python script which will symmetrize an elastic tensor based on rotational symmetry of the space group. I started with this link and created a new python script as below. I ...
Pranav kumar's user avatar
  • 4,376
3 votes
2 answers
562 views

How to merge two files (molecule structure and file property) into one?

I've run some calculations with the xtb software. From its output I got XYZ and MOL files ...
Camps's user avatar
  • 24.2k
6 votes
1 answer
1k views

Why does VASP use -O2 optimization by default rather than -O3?

When compiling VASP, I am wondering why the OFLAG = -O2 is suggested as default. For performance reason, I would use ...
Memories's user avatar
  • 353
4 votes
2 answers
660 views

Find with grep in terminal last hit in log file

I use grep to find the string "Converged?" with the terminal in several folders to read the output from my gaussian ...
Andrea's user avatar
  • 866
14 votes
1 answer
183 views

Looking for crystal generator library

I am looking for a C or a C++ library that can do crystal generation, that is, multiply unit cells in one or more directions with symmetry information. (in other words, generate supercells). I have ...
alfC's user avatar
  • 281
7 votes
1 answer
299 views

Calculate number of electrons per shell for an atom

Suppose you are given the atomic number of an element, e.g. Technetium, which is 43. Is it possible to return an array which shows the distribution of electrons across different shells of an atom ...
Rithish's user avatar
  • 71
22 votes
9 answers
9k views

How to master Fortran with minimal effort?

Fortran language is used in many first-principles matter modeling codes, such as VASP and QE. These codes usually include many ...
Jack's user avatar
  • 15.4k
9 votes
1 answer
355 views

Help with translating Hamiltonian into matrix

Eq. 19 in this paper gives the following Hamiltonian: $\sigma_a, \tau_a, \eta_a$ are respectively the spin, sublattice pseudospin and valley pseudospin respectively. Normally, I would have chosen a ...
TribalChief's user avatar
  • 2,431
14 votes
3 answers
913 views

Script to generate input files for benchmark purpose

I would like to run some benchmark of different DFT functionals. The most time consuming part is obviously the generation of the input files. I'm not a programmer, but I think this could be done by ...
NickZ's user avatar
  • 1,509
20 votes
7 answers
6k views

Convert XYZ coordinates to Z-matrix

I want to make a python script that will load an xyz file. From the xyz parameters, I need to find the distance between atoms, angle and dihedral between atoms. The file xyz have this structure: ...
Jose Pinto's user avatar